Skip to content

Commit

Permalink
Merge pull request #88 from wells-wood-research/bug/CYTHON-86
Browse files Browse the repository at this point in the history
Bug/cython-86
  • Loading branch information
ChrisWellsWood authored Dec 13, 2023
2 parents c360c2b + ac5dee9 commit a50638a
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 19 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/python-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Python Build

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install --upgrade pip
pip install .
pip install -r dev-requirements.txt
- name: Lint with flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
- name: Build wheel
run: |
pip install wheel
python setup.py bdist_wheel
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ RUN pip install --upgrade pip && pip install Cython
# Install build dependencies from pyproject.toml and runtime dependencies from setup.py
RUN pip install .

RUN pip install -r requirements.txt
RUN pip install -r dev-requirements.txt
15 changes: 4 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,9 @@ pip install aposteriori
Change directory to the aposteriori folder if you have not done so already:

```sh
git clone https://github.com/wells-wood-research/aposteriori/tree/master
cd aposteriori/
```

Install requirements:

```sh
pip install -r requirements.txt
```

Install aposteriori

```sh
Expand Down Expand Up @@ -261,7 +255,7 @@ cd aposteriori/
Install dependencies:
```sh
pip install -r requirements.txt
pip install -r dev-requirements.txt
```
Install aposteriori:
Expand All @@ -282,15 +276,14 @@ pytest tests/
```
### Conda and Pip
### Pip (only)
Alternatively you can install the repository with pip:
```shell
git clone https://github.com/wells-wood-research/aposteriori.git
cd aposteriori/
pip install -r requirements.txt
pip install -r dev-requirements.txt
```
Install aposteriori:
Expand Down
6 changes: 4 additions & 2 deletions requirements.txt → dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ampal==1.5.0
ampal==1.5.1
click==8.1.7
h5py==3.8.0
hypothesis==6.91.0
numpy==1.22
numpy
pytest==6.2.5
setuptools==67.8.0
flake8
32 changes: 32 additions & 0 deletions make_wheels.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
set -e -u -x

function repair_wheel {
wheel="$1"
if ! auditwheel show "$wheel"; then
echo "Skipping non-platform wheel $wheel"
else
auditwheel repair "$wheel" --plat "$PLAT" -w /io/wheelhouse/
fi
}


# Install a system package required by our library
yum install -y atlas-devel

# Compile wheels
for PYBIN in /opt/python/*/bin; do
"${PYBIN}/pip" install -r /io/dev-requirements.txt
"${PYBIN}/pip" wheel /io/ --no-deps -w wheelhouse/
done

# Bundle external shared libraries into the wheels
for whl in wheelhouse/*.whl; do
repair_wheel "$whl"
done

# Install packages and test
for PYBIN in /opt/python/*/bin/; do
"${PYBIN}/pip" install python-manylinux-demo --no-index -f /io/wheelhouse
(cd "$HOME"; "${PYBIN}/nosetests" pymanylinuxdemo)
done
15 changes: 14 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
[build-system]
requires = ["setuptools>=40.6.0", "wheel", "Cython"]
requires = ["setuptools", "wheel", "Cython"]
build-backend = "setuptools.build_meta"

[project]
name = "Aposteriori"
version = "2.1.2"
requires-python = ">= 3.8"
readme = "README.md"
dependencies = [
"ampal==1.5.1",
"click==8.1.7",
"h5py==3.8.0",
"numpy",
"flake8"
]
16 changes: 12 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from setuptools import setup, find_packages
from setuptools import find_packages, setup

with open("README.md", "r") as fh:
long_description = fh.read()

setup(
name="aposteriori",
version="2.1.1",
version="2.1.2",
author="Wells Wood Research Group",
author_email="[email protected]",
description="A library for the voxelization of protein structures for protein design.",
Expand All @@ -20,9 +20,17 @@
python_requires=">=3.8",
packages=find_packages("src"),
package_dir={"": "src"},
setup_requires=[
"Cython",
],
entry_points={
"console_scripts": [
"make-frame-dataset=aposteriori.data_prep.cli:cli",
],
},
install_requires=[
"ampal==1.5.0",
"ampal==1.5.1",
"click==8.1.7",
"h5py==3.8.0",
"numpy==1.22",
],
)

0 comments on commit a50638a

Please sign in to comment.