Skip to content

Commit

Permalink
Merge pull request #39 from deltamarnix/pixi
Browse files Browse the repository at this point in the history
Enable pixi
  • Loading branch information
deltamarnix authored Oct 8, 2024
2 parents d8a13e7 + 9a39b40 commit 40cb53f
Show file tree
Hide file tree
Showing 8 changed files with 8,063 additions and 29 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# GitHub syntax highlighting
pixi.lock linguist-language=YAML linguist-generated=true
46 changes: 19 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,15 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
- name: Setup pixi
uses: prefix-dev/setup-[email protected]
with:
python-version: "3.10"
cache: 'pip'
cache-dependency-path: pyproject.toml

- name: Install Python packages
run: pip install ".[lint]"
pixi-version: v0.32.0
environments: dev
activate-environment: true

- name: Run ruff
run: ruff check .
run: pixi run lint

build:
name: Build
Expand All @@ -41,22 +38,18 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v5
- name: Setup pixi
uses: prefix-dev/setup-[email protected]
with:
python-version: "3.10"

- name: Install Python packages
run: |
pip install --upgrade pip
pip install build twine
pip --verbose install .
pixi-version: v0.32.0
environments: dev
activate-environment: true

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

- name: Build package
run: python -m build
run: pixi run build

test:
name: Test
Expand All @@ -68,7 +61,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-22.04, macos-12, windows-2022 ]
python: [ "3.10", "3.11", "3.12" ]
python: [ "310", "311", "312" ]
env:
GCC_V: 11
steps:
Expand All @@ -81,13 +74,12 @@ jobs:
with:
repo: modflow6-nightly-build

- name: Setup Python
uses: actions/setup-python@v5
- name: Setup pixi
uses: prefix-dev/setup-[email protected]
with:
python-version: ${{ matrix.python }}

- name: Install Python packages
run: pip install ".[test]"
pixi-version: v0.32.0
environments: test${{ matrix.python }}
activate-environment: true

- name: Run tests
run: pytest -v -n auto
run: pixi run test
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
build/
docs/examples/*.ipynb
venv/
.vscode
.DS_Store
.ruff_cache
*.egg-info
**/__pycache__/
**/__pycache__/

# pixi environments
.pixi
*.egg-info
16 changes: 16 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"purpose": ["debug-test"]
}
]
}
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"python.testing.pytestArgs": [
"test"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}
1 change: 1 addition & 0 deletions open-vscode.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pixi run -e dev code . | exit
7,975 changes: 7,975 additions & 0 deletions pixi.lock

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ test = [
"pytest-dotenv",
"pytest-xdist",
]
build = [
"build",
"twine",
]

[tool.setuptools]
include-package-data = true
Expand Down Expand Up @@ -107,3 +111,37 @@ ignore = [
"E722", # do not use bare `except`
"E741", # ambiguous variable name
]

[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["win-64", "linux-64", "osx-64"]

[tool.pixi.system-requirements]
macos = "12.0"

[tool.pixi.pypi-dependencies]
flopy4 = { path = ".", editable = true }

[tool.pixi.feature.py310.dependencies]
python = "3.10"

[tool.pixi.feature.py311.dependencies]
python = "3.11"

[tool.pixi.feature.py312.dependencies]
python = "3.12"

[tool.pixi.environments]
test310 = { features = ["py310", "test"], solve-group = "py310" }
test311 = { features = ["py311", "test"], solve-group = "py311" }
test312 = { features = ["py312", "test"], solve-group = "py312" }
dev = { features = ["py312", "test", "lint", "build"], solve-group = "py312" }

[tool.pixi.feature.build.tasks]
build = { cmd = "python -m build" }

[tool.pixi.feature.test.tasks]
test = { cmd = "pytest -v -n auto" }

[tool.pixi.feature.lint.tasks]
lint = { cmd = "ruff check ." }

0 comments on commit 40cb53f

Please sign in to comment.