Skip to content

Commit 46c5245

Browse files
authored
Merge pull request #47 from tsutterley/pixi
add pixi build for easy install
2 parents 15d8ac0 + b4ffd24 commit 46c5245

7 files changed

Lines changed: 8178 additions & 25 deletions

File tree

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# SCM syntax highlighting & preventing 3-way merges
2+
pixi.lock merge=binary linguist-language=YAML linguist-generated=true

.github/workflows/python-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ jobs:
2121
- name: Install dependencies
2222
run: |
2323
python -m pip install --upgrade pip
24-
pip install setuptools wheel twine
24+
pip install build setuptools wheel twine
2525
- name: Build and publish
2626
env:
2727
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
2828
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
2929
run: |
30-
python setup.py sdist bdist_wheel
30+
python -m build
3131
twine upload dist/*
3232

.github/workflows/python-request.yml

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,39 +13,31 @@ jobs:
1313
strategy:
1414
matrix:
1515
os: [ubuntu-latest, macos-latest]
16-
python-version: [3.11]
1716
env:
1817
OS: ${{ matrix.os }}
19-
PYTHON: ${{ matrix.python-version }}
2018
defaults:
2119
run:
2220
shell: bash -l {0}
2321

2422
steps:
2523
- uses: actions/checkout@v4
26-
- name: Set up mamba ${{ matrix.python-version }}
27-
uses: mamba-org/setup-micromamba@v1
28-
with:
29-
micromamba-version: 'latest'
30-
environment-file: environment.yml
31-
init-shell: bash
32-
environment-name: pointCollection
33-
cache-environment: true
34-
post-cleanup: 'all'
35-
create-args: >-
36-
python=${{ matrix.python-version }}
37-
flake8
38-
pytest
39-
pytest-cov
40-
cython
24+
- name: Set up pixi environment
25+
uses: prefix-dev/setup-pixi@v0.9.1
4126
- name: Lint with flake8
4227
run: |
4328
# stop the build if there are Python syntax errors or undefined names
44-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
29+
pixi run lint
4530
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
46-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
31+
pixi run lint "--exit-zero --max-complexity=10 --max-line-length=127"
32+
- name: Install pointCollection
33+
run: |
34+
# install the package in editable mode
35+
pip install --no-deps --editable .
4736
- name: Test with pytest
4837
run: |
49-
pip install --no-deps .
50-
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
51-
pytest --verbose --capture=no
38+
pixi run coverage
39+
- name: Archive code coverage results
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: code-coverage-report-${{ matrix.os }}
43+
path: coverage.xml

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ eggs/
1717
lib/
1818
lib64/
1919
parts/
20+
.pixi/
2021
sdist/
2122
var/
2223
wheels/

pixi.lock

Lines changed: 8110 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pointCollection/scripts/fix_indices.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import glob
66
import re
77

8-
main():
8+
def main():
99

1010
file_re=re.compile('file_\d+')
1111

pyproject.toml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,51 @@ python_files = [
8181
testpaths = [
8282
"test"
8383
]
84+
85+
[tool.pixi.workspace]
86+
name = "pointCollection"
87+
authors = ["pointCollection contributors"]
88+
channels = ["conda-forge"]
89+
platforms = ["osx-arm64", "linux-64", "win-64"]
90+
91+
[tool.pixi.pypi-dependencies]
92+
pointCollection = { path = ".", editable = true }
93+
94+
[tool.pixi.environments]
95+
default = { solve-group = "default" }
96+
dev = { features = ["dev"], solve-group = "default" }
97+
98+
[tool.pixi.tasks.jupyter]
99+
cmd = "jupyter-notebook"
100+
cwd = "notebooks"
101+
description = "Start Jupyter Notebooks in the notebooks directory"
102+
103+
[tool.pixi.tasks.export-env]
104+
args = [ { "arg" = "flags", "default" = "" } ]
105+
cmd = "pixi workspace export conda-environment {{ flags }} > environment.yml"
106+
description = "Export workspace to a conda environment file"
107+
108+
[tool.pixi.feature.dev.tasks.coverage]
109+
cmd = "pytest --cov=pointCollection --junitxml=pytest.xml --cov-report=xml test"
110+
description = "Run the pytest suite and create coverage reports"
111+
112+
[tool.pixi.feature.dev.tasks.lint]
113+
args = [ { "arg" = "flags", "default" = "--select=E9,F63,F7,F82 --show-source" }, { "arg" = "directory", "default" = "." } ]
114+
cmd = "flake8 {{ directory }} --count {{ flags }} --statistics --extend-exclude 'build/,*.ipynb_checkpoints/,.pixi/'"
115+
description = "Run flake8 to check for compilation errors"
116+
117+
[tool.pixi.dependencies]
118+
gdal = "*"
119+
h5py = "*"
120+
matplotlib-base = "*"
121+
netCDF4 = "*"
122+
notebook = "*"
123+
numpy = "*"
124+
pyproj = "*"
125+
scipy = ">=1.10.1"
126+
shapely = "*"
127+
128+
[tool.pixi.feature.dev.dependencies]
129+
flake8 = "*"
130+
pytest = ">=4.6"
131+
pytest-cov = "*"

0 commit comments

Comments
 (0)