Skip to content

Commit

Permalink
Relax numpy constraints (#88)
Browse files Browse the repository at this point in the history
* relax numpy constraints

* relax numpy constraints

* CI

* ci

* ci

* ci

* ci
  • Loading branch information
normanrz authored Jul 11, 2024
1 parent d3ae27e commit b240b3f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 29 deletions.
39 changes: 20 additions & 19 deletions .github/workflows/python-module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- uses: actions/upload-artifact@v3
with:
name: wheels
name: wheels-lin
path: ./python/dist/*.whl

- name: Make sdist
Expand All @@ -61,11 +61,11 @@ jobs:
path: ./python/dist/*.tar.gz

build_mac:
runs-on: macos-12
runs-on: macos-13
strategy:
max-parallel: 4
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -83,7 +83,7 @@ jobs:
run: |
cd python
export PATH=$PATH:$HOME/.cargo/bin
pip install wheel
pip install wheel setuptools
python setup.py bdist_wheel -p macosx-10.9-universal2
pip install dist/*.whl
- name: Test
Expand All @@ -93,9 +93,9 @@ jobs:
pip install pytest
pytest tests
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-mac-py${{ matrix.python-version }}
path: ./python/dist/*.whl

build_win:
Expand All @@ -106,18 +106,18 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: "x64" # (x64 or x86)
- name: Build
run: |
cd python
pip install wheel
pip install wheel setuptools
python setup.py bdist_wheel -p $(python -c "import distutils.util; print(distutils.util.get_platform())")
pip install dist/*.whl
- name: Test
Expand All @@ -133,9 +133,9 @@ jobs:
python -c "import wkw"
pytest tests -k "not big_read"
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-win-py${{ matrix.python-version }}
path: ./python/dist/*.whl

publish:
Expand All @@ -147,20 +147,21 @@ jobs:
runs-on: ubuntu-latest
if: startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: "0"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.11"
- name: Get wheels
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: wheels
pattern: wheels-*
merge-multiple: true
path: dist
- name: Get tar.gz
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: targz
path: dist
Expand Down
4 changes: 2 additions & 2 deletions python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM quay.io/pypa/manylinux2014_x86_64
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH \
PYBIN=/opt/python/cp37-cp37m/bin
PYBIN=/opt/python/cp312-cp312/bin

RUN git config --global --add safe.directory /app

Expand All @@ -13,7 +13,7 @@ RUN curl https://sh.rustup.rs -sSf | sh -s -- --no-modify-path -y; \
cargo --version; \
rustc --version;

RUN for PYBIN in /opt/python/{cp37-cp37m,cp38-cp38,cp39-cp39,cp310-cp310,cp311-cp311}/bin; do \
RUN for PYBIN in /opt/python/{cp38-cp38,cp39-cp39,cp310-cp310,cp311-cp311,cp312-cp312}/bin; do \
echo "--> $PYBIN"; \
$PYBIN/pip install \
numpy \
Expand Down
3 changes: 1 addition & 2 deletions python/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
cffi
numpy>=1.15,==1.*
numpy<1.22; python_version < '3.8'
numpy>=1.15
7 changes: 1 addition & 6 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,6 @@ def run(self):
packages=find_packages(),
include_package_data=True,
license="MIT",
install_requires=["cffi", "numpy>=1.15,==1.*"],
extras_require={
':python_version < "3.8"': [
"numpy<1.22",
],
},
install_requires=["cffi", "numpy>=1.15"],
cmdclass={"build_py": BuildPyCommand},
)

0 comments on commit b240b3f

Please sign in to comment.