Skip to content

Commit 6cbc6f9

Browse files
authored
Migrate to pixi (#30)
1 parent f56cd14 commit 6cbc6f9

34 files changed

+6997
-329
lines changed

.dprint.jsonc

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"json": {
3+
"lineWidth": 88,
4+
"array.preferSingleLine": true,
5+
},
6+
"markdown": {
7+
"lineWidth": 88,
8+
"emphasisKind": "asterisks",
9+
},
10+
"markup": {
11+
"printWidth": 88,
12+
},
13+
"toml": {
14+
"lineWidth": 88,
15+
},
16+
"yaml": {
17+
"printWidth": 88,
18+
"formatComments": true,
19+
"braceSpacing": false,
20+
},
21+
"excludes": [
22+
"**/*-lock.json",
23+
"**/*.lock",
24+
"**/node_modules/",
25+
"dist/",
26+
"doc/requirements.yml",
27+
],
28+
"plugins": [
29+
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.1.wasm",
30+
"https://plugins.dprint.dev/json-0.20.0.wasm",
31+
"https://plugins.dprint.dev/markdown-0.19.0.wasm",
32+
"https://plugins.dprint.dev/toml-0.7.0.wasm",
33+
"https://plugins.dprint.dev/g-plane/markup_fmt-v0.22.0.wasm",
34+
],
35+
}

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
# SCM syntax highlighting & preventing 3-way merges
2+
pixi.lock merge=binary linguist-language=YAML linguist-generated=true
13
# reduce the number of merge conflicts
24
doc/whats-new.rst merge=union

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
- [ ] Closes #xxxx
22
- [ ] Tests added / passed
3-
- [ ] Passes `pre-commit run --all-files`

.github/workflows/docs.yml

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,24 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Checkout
18-
uses: actions/checkout@v4
18+
uses: actions/checkout@v6
1919

20-
- name: Setup Conda Environment
21-
uses: conda-incubator/setup-miniconda@v3
20+
- uses: prefix-dev/setup-pixi@v0
2221
with:
23-
miniforge-version: latest
24-
use-mamba: true
25-
environment-file: ci/requirements-docs.yml
26-
activate-environment: pshell-docs
22+
pixi-version: v0.62.1
23+
cache: true
24+
environments: docs
2725

28-
- name: Show conda options
29-
run: conda config --show
26+
- name: Regenerate readthedocs environment
27+
run: pixi run doc-requirements
3028

31-
- name: conda info
32-
run: conda info
33-
34-
- name: conda list
35-
run: conda list
36-
37-
- name: Install
38-
run: python -m pip install --no-deps -e .
29+
- name: Check that readthedocs environment is up to date in git
30+
run: git diff --exit-code doc/requirements.yml
3931

4032
- name: Build docs
41-
run: sphinx-build -n -j auto -b html -d build/doctrees doc build/html
33+
run: pixi run -e docs docs
4234

43-
- uses: actions/upload-artifact@v4
35+
- uses: actions/upload-artifact@v6
4436
with:
4537
name: pshell-docs
4638
path: build/html

.github/workflows/lint.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Linting
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: ["*"]
8+
9+
jobs:
10+
checks:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v6
14+
- uses: prefix-dev/setup-pixi@v0
15+
with:
16+
pixi-version: v0.62.1
17+
cache: true
18+
environments: lint
19+
- name: Run linters
20+
run: pixi run lint
21+
- name: Check for changed files after linting
22+
run: git diff --exit-code

.github/workflows/pre-commit.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/workflows/pytest.yml

Lines changed: 34 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -10,78 +10,57 @@ on:
1010
# When this workflow is queued, automatically cancel any previous running
1111
# or pending jobs from the same branch
1212
concurrency:
13-
group: tests-${{ github.ref }}
13+
group: pytest-${{ github.ref }}
1414
cancel-in-progress: true
1515

1616
defaults:
1717
run:
1818
shell: bash -l {0}
1919

2020
jobs:
21-
build:
22-
name:
23-
${{ matrix.os }} ${{ matrix.python-version }} ${{ matrix.requirements }}
24-
runs-on: ${{ matrix.os }}-latest
21+
test:
22+
name: ${{ matrix.os }} ${{ matrix.environment }}
23+
runs-on: ${{ matrix.os }}
2524
strategy:
2625
fail-fast: false
2726
matrix:
28-
os: [ubuntu]
29-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
30-
requirements: [latest]
31-
include:
32-
# Test on macos and windows (first and last version of python only)
33-
- os: macos
34-
python-version: "3.8"
35-
requirements: latest
36-
- os: macos
37-
python-version: "3.13"
38-
requirements: latest
39-
- os: windows
40-
python-version: "3.8"
41-
requirements: latest
42-
- os: windows
43-
python-version: "3.13"
44-
requirements: latest
45-
# Test on minimal requirements
46-
- os: ubuntu
47-
python-version: "3.8"
48-
requirements: minimal
49-
- os: macos
50-
python-version: "3.8"
51-
requirements: minimal
52-
- os: windows
53-
python-version: "3.8"
54-
requirements: minimal
27+
os:
28+
- ubuntu-latest # x86-64
29+
- ubuntu-24.04-arm # ARM
30+
- macos-15-intel # x86-64
31+
- macos-latest # ARM
32+
- windows-latest # x86-64
33+
environment:
34+
- smoke
35+
- mindeps
36+
- py310
37+
- py314
38+
# include:
39+
# - os: ubuntu-latest
40+
# environment: nogil
5541

5642
steps:
5743
- name: Checkout
58-
uses: actions/checkout@v4
59-
with:
60-
fetch-depth: 0
44+
uses: actions/checkout@v6
6145

62-
- name: Setup Conda Environment
63-
uses: conda-incubator/setup-miniconda@v3
46+
- uses: prefix-dev/setup-pixi@v0
6447
with:
65-
miniforge-version: latest
66-
use-mamba: true
67-
python-version: ${{ matrix.python-version }}
68-
environment-file: ci/requirements-${{ matrix.requirements }}.yml
69-
activate-environment: pshell
70-
71-
- name: Show conda options
72-
run: conda config --show
73-
74-
- name: conda info
75-
run: conda info
48+
pixi-version: v0.62.1
49+
environments: ${{ matrix.environment }}
50+
cache: true
51+
locked: true
7652

77-
- name: conda list
78-
run: conda list
53+
- name: Smoke test
54+
run: pixi run -e ${{ matrix.environment }} smoke-test
7955

80-
- name: Install
81-
run: python -m pip install --no-deps -e .
56+
- name: pytest with coverage
57+
if: matrix.environment != 'smoke'
58+
run: pixi run -e ${{ matrix.environment }} coverage
8259

83-
- name: pytest
84-
run: py.test --verbose --cov=pshell --cov-report=xml
60+
# - name: Free-threading stress test
61+
# if: matrix.environment == 'nogil'
62+
# run: pixi run -e nogil tests --parallel-threads=4
8563

8664
- name: codecov.io
87-
uses: codecov/codecov-action@v3
65+
if: matrix.environment != 'smoke'
66+
uses: codecov/codecov-action@v5

.github/workflows/wheels.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Wheels
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: ["*"]
8+
9+
defaults:
10+
run:
11+
shell: bash -l {0}
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v6
19+
with:
20+
fetch-depth: 0 # Fetch full git history for hatch-vcs
21+
fetch-tags: true # Fetch tags for hatch-vcs
22+
23+
- uses: prefix-dev/setup-pixi@v0
24+
with:
25+
pixi-version: v0.62.1
26+
cache: true
27+
environments: dist
28+
29+
- name: Build sdist and wheels
30+
run: pixi run dist
31+
32+
- name: Set up Python
33+
uses: actions/setup-python@v6
34+
with:
35+
python-version: "3.14"
36+
37+
- name: Install wheel
38+
run: pip install dist/*.whl
39+
40+
- name: Smoke test
41+
working-directory: /tmp
42+
run: |
43+
cp ${{ github.workspace }}/smoke_test.py .
44+
python smoke_test.py
45+
46+
- uses: actions/upload-artifact@v6
47+
with:
48+
name: dist
49+
path: dist/*
50+
if-no-files-found: error

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# pixi environments
2+
.pixi/*
3+
!.pixi/config.toml
4+
15
*.pyc
26
__pycache__
37

@@ -60,3 +64,4 @@ Icon*
6064
doc/_build
6165
Untitled.ipynb
6266
htmlcov/
67+
.~lock.*

.pre-commit-config.yaml

Lines changed: 0 additions & 61 deletions
This file was deleted.

0 commit comments

Comments
 (0)