Skip to content

MAINT: Python 3.12 cleanups part 2 - #4301

Merged
IAlibay merged 1 commit into
MDAnalysis:developfrom
tylerjereddy:treddy_transformations_modernize
Oct 12, 2023
Merged

MAINT: Python 3.12 cleanups part 2#4301
IAlibay merged 1 commit into
MDAnalysis:developfrom
tylerjereddy:treddy_transformations_modernize

Conversation

@tylerjereddy

@tylerjereddy tylerjereddy commented Sep 24, 2023

Copy link
Copy Markdown
Member
  • PyUnicode_GetSize has been deprecated since CPython 3.3, and is now gone in 3.12, so replace it with the suggestion from the official docs, PyUnicode_GET_LENGTH; this seems to fix 9 more failures with 3.12.0rc3 locally while still passing with 3.11.x

  • while I'm in the transformations neighborhood, get rid of the Python 2.x shims peppered all over the place--we're long past supporting that

[skip cirrus]


📚 Documentation preview 📚: https://mdanalysis--4301.org.readthedocs.build/en/4301/

* `PyUnicode_GetSize` has been deprecated since CPython 3.3,
and is now gone in 3.12, so replace it with the suggestion
from the official docs, `PyUnicode_GET_LENGTH`; this seems
to fix 9 more failures with `3.12.0rc3` locally while still
passing with `3.11.x`

* while I'm in the `transformations` neighborhood, get
rid of the Python 2.x shims peppered all over the place--we're
long past supporting that

[skip cirrus]
@github-actions

Copy link
Copy Markdown

Linter Bot Results:

Hi @tylerjereddy! Thanks for making this PR. We linted your code and found the following:

There are currently no issues detected! 🎉

@codecov

codecov Bot commented Sep 24, 2023

Copy link
Copy Markdown

Codecov Report

Patch and project coverage have no change.

Comparison is base (427f1a7) 93.40% compared to head (9b60378) 93.40%.

Additional details and impacted files
@@            Coverage Diff             @@
##           develop    #4301     +/-   ##
==========================================
  Coverage    93.40%   93.40%             
==========================================
  Files          170      184     +14     
  Lines        22257    23365   +1108     
  Branches      4071     4071             
==========================================
+ Hits         20790    21825   +1035     
- Misses         951     1024     +73     
  Partials       516      516             

see 14 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

tylerjereddy added a commit to tylerjereddy/mdanalysis that referenced this pull request Oct 2, 2023
* force the use of a relative path for `mkdtemp` in our source code
because, from the Python `3.12` release notes:

> `tempfile.mkdtemp() now always returns an absolute path, even if the
argument provided to the dir parameter is a relative path.`

* with this patch, the full testsuite now passes on Python `3.12.0`
(which is now out) when combined with MDAnalysisgh-4301 and MDAnalysisgh-4300 (though
see my cautions about thread safety/concurrency for the latter)

* this fixes the 1 remaining failure with 3.12:
`MDAnalysisTests/analysis/test_hole2.py::TestCheckAndFixLongFilename::test_symlink_dir`

[skip cirrus]
IAlibay pushed a commit that referenced this pull request Oct 12, 2023
* force the use of a relative path for `mkdtemp` in our source code
because, from the Python `3.12` release notes:

> `tempfile.mkdtemp() now always returns an absolute path, even if the
argument provided to the dir parameter is a relative path.`

* with this patch, the full testsuite now passes on Python `3.12.0`
(which is now out) when combined with gh-4301 and gh-4300 (though
see my cautions about thread safety/concurrency for the latter)

* this fixes the 1 remaining failure with 3.12:
`MDAnalysisTests/analysis/test_hole2.py::TestCheckAndFixLongFilename::test_symlink_dir`

[skip cirrus]
@IAlibay
IAlibay merged commit 8e9d19b into MDAnalysis:develop Oct 12, 2023
@tylerjereddy
tylerjereddy deleted the treddy_transformations_modernize branch October 15, 2023 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants