From 4a2a8a1f734076f792a66706d09c9e3077fb75de Mon Sep 17 00:00:00 2001 From: Chintan Joshi Date: Mon, 11 Mar 2024 11:19:17 +0300 Subject: [PATCH 1/4] build: python 3.12 support --- requirements/base.txt | 22 ++++++------- requirements/ci.txt | 67 ++++++++++++++++++++------------------ requirements/pip.txt | 6 ++-- requirements/pip_tools.txt | 22 +++++-------- requirements/quality.txt | 46 ++++++++++---------------- requirements/test.txt | 24 +++++++------- requirements/tox.txt | 40 +++++++++++++---------- tox.ini | 6 ++-- 8 files changed, 114 insertions(+), 119 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index c80e58e..e228fd4 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -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 diff --git a/requirements/ci.txt b/requirements/ci.txt index 8691905..8ef487b 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -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 diff --git a/requirements/pip.txt b/requirements/pip.txt index 5ea2ba5..3f7b506 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -1,10 +1,10 @@ # -# 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/pip.txt requirements/pip.in # -wheel==0.37.1 +wheel==0.42.0 # via -r requirements/pip.in # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/pip_tools.txt b/requirements/pip_tools.txt index f696fed..ef89ddf 100644 --- a/requirements/pip_tools.txt +++ b/requirements/pip_tools.txt @@ -1,26 +1,22 @@ # -# 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/pip_tools.txt requirements/pip_tools.in # -build==0.8.0 +build==1.1.1 # via pip-tools -click==8.1.3 +click==8.1.7 # via pip-tools -packaging==21.3 +packaging==24.0 # via build -pep517==0.13.0 - # via build -pip-tools==6.8.0 +pip-tools==7.4.1 # via -r requirements/pip_tools.in -pyparsing==3.0.9 - # via packaging -tomli==2.0.1 +pyproject-hooks==1.0.0 # via # build - # pep517 -wheel==0.37.1 + # pip-tools +wheel==0.42.0 # via pip-tools # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/quality.txt b/requirements/quality.txt index d1b864f..c213114 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -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 diff --git a/requirements/test.txt b/requirements/test.txt index c1d036b..d3aa24f 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -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 diff --git a/requirements/tox.txt b/requirements/tox.txt index e29ecc0..3282f0e 100644 --- a/requirements/tox.txt +++ b/requirements/tox.txt @@ -1,30 +1,34 @@ # -# 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/tox.txt requirements/tox.in # -distlib==0.3.6 +cachetools==5.3.3 + # via tox +chardet==5.2.0 + # via tox +colorama==0.4.6 + # via tox +distlib==0.3.8 # via virtualenv -filelock==3.8.0 +filelock==3.13.1 # via # tox # virtualenv -packaging==21.3 - # via tox -platformdirs==2.5.2 - # via virtualenv -pluggy==1.0.0 - # via tox -py==1.11.0 - # via tox -pyparsing==3.0.9 - # via packaging -six==1.16.0 +packaging==24.0 + # via + # pyproject-api + # tox +platformdirs==4.2.0 + # via + # tox + # virtualenv +pluggy==1.4.0 # via tox -tomli==2.0.1 +pyproject-api==1.6.1 # via tox -tox==3.26.0 +tox==4.14.1 # via -r requirements/tox.in -virtualenv==20.16.5 +virtualenv==20.25.1 # via tox diff --git a/tox.ini b/tox.ini index 20dafff..2cbad23 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,9 @@ [tox] -envlist = py{38, 312}-django{42},quality +envlist = py{312}-django{42},quality [testenv] deps = + setuptools -r{toxinidir}/requirements/test.txt django42: Django>=4.2,<4.3 @@ -12,8 +13,9 @@ commands = [testenv:quality] deps = + setuptools -r{toxinidir}/requirements/quality.txt - django32: Django>=3.2,<4.0 + commands = pycodestyle chem/__init__.py chem/tests/__init__.py pylint chem/__init__.py chem/tests/ From a9eba488f5d2d5bed47906241da33cbfa2f6d326 Mon Sep 17 00:00:00 2001 From: Chintan Joshi Date: Mon, 11 Mar 2024 11:20:20 +0300 Subject: [PATCH 2/4] build: replace fr.gcd with math.gcd as part of python 3.12 upgrade --- chem/miller.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chem/miller.py b/chem/miller.py index 86b567d..3e81683 100644 --- a/chem/miller.py +++ b/chem/miller.py @@ -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)) def segment_to_fraction(distance): From 269183926d7cf96c93c100af85b03170bc86634e Mon Sep 17 00:00:00 2001 From: Chintan Joshi Date: Mon, 11 Mar 2024 11:28:22 +0300 Subject: [PATCH 3/4] chore: add python 3.12 in setup.py file --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 29a381c..52109ca 100644 --- a/setup.py +++ b/setup.py @@ -67,5 +67,6 @@ def get_version(*file_paths): 'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.12', ], ) From 9ab0ce05adbb4e0b8d067a77c515d8bda77ef68d Mon Sep 17 00:00:00 2001 From: Chintan Joshi Date: Mon, 11 Mar 2024 12:38:09 +0300 Subject: [PATCH 4/4] build: remove python 3.8 from workflows --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 17b207f..d2e8a17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,6 @@ jobs: matrix: os: [ubuntu-20.04] python-version: - - '3.8' - '3.12' toxenv: [quality, django42] steps: @@ -34,7 +33,7 @@ jobs: TOXENV: ${{ matrix.toxenv }} run: tox - name: Run Coverage - if: matrix.python-version == '3.8' && matrix.toxenv=='django32' + if: matrix.python-version == '3.8' && matrix.toxenv=='django42' uses: codecov/codecov-action@v2 with: fail_ci_if_error: true