From 1b457dcbd4b8288b66ebb8bad8d2d78d3819afb2 Mon Sep 17 00:00:00 2001 From: Chintan Joshi Date: Thu, 28 Mar 2024 15:51:38 +0300 Subject: [PATCH 1/5] build: python 3.11 support --- .github/workflows/ci.yml | 8 ++--- 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 +++++++++++++---------- setup.py | 1 + tox.ini | 7 ++-- 10 files changed, 118 insertions(+), 125 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6815697..2c7b4d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,8 +15,8 @@ jobs: strategy: matrix: os: [ubuntu-20.04] - python-version: ['3.8'] - toxenv: [django32, django40, quality] + python-version: ['3.8', '3.11'] + toxenv: [quality, django42] steps: - uses: actions/checkout@v2 - name: Setup Python @@ -24,7 +24,7 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install APT Packages - run: sudo apt-get install libblas-dev liblapack-dev gfortran + run: sudo apt-get update && sudo apt-get install -y libblas-dev liblapack-dev gfortran - name: Install dependencies run: pip install -r requirements/ci.txt - name: Run Tests @@ -32,7 +32,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 diff --git a/requirements/base.txt b/requirements/base.txt index c80e58e..eaa2424 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.11 +# 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.24.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.10.1 # 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..8beb574 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.11 +# 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.4 # 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.3 # 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.24.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.10.1 # 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.2 # 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..77488de 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.11 +# by the following command: # # pip-compile --output-file=requirements/pip.txt requirements/pip.in # -wheel==0.37.1 +wheel==0.43.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..803bfd4 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.11 +# 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.43.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..0bbbcd4 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.11 +# 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.24.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.10.1 # 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..9efd68d 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.11 +# 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.4 # 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.24.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.10.1 # 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..1fe6553 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.11 +# 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.3 # 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.2 # via -r requirements/tox.in -virtualenv==20.16.5 +virtualenv==20.25.1 # via tox diff --git a/setup.py b/setup.py index 29a381c..f53256b 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.11', ], ) diff --git a/tox.ini b/tox.ini index 9cf3f3c..a60f7f3 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,10 @@ [tox] -envlist = py38-django{32,40},quality +envlist = py{38, 311}-django{42},quality [testenv] deps = -r{toxinidir}/requirements/test.txt - django32: Django>=3.2,<4.0 - django40: Django>=4.0,<4.1 + django42: Django>=4.2,<4.3 commands = coverage run setup.py test python -m coverage xml @@ -13,7 +12,7 @@ commands = [testenv:quality] deps = -r{toxinidir}/requirements/quality.txt - django32: Django>=3.2,<4.0 + django42: Django>=4.2,<4.3 commands = pycodestyle chem/__init__.py chem/tests/__init__.py pylint chem/__init__.py chem/tests/ From bcdc50ad80425fd045333a1c3b0dc3ae038502b8 Mon Sep 17 00:00:00 2001 From: Chintan Joshi Date: Thu, 28 Mar 2024 15:52:06 +0300 Subject: [PATCH 2/5] build: python 3.1 support related change instead fr.gcd use math.gcd --- 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 79ffd855b3b6084d5653cd2a7bc04b18ac1b2f91 Mon Sep 17 00:00:00 2001 From: Chintan Joshi Date: Wed, 3 Apr 2024 19:35:27 +0300 Subject: [PATCH 3/5] build: make upgrade with python 3.8 instead of 3.11 --- requirements/base.txt | 2 +- requirements/ci.txt | 7 ++++++- requirements/pip.txt | 2 +- requirements/pip_tools.txt | 15 +++++++++++++-- requirements/quality.txt | 8 +++++++- requirements/test.txt | 2 +- requirements/tox.txt | 6 +++++- 7 files changed, 34 insertions(+), 8 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index eaa2424..3d2aa21 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.11 +# This file is autogenerated by pip-compile with Python 3.8 # by the following command: # # pip-compile --output-file=requirements/base.txt requirements/base.in diff --git a/requirements/ci.txt b/requirements/ci.txt index 8beb574..9c5bbf9 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.11 +# This file is autogenerated by pip-compile with Python 3.8 # by the following command: # # pip-compile --output-file=requirements/ci.txt requirements/ci.in @@ -69,6 +69,11 @@ regex==2023.12.25 # nltk scipy==1.10.1 # via -r requirements/test.txt +tomli==2.0.1 + # via + # -r requirements/tox.txt + # pyproject-api + # tox tox==4.14.2 # via -r requirements/tox.txt tqdm==4.66.2 diff --git a/requirements/pip.txt b/requirements/pip.txt index 77488de..02773d1 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.11 +# This file is autogenerated by pip-compile with Python 3.8 # by the following command: # # pip-compile --output-file=requirements/pip.txt requirements/pip.in diff --git a/requirements/pip_tools.txt b/requirements/pip_tools.txt index 803bfd4..4cdba00 100644 --- a/requirements/pip_tools.txt +++ b/requirements/pip_tools.txt @@ -1,13 +1,17 @@ # -# This file is autogenerated by pip-compile with Python 3.11 +# This file is autogenerated by pip-compile with Python 3.8 # by the following command: # # pip-compile --output-file=requirements/pip_tools.txt requirements/pip_tools.in # -build==1.1.1 +build==1.2.1 # via pip-tools click==8.1.7 # via pip-tools +importlib-metadata==6.11.0 + # via + # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt + # build packaging==24.0 # via build pip-tools==7.4.1 @@ -16,8 +20,15 @@ pyproject-hooks==1.0.0 # via # build # pip-tools +tomli==2.0.1 + # via + # build + # pip-tools + # pyproject-hooks wheel==0.43.0 # via pip-tools +zipp==3.18.1 + # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: # pip diff --git a/requirements/quality.txt b/requirements/quality.txt index 0bbbcd4..aa86f3d 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.11 +# This file is autogenerated by pip-compile with Python 3.8 # by the following command: # # pip-compile --output-file=requirements/quality.txt requirements/quality.in @@ -42,9 +42,15 @@ regex==2023.12.25 # nltk scipy==1.10.1 # via -r requirements/base.txt +tomli==2.0.1 + # via pylint tomlkit==0.12.4 # via pylint tqdm==4.66.2 # via # -r requirements/base.txt # nltk +typing-extensions==4.10.0 + # via + # astroid + # pylint diff --git a/requirements/test.txt b/requirements/test.txt index 9efd68d..daf0169 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.11 +# This file is autogenerated by pip-compile with Python 3.8 # by the following command: # # pip-compile --output-file=requirements/test.txt requirements/test.in diff --git a/requirements/tox.txt b/requirements/tox.txt index 1fe6553..e614685 100644 --- a/requirements/tox.txt +++ b/requirements/tox.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.11 +# This file is autogenerated by pip-compile with Python 3.8 # by the following command: # # pip-compile --output-file=requirements/tox.txt requirements/tox.in @@ -28,6 +28,10 @@ pluggy==1.4.0 # via tox pyproject-api==1.6.1 # via tox +tomli==2.0.1 + # via + # pyproject-api + # tox tox==4.14.2 # via -r requirements/tox.in virtualenv==20.25.1 From 2ed44d73a60ec149c855e5d35280fc99d473809b Mon Sep 17 00:00:00 2001 From: Chintan Joshi Date: Wed, 3 Apr 2024 19:35:46 +0300 Subject: [PATCH 4/5] chore: bump version --- chem/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chem/__init__.py b/chem/__init__.py index 9136b81..383a111 100644 --- a/chem/__init__.py +++ b/chem/__init__.py @@ -1,3 +1,3 @@ """ init """ -__version__ = '1.2.0' +__version__ = '1.2.1' From fd7438f170b2fdb887c71333cc0840167310dbf8 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Mon, 22 Apr 2024 10:13:58 -0400 Subject: [PATCH 5/5] build: Bump a minor version instead of patch version --- chem/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chem/__init__.py b/chem/__init__.py index 383a111..b385500 100644 --- a/chem/__init__.py +++ b/chem/__init__.py @@ -1,3 +1,3 @@ """ init """ -__version__ = '1.2.1' +__version__ = '1.3.0'