diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 8868d37..d5366bd 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -27,8 +27,8 @@ jobs: - name: Install dependencies run: | pip install --upgrade pip - pip install flake8 pytest hypothesis cython - python setup.py install + pip install . + pip install -r dev-requirements.txt - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..8d596bc --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,15 @@ +[build-system] +requires = ["setuptools", "wheel", "Cython"] +build-backend = "setuptools.build_meta" + +[project] +name = "AMPAL" +version = "1.5.1" +requires-python = ">= 3.8" +readme = "README.md" +dependencies = [ + "Cython", + "networkx==3.1", + "numpy==1.22", + "requests", +] diff --git a/setup.py b/setup.py index 720b1cc..ca02bdd 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ def readme(): setup( name="AMPAL", - version="1.5.0", + version="1.5.1", description="A simple framework for representing biomolecular structure.", long_description=readme(), long_description_content_type="text/markdown; charset=UTF-8; variant=GFM", @@ -31,12 +31,15 @@ def readme(): packages=find_packages("src"), package_dir={"": "src"}, include_package_data=True, + setup_requires=[ + "Cython", + ], # This code automatically builds the Cython extensions. ext_modules=cythonize( [ Extension("ampal.geometry", ["src/ampal/geometry.pyx"]), ] ), - install_requires=["Cython", "networkx", "numpy==1.22", "requests"], + install_requires=["Cython", "networkx==3.1", "numpy==1.22", "requests"], zip_safe=False, ) diff --git a/src/ampal/amino_acids.py b/src/ampal/amino_acids.py index cdeaa48..1074fc0 100644 --- a/src/ampal/amino_acids.py +++ b/src/ampal/amino_acids.py @@ -763,7 +763,6 @@ def get_aa_letter(aa_code): return aa_letter - def get_aa_info(code): """Get dictionary of information relating to a new amino acid code not currently in the database. @@ -795,7 +794,7 @@ def get_aa_info(code): ) r = requests.get(url_string) # Raise error if content not obtained. - if not r.ok: + if not r.ok or "does not exist" in r.text: raise IOError("Could not get to url {0}".format(url_string)) # Parse r.text in an ugly way to get the required information. @@ -814,7 +813,6 @@ def get_aa_info(code): } return aa_dict - def add_amino_acid_to_json( code, description, letter="X", modified=None, force_add=False ):