Skip to content

Commit

Permalink
feat: add python 3.11 support (#78)
Browse files Browse the repository at this point in the history
* build: python 3.11 support

* use math.gcd instead of fractions.gcd since that was deprecated in 3.5 and is gone in newer versions of python.

---------

Co-authored-by: Feanil Patel <[email protected]>
  • Loading branch information
ichintanjoshi and feanil authored Apr 22, 2024
1 parent 3765413 commit 707b280
Show file tree
Hide file tree
Showing 12 changed files with 137 additions and 117 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,24 @@ 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
uses: actions/setup-python@v2
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
env:
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
2 changes: 1 addition & 1 deletion chem/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
""" init """

__version__ = '1.2.0'
__version__ = '1.3.0'
5 changes: 3 additions & 2 deletions chem/miller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
22 changes: 11 additions & 11 deletions requirements/base.txt
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.8
# 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
64 changes: 36 additions & 28 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
@@ -1,78 +1,86 @@
#
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
# 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
#
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
# pyproject-api
# 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
6 changes: 3 additions & 3 deletions requirements/pip.txt
Original file line number Diff line number Diff line change
@@ -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.8
# 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:
Expand Down
31 changes: 19 additions & 12 deletions requirements/pip_tools.txt
Original file line number Diff line number Diff line change
@@ -1,27 +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.8
# by the following command:
#
# pip-compile --output-file=requirements/pip_tools.txt requirements/pip_tools.in
#
build==0.8.0
build==1.2.1
# via pip-tools
click==8.1.3
click==8.1.7
# via pip-tools
packaging==21.3
# via build
pep517==0.13.0
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==6.8.0
pip-tools==7.4.1
# via -r requirements/pip_tools.in
pyparsing==3.0.9
# via packaging
pyproject-hooks==1.0.0
# via
# build
# pip-tools
tomli==2.0.1
# via
# build
# pep517
wheel==0.37.1
# 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
Expand Down
42 changes: 19 additions & 23 deletions requirements/quality.txt
Original file line number Diff line number Diff line change
@@ -1,60 +1,56 @@
#
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
# 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
#
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
# via pylint
tomlkit==0.11.4
tomlkit==0.12.4
# via pylint
tqdm==4.64.1
tqdm==4.66.2
# via
# -r requirements/base.txt
# nltk
typing-extensions==4.3.0
typing-extensions==4.10.0
# via
# astroid
# pylint
wrapt==1.14.1
# via astroid
24 changes: 12 additions & 12 deletions requirements/test.txt
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.8
# 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
Loading

0 comments on commit 707b280

Please sign in to comment.