Skip to content
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

Add cython as dependency to the install #19

Merged
merged 7 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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",
]
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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,
)
4 changes: 1 addition & 3 deletions src/ampal/amino_acids.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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.
Expand All @@ -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
):
Expand Down