Skip to content

Commit 40cb53f

Browse files
authored
Merge pull request #39 from deltamarnix/pixi
Enable pixi
2 parents d8a13e7 + 9a39b40 commit 40cb53f

File tree

8 files changed

+8063
-29
lines changed

8 files changed

+8063
-29
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# GitHub syntax highlighting
2+
pixi.lock linguist-language=YAML linguist-generated=true

.github/workflows/ci.yml

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,15 @@ jobs:
2020
- name: Checkout repo
2121
uses: actions/checkout@v4
2222

23-
- name: Setup Python
24-
uses: actions/setup-python@v5
23+
- name: Setup pixi
24+
uses: prefix-dev/setup-[email protected]
2525
with:
26-
python-version: "3.10"
27-
cache: 'pip'
28-
cache-dependency-path: pyproject.toml
29-
30-
- name: Install Python packages
31-
run: pip install ".[lint]"
26+
pixi-version: v0.32.0
27+
environments: dev
28+
activate-environment: true
3229

3330
- name: Run ruff
34-
run: ruff check .
31+
run: pixi run lint
3532

3633
build:
3734
name: Build
@@ -41,22 +38,18 @@ jobs:
4138
- name: Checkout repo
4239
uses: actions/checkout@v3
4340

44-
- name: Setup Python
45-
uses: actions/setup-python@v5
41+
- name: Setup pixi
42+
uses: prefix-dev/setup-[email protected]
4643
with:
47-
python-version: "3.10"
48-
49-
- name: Install Python packages
50-
run: |
51-
pip install --upgrade pip
52-
pip install build twine
53-
pip --verbose install .
44+
pixi-version: v0.32.0
45+
environments: dev
46+
activate-environment: true
5447

5548
- name: Print package version
5649
run: python -c "from flopy4 import version; print(version.__version__)"
5750

5851
- name: Build package
59-
run: python -m build
52+
run: pixi run build
6053

6154
test:
6255
name: Test
@@ -68,7 +61,7 @@ jobs:
6861
fail-fast: false
6962
matrix:
7063
os: [ ubuntu-22.04, macos-12, windows-2022 ]
71-
python: [ "3.10", "3.11", "3.12" ]
64+
python: [ "310", "311", "312" ]
7265
env:
7366
GCC_V: 11
7467
steps:
@@ -81,13 +74,12 @@ jobs:
8174
with:
8275
repo: modflow6-nightly-build
8376

84-
- name: Setup Python
85-
uses: actions/setup-python@v5
77+
- name: Setup pixi
78+
uses: prefix-dev/setup-[email protected]
8679
with:
87-
python-version: ${{ matrix.python }}
88-
89-
- name: Install Python packages
90-
run: pip install ".[test]"
80+
pixi-version: v0.32.0
81+
environments: test${{ matrix.python }}
82+
activate-environment: true
9183

9284
- name: Run tests
93-
run: pytest -v -n auto
85+
run: pixi run test

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
build/
22
docs/examples/*.ipynb
33
venv/
4-
.vscode
54
.DS_Store
65
.ruff_cache
76
*.egg-info
8-
**/__pycache__/
7+
**/__pycache__/
8+
9+
# pixi environments
10+
.pixi
11+
*.egg-info

.vscode/launch.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Python Debugger: Current File",
9+
"type": "debugpy",
10+
"request": "launch",
11+
"program": "${file}",
12+
"console": "integratedTerminal",
13+
"purpose": ["debug-test"]
14+
}
15+
]
16+
}

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"python.testing.pytestArgs": [
3+
"test"
4+
],
5+
"python.testing.unittestEnabled": false,
6+
"python.testing.pytestEnabled": true
7+
}

open-vscode.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pixi run -e dev code . | exit

pixi.lock

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

pyproject.toml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ test = [
6464
"pytest-dotenv",
6565
"pytest-xdist",
6666
]
67+
build = [
68+
"build",
69+
"twine",
70+
]
6771

6872
[tool.setuptools]
6973
include-package-data = true
@@ -107,3 +111,37 @@ ignore = [
107111
"E722", # do not use bare `except`
108112
"E741", # ambiguous variable name
109113
]
114+
115+
[tool.pixi.project]
116+
channels = ["conda-forge"]
117+
platforms = ["win-64", "linux-64", "osx-64"]
118+
119+
[tool.pixi.system-requirements]
120+
macos = "12.0"
121+
122+
[tool.pixi.pypi-dependencies]
123+
flopy4 = { path = ".", editable = true }
124+
125+
[tool.pixi.feature.py310.dependencies]
126+
python = "3.10"
127+
128+
[tool.pixi.feature.py311.dependencies]
129+
python = "3.11"
130+
131+
[tool.pixi.feature.py312.dependencies]
132+
python = "3.12"
133+
134+
[tool.pixi.environments]
135+
test310 = { features = ["py310", "test"], solve-group = "py310" }
136+
test311 = { features = ["py311", "test"], solve-group = "py311" }
137+
test312 = { features = ["py312", "test"], solve-group = "py312" }
138+
dev = { features = ["py312", "test", "lint", "build"], solve-group = "py312" }
139+
140+
[tool.pixi.feature.build.tasks]
141+
build = { cmd = "python -m build" }
142+
143+
[tool.pixi.feature.test.tasks]
144+
test = { cmd = "pytest -v -n auto" }
145+
146+
[tool.pixi.feature.lint.tasks]
147+
lint = { cmd = "ruff check ." }

0 commit comments

Comments
 (0)