-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: add python 3.12 support #76
Closed
ichintanjoshi
wants to merge
4
commits into
openedx:jenkins/add-python312-support-3765413
from
ichintanjoshi:jenkins/add-python312-support-3765413
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
4a2a8a1
build: python 3.12 support
ichintanjoshi a9eba48
build: replace fr.gcd with math.gcd as part of python 3.12 upgrade
ichintanjoshi 2691839
chore: add python 3.12 in setup.py file
ichintanjoshi 9ab0ce0
build: remove python 3.8 from workflows
ichintanjoshi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,9 +18,10 @@ def lcm(a, b): | |
a, b: floats | ||
|
||
Returns: | ||
float | ||
int: Because math.gcd will only return int after python 3.9 | ||
Previously it depended on type of args, now it'll only return int | ||
""" | ||
return a * b / fr.gcd(a, b) | ||
return a * b / math.gcd(int(a), int(b)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure if this is the right way to do it, can anyone else take a look into this ? Had to change from |
||
|
||
|
||
def segment_to_fraction(distance): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
# | ||
# This file is autogenerated by pip-compile with python 3.8 | ||
# To update, run: | ||
# This file is autogenerated by pip-compile with Python 3.12 | ||
# by the following command: | ||
# | ||
# pip-compile --output-file=requirements/base.txt requirements/base.in | ||
# | ||
click==8.1.3 | ||
click==8.1.7 | ||
# via nltk | ||
joblib==1.1.0 | ||
joblib==1.3.2 | ||
# via nltk | ||
markupsafe==2.1.1 | ||
markupsafe==2.1.5 | ||
# via -r requirements/base.in | ||
nltk==3.7 | ||
nltk==3.8.1 | ||
# via -r requirements/base.in | ||
numpy==1.23.3 | ||
numpy==1.26.4 | ||
# via | ||
# -r requirements/base.in | ||
# scipy | ||
pyparsing==3.0.9 | ||
pyparsing==3.1.2 | ||
# via -r requirements/base.in | ||
regex==2022.9.11 | ||
regex==2023.12.25 | ||
# via nltk | ||
scipy==1.9.1 | ||
scipy==1.12.0 | ||
# via -r requirements/base.in | ||
tqdm==4.64.1 | ||
tqdm==4.66.2 | ||
# via nltk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,81 @@ | ||
# | ||
# This file is autogenerated by pip-compile with python 3.8 | ||
# To update, run: | ||
# This file is autogenerated by pip-compile with Python 3.12 | ||
# by the following command: | ||
# | ||
# pip-compile --output-file=requirements/ci.txt requirements/ci.in | ||
# | ||
click==8.1.3 | ||
cachetools==5.3.3 | ||
# via | ||
# -r requirements/tox.txt | ||
# tox | ||
chardet==5.2.0 | ||
# via | ||
# -r requirements/tox.txt | ||
# tox | ||
click==8.1.7 | ||
# via | ||
# -r requirements/test.txt | ||
# nltk | ||
coverage==6.4.4 | ||
colorama==0.4.6 | ||
# via | ||
# -r requirements/tox.txt | ||
# tox | ||
coverage==7.4.3 | ||
# via -r requirements/test.txt | ||
distlib==0.3.6 | ||
distlib==0.3.8 | ||
# via | ||
# -r requirements/tox.txt | ||
# virtualenv | ||
filelock==3.8.0 | ||
filelock==3.13.1 | ||
# via | ||
# -r requirements/tox.txt | ||
# tox | ||
# virtualenv | ||
joblib==1.1.0 | ||
joblib==1.3.2 | ||
# via | ||
# -r requirements/test.txt | ||
# nltk | ||
markupsafe==2.1.1 | ||
markupsafe==2.1.5 | ||
# via -r requirements/test.txt | ||
nltk==3.7 | ||
nltk==3.8.1 | ||
# via -r requirements/test.txt | ||
numpy==1.23.3 | ||
numpy==1.26.4 | ||
# via | ||
# -r requirements/test.txt | ||
# scipy | ||
packaging==21.3 | ||
packaging==24.0 | ||
# via | ||
# -r requirements/tox.txt | ||
# pyproject-api | ||
# tox | ||
platformdirs==2.5.2 | ||
platformdirs==4.2.0 | ||
# via | ||
# -r requirements/tox.txt | ||
# tox | ||
# virtualenv | ||
pluggy==1.0.0 | ||
pluggy==1.4.0 | ||
# via | ||
# -r requirements/tox.txt | ||
# tox | ||
py==1.11.0 | ||
pyparsing==3.1.2 | ||
# via -r requirements/test.txt | ||
pyproject-api==1.6.1 | ||
# via | ||
# -r requirements/tox.txt | ||
# tox | ||
pyparsing==3.0.9 | ||
# via | ||
# -r requirements/test.txt | ||
# -r requirements/tox.txt | ||
# packaging | ||
regex==2022.9.11 | ||
regex==2023.12.25 | ||
# via | ||
# -r requirements/test.txt | ||
# nltk | ||
scipy==1.9.1 | ||
scipy==1.12.0 | ||
# via -r requirements/test.txt | ||
six==1.16.0 | ||
# via | ||
# -r requirements/tox.txt | ||
# tox | ||
tomli==2.0.1 | ||
# via | ||
# -r requirements/tox.txt | ||
# tox | ||
tox==3.26.0 | ||
tox==4.14.1 | ||
# via -r requirements/tox.txt | ||
tqdm==4.64.1 | ||
tqdm==4.66.2 | ||
# via | ||
# -r requirements/test.txt | ||
# nltk | ||
virtualenv==20.16.5 | ||
virtualenv==20.25.1 | ||
# via | ||
# -r requirements/tox.txt | ||
# tox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,50 @@ | ||
# | ||
# This file is autogenerated by pip-compile with python 3.8 | ||
# To update, run: | ||
# This file is autogenerated by pip-compile with Python 3.12 | ||
# by the following command: | ||
# | ||
# pip-compile --output-file=requirements/quality.txt requirements/quality.in | ||
# | ||
astroid==2.12.9 | ||
astroid==3.1.0 | ||
# via pylint | ||
click==8.1.3 | ||
click==8.1.7 | ||
# via | ||
# -r requirements/base.txt | ||
# nltk | ||
dill==0.3.5.1 | ||
dill==0.3.8 | ||
# via pylint | ||
isort==5.10.1 | ||
isort==5.13.2 | ||
# via pylint | ||
joblib==1.1.0 | ||
joblib==1.3.2 | ||
# via | ||
# -r requirements/base.txt | ||
# nltk | ||
lazy-object-proxy==1.7.1 | ||
# via astroid | ||
markupsafe==2.1.1 | ||
markupsafe==2.1.5 | ||
# via -r requirements/base.txt | ||
mccabe==0.7.0 | ||
# via pylint | ||
nltk==3.7 | ||
nltk==3.8.1 | ||
# via -r requirements/base.txt | ||
numpy==1.23.3 | ||
numpy==1.26.4 | ||
# via | ||
# -r requirements/base.txt | ||
# scipy | ||
platformdirs==2.5.2 | ||
platformdirs==4.2.0 | ||
# via pylint | ||
pycodestyle==2.9.1 | ||
pycodestyle==2.11.1 | ||
# via -r requirements/quality.in | ||
pylint==2.15.2 | ||
pylint==3.1.0 | ||
# via -r requirements/quality.in | ||
pyparsing==3.0.9 | ||
pyparsing==3.1.2 | ||
# via -r requirements/base.txt | ||
regex==2022.9.11 | ||
regex==2023.12.25 | ||
# via | ||
# -r requirements/base.txt | ||
# nltk | ||
scipy==1.9.1 | ||
scipy==1.12.0 | ||
# via -r requirements/base.txt | ||
tomli==2.0.1 | ||
tomlkit==0.12.4 | ||
# via pylint | ||
tomlkit==0.11.4 | ||
# via pylint | ||
tqdm==4.64.1 | ||
tqdm==4.66.2 | ||
# via | ||
# -r requirements/base.txt | ||
# nltk | ||
typing-extensions==4.3.0 | ||
# via | ||
# astroid | ||
# pylint | ||
wrapt==1.14.1 | ||
# via astroid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,36 @@ | ||
# | ||
# This file is autogenerated by pip-compile with python 3.8 | ||
# To update, run: | ||
# This file is autogenerated by pip-compile with Python 3.12 | ||
# by the following command: | ||
# | ||
# pip-compile --output-file=requirements/test.txt requirements/test.in | ||
# | ||
click==8.1.3 | ||
click==8.1.7 | ||
# via | ||
# -r requirements/base.txt | ||
# nltk | ||
coverage==6.4.4 | ||
coverage==7.4.3 | ||
# via -r requirements/test.in | ||
joblib==1.1.0 | ||
joblib==1.3.2 | ||
# via | ||
# -r requirements/base.txt | ||
# nltk | ||
markupsafe==2.1.1 | ||
markupsafe==2.1.5 | ||
# via -r requirements/base.txt | ||
nltk==3.7 | ||
nltk==3.8.1 | ||
# via -r requirements/base.txt | ||
numpy==1.23.3 | ||
numpy==1.26.4 | ||
# via | ||
# -r requirements/base.txt | ||
# scipy | ||
pyparsing==3.0.9 | ||
pyparsing==3.1.2 | ||
# via -r requirements/base.txt | ||
regex==2022.9.11 | ||
regex==2023.12.25 | ||
# via | ||
# -r requirements/base.txt | ||
# nltk | ||
scipy==1.9.1 | ||
scipy==1.12.0 | ||
# via -r requirements/base.txt | ||
tqdm==4.64.1 | ||
tqdm==4.66.2 | ||
# via | ||
# -r requirements/base.txt | ||
# nltk |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't remove 3.8 testing, just add 3.12 testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, so with 3.8 workflow what's happening is a conflict in
numpy
, because we've updated all the versions.Something like what's happening here https://github.com/openedx/openedx-calc/actions/runs/8231433530/job/22568231165?pr=99#step:7:11
So should I downgrade numpy version and check if that'll work with both 3.8 and 3.12 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally you can add a version of numpy that will work with both versions to
https://github.com/openedx/openedx-chem/blob/master/requirements/constraints.txt
along with a comment that we can remove the constraint once the 3.8 testing is removed.With the numpy package in particular, it may make more sense to add it here: https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt since we use it in many packages across our ecosystem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@feanil current version of numpy with python 3.8 is
1.23.x
here as well as in openedx/openedx-calc#99 and it's being upgraded to1.26.4
.I manually tried to find a common version between them, python 3.8 will support till
numpy==1.24.x
and if we do try to install it with python 3.12, it will giveAttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
This error comes as a result of 3.12 removingImpImporter
ref or it could be because numpy depends on old pip. Also I tried to look into numpy notes but could not find an overlap with a version that'd support 3.8 and 3.12with python 3.8, numpy maximum version supported is 1.24.4
and with python 3.12, numpy minimum version supported is 1.26.0 numpy news
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, I noticed this as well in a different spot that pulls numpy. Given the importance of the package, I think we'll have to target 3.11 for edx-platform and its dependencies first and then do the 3.12 upgrade in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @feanil okay, so should I raise another similar PR ? with 3.11 support right ? Or should I make changes here itself ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a separate PR to add testing for 3.11 and fixing any bugs that causes makes the most sense I think.