Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename distutils.sysconfig to sysconfig #1068

Merged
merged 2 commits into from Dec 16, 2023
Merged

Conversation

MilesCranmer
Copy link
Contributor

Required for Python 3.12 as distutils is removed.

@stevengj do you think you review and merge this when you get a chance? It's only a one-word change and is required for 3.12 compatibility in PyJulia.

cc @mkitti

Fixes JuliaPy/pyjulia#538 (hopefully)

- Required for Python 3.12 as distutils is removed.
@codecov-commenter
Copy link

codecov-commenter commented Dec 15, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d407513) 67.75% compared to head (f4915f1) 67.75%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1068   +/-   ##
=======================================
  Coverage   67.75%   67.75%           
=======================================
  Files          20       20           
  Lines        2025     2025           
=======================================
  Hits         1372     1372           
  Misses        653      653           
Flag Coverage Δ
unittests 67.75% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@stevengj
Copy link
Member

Then it will break earlier versions? Can you try both names in a try-catch block?

@MilesCranmer
Copy link
Contributor Author

This sysconfig module was introduced by itself in Python 3.2. distutils has basically been a symlink to it since 3.2, then deprecated in 3.10 and 3.11, and removed in 3.12. But sysconfig has been there since 3.2.

@stevengj
Copy link
Member

We still support older versions.

@MilesCranmer
Copy link
Contributor Author

Even before Python 3.2? I don’t think they are even supported from Python itself anymore:

All official maintenance for Python 3.2, including security patches, has ended.

Python 2.7 is also retired and has no support from Python itself.

I could add a try catch if you want though?

@MilesCranmer
Copy link
Contributor Author

2.7 was retired in 2020 after a decade of maintenance patches:

We have decided that January 1, 2020, was the day that we sunset Python 2. That means that we will not improve it anymore after that day, even if someone finds a security problem in it.

https://www.python.org/doc/sunset-python-2/

We dropped support for 2.7 in PyJulia because of this. Maybe could do the same in PyCall.jl?

@MilesCranmer
Copy link
Contributor Author

MilesCranmer commented Dec 15, 2023

If someone really wants to use an unmaintained, 10+ year old version of Python, with all of its security issues, I assume they would be technically skilled enough to also install an old version of PyCall that does support it, right?

And if they don’t have the technical knowledge to do that, I think it’s actually safer to throw an error about unsupported Python, than to let themselves put themselves at risk.

@MilesCranmer
Copy link
Contributor Author

@stevengj I realise this is likely something to discuss in a future PR though. So to help speed up this fix I have implemented a try-catch for earlier Python.

FYI the Python 2.7 CI failures look to be from 2.7 not being available.

@stevengj
Copy link
Member

Thanks, LGTM. Indeed, I would prefer having a conversation about dropping older Python versions in a separate PR.

@stevengj stevengj merged commit 790e62f into JuliaPy:master Dec 16, 2023
16 of 18 checks passed
@MilesCranmer MilesCranmer deleted the fix-3-12 branch December 16, 2023 14:09
MilesCranmer added a commit to MilesCranmer/PyCall.jl that referenced this pull request Jan 8, 2024
[Diff since v1.96.3](JuliaPy/PyCall.jl@v1.96.3...v1.96.4)

**Merged pull requests:**
- Rename `distutils.sysconfig` to `sysconfig` (JuliaPy#1068) (@MilesCranmer)
- bump to 1.96.4 (JuliaPy#1070) (@stevengj)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants