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

Create cython backend #1

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
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
68 changes: 49 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ jobs:

- name: pylint check
run: |
python -m pylint src/gstools/
python -m pylint src/gstools_cython/

- name: cython-lint check
run: |
cython-lint src/gstools/
cython-lint src/gstools_cython/

build_wheels:
name: wheels for ${{ matrix.os }}
Expand All @@ -76,27 +76,27 @@ jobs:
path: ./dist/*.whl

build_sdist:
name: sdist on ${{ matrix.os }} with py ${{ matrix.ver.py }} numpy${{ matrix.ver.np }} scipy${{ matrix.ver.sp }}
name: sdist on ${{ matrix.os }} with py ${{ matrix.ver.py }} numpy${{ matrix.ver.np }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
# https://github.com/scipy/oldest-supported-numpy/blob/main/setup.cfg
ver:
- {py: '3.8', np: '==1.20.0', sp: '==1.5.4'}
- {py: '3.9', np: '==1.20.0', sp: '==1.5.4'}
- {py: '3.10', np: '==1.21.6', sp: '==1.7.2'}
- {py: '3.11', np: '==1.23.2', sp: '==1.9.2'}
- {py: '3.12', np: '==1.26.2', sp: '==1.11.2'}
- {py: '3.12', np: '>=2.0.0rc1', sp: '>=1.13.0'}
- {py: '3.8', np: '==1.20.0'}
- {py: '3.9', np: '==1.20.0'}
- {py: '3.10', np: '==1.21.6'}
- {py: '3.11', np: '==1.23.2'}
- {py: '3.12', np: '==1.26.2'}
- {py: '3.12', np: '>=2.0.0rc1'}
exclude:
- os: macos-14
ver: {py: '3.8', np: '==1.20.0', sp: '==1.5.4'}
ver: {py: '3.8', np: '==1.20.0'}
- os: macos-14
ver: {py: '3.9', np: '==1.20.0', sp: '==1.5.4'}
ver: {py: '3.9', np: '==1.20.0'}
- os: macos-14
ver: {py: '3.10', np: '==1.21.6', sp: '==1.7.2'}
ver: {py: '3.10', np: '==1.21.6'}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -110,21 +110,18 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build "coveralls>=3.0.0"
pip install build

- name: Install GSTools
- name: Install GSTools-Cython
env:
GSTOOLS_BUILD_PARALLEL: 1
run: |
pip install -v --editable .[test]

- name: Run tests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pip install "numpy${{ matrix.ver.np }}" "scipy${{ matrix.ver.sp }}"
python -m pytest --cov gstools --cov-report term-missing -v tests/
python -m coveralls --service=github
pip install "numpy${{ matrix.ver.np }}"
python -m pytest -v tests/

- name: Build sdist
run: |
Expand All @@ -136,6 +133,39 @@ jobs:
with:
path: dist/*.tar.gz

coverage:
name: coverage
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'

- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install "coveralls>=3.0.0"

- name: Install GSTools-Cython
env:
GSTOOLS_CY_COV: 1
run: |
pip install -v --editable .[test]

- name: Run tests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pip install "numpy${{ matrix.ver.np }}"
python -m pytest --cov gstools_cython --cov-report term-missing -v tests/
python -m coveralls --service=github

upload_to_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ info/
*.cpp

# generated version file
src/gstools/_version.py
src/gstools_cython/_version.py

# generated docs
docs/source/examples/
Expand Down
6 changes: 1 addition & 5 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{
"license": "LGPL-3.0+",
"license": "LGPL-3.0-or-later",
"contributors": [
{
"type": "Other",
"name": "Bane Sullivan"
},
{
"orcid": "0000-0002-2547-8102",
"affiliation": "Helmholtz Centre for Environmental Research - UFZ",
Expand Down
460 changes: 6 additions & 454 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
prune **
recursive-include tests *.py
recursive-include src/gstools *.py *.pyx
recursive-include src/gstools_cython *.py *.pyx
include AUTHORS.md LICENSE README.md pyproject.toml setup.py
Loading
Loading