Skip to content

Commit f069e2d

Browse files
Try using pixi instead of conda
1 parent 1bf9d1d commit f069e2d

File tree

7 files changed

+1616
-18
lines changed

7 files changed

+1616
-18
lines changed

.gitattributes

+2
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/main.yml

+8-16
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,20 @@ jobs:
1212
python-version: ["3.9", "3.11", "3.13"]
1313
steps:
1414
- uses: actions/checkout@v3
15-
- uses: conda-incubator/setup-miniconda@v3.0.4
15+
- uses: prefix-dev/setup-pixi@v0.8.3
1616
with:
17-
miniforge-version: latest
18-
conda-version: ">=24.11"
19-
conda-build-version: ">=25.1"
20-
environment-file: environment.yml
21-
activate-environment: mkxref-dev
22-
python-version: ${{ matrix.python-version }}
23-
condarc-file: github-condarc.yml
24-
auto-activate-base: true
25-
use-mamba: false
26-
- name: Dev install package
27-
run: |
28-
conda run -n mkxref-dev pip install -e . --no-deps --no-build-isolation
17+
pixi-version: v0.43.3
18+
cache: true
19+
auth-host: prefix.dev
20+
auth-token: ${{ secrets.PREFIX_DEV_TOKEN }}
2921
- name: ruff
3022
run: |
31-
make ruff
23+
pixi run ruff
3224
- name: mypy
3325
if: success() || failure()
3426
run: |
35-
make mypy
27+
pixi run mypy
3628
- name: Test with pytest
3729
if: success() || failure()
3830
run: |
39-
make coverage-test
31+
pixi run coverage

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,7 @@ conda-meta-data.json
3737

3838

3939

40+
41+
# pixi environments
42+
.pixi
43+
*.egg-info

.idea/garpy.mkdocstrings.iml

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

environment.yml

-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ dependencies:
1414
- coverage >=7.4.0
1515
- pytest >=8.2
1616
- pytest-cov >=5.0
17-
- pylint >=3.0.3
1817
- mypy >=1.10
1918
- ruff >=0.4.10
2019
- beautifulsoup4 >=4.12
@@ -24,4 +23,3 @@ dependencies:
2423
- mkdocs >=1.5.3,<2.0
2524
- mkdocs-material >=9.5.4
2625
- linkchecker >=10.4
27-
- pydantic >=2.0

pixi.lock

+1,530
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+71
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,34 @@ dependencies = [
3333
Repository = "https://github.com/analog-garage/mkdocstrings-python-xref"
3434
Documentation = "https://analog-garage.github.io/mkdocstrings-python-xref/"
3535

36+
[project.optional-dependencies]
37+
dev = [
38+
"build >=1.0.0", # python-build on conda
39+
"hatchling >=1.21",
40+
"coverage >=7.4.0",
41+
"pytest >=8.2",
42+
"pytest-cov >=5.0",
43+
"mypy >=1.10",
44+
"ruff >=0.4.10",
45+
"beautifulsoup4 >=4.12",
46+
"black >=23.12",
47+
"mike >=1.1,<2.0",
48+
"mkdocs >=1.5.3,<2.0",
49+
"mkdocs-material >=9.5.4",
50+
"linkchecker >=10.4"
51+
]
52+
53+
[tool.pixi.workspace]
54+
name = "mkxref-dev"
55+
channels = ["conda-forge"]
56+
platforms = ["osx-arm64", "linux-64", "win-64"]
57+
58+
[tool.pixi.pypi-dependencies]
59+
mkdocstrings-python-xref = { path = ".", editable = true }
60+
61+
[tool.pixi.environments]
62+
default = {features = ["dev"]}
63+
3664
[tool.hatch.version]
3765
path = "src/mkdocstrings_handlers/python_xref/VERSION"
3866
pattern = "\\s*(?P<version>[\\w.]*)"
@@ -174,3 +202,46 @@ disable = [
174202
"wrong-spelling-in-comment",
175203
"wrong-spelling-in-docstring",
176204
]
205+
206+
[tool.pixi.tasks]
207+
# linting tasks
208+
mypy = "mypy"
209+
ruff = "ruff check src/mkdocstrings_handlers tests"
210+
lint = {depends-on = ["ruff", "mypy"]}
211+
212+
# testing tasks
213+
pytest = "pytest -sv -ra tests"
214+
test = {depends-on = ["pytest", "lint"]}
215+
coverage = "pytest -ra --cov --cov-report=html --cov-report=term -- tests"
216+
coverage-show = "python -m webbrowser file://$PIXI_PROJECT_ROOT/htmlcov/index.html"
217+
218+
# doc tasks
219+
220+
# cleanup tasks
221+
clean-build = "rm -rf build dist"
222+
clean-coverage = "rm -rf .coverage .coverage.* htmlcov"
223+
clean-docs = "rm -rf site"
224+
clean-test = "rm -rf .pytest_cache .mypy_cache .ruff_cache"
225+
clean = {depends-on = ["clean-build", "clean-coverage", "clean-test"]}
226+
227+
# build tasks
228+
build = {depends-on = ["build-wheel", "build-sdist", "build-conda"]}
229+
230+
[tool.pixi.tasks.build-wheel]
231+
env = {VERSION = "$(cat src/mkdocstrings_handlers/python_xref/VERSION)"}
232+
cmd = "pip wheel . --no-deps --no-build-isolation -w dist"
233+
inputs = ["pyproject.toml", "LICENSE.md", "src/**/*"]
234+
outputs = ["dist/mkdocstrings_python_xref-$VERSION-py3-none-any.whl"]
235+
236+
[tool.pixi.tasks.build-sdist]
237+
env = {VERSION = "$(cat src/mkdocstrings_handlers/python_xref/VERSION)"}
238+
cmd = "python -m build --sdist --no-isolation --outdir dist"
239+
inputs = ["pyproject.toml", "LICENSE.md", "src/**/*"]
240+
outputs = ["dist/mkdocstrings_python_xref-$VERSION.tar.gz"]
241+
242+
[tool.pixi.tasks.build-conda]
243+
#env = {VERSION = "$(cat src/mkdocstrings_handlers/python_xref/VERSION)"}
244+
cmd = "whl2conda convert dist/*.whl -w dist --overwrite"
245+
depends-on = ["build-wheel"]
246+
inputs = ["dist/mkdocstrings_python_xref-$VERSION-py3-none-any.whl"]
247+

0 commit comments

Comments
 (0)