Skip to content

Switch to using pixi instead of directy using conda for development #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# SCM syntax highlighting & preventing 3-way merges
pixi.lock merge=binary linguist-language=YAML linguist-generated=true
24 changes: 8 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,20 @@ jobs:
python-version: ["3.9", "3.11", "3.13"]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-[email protected]
- uses: prefix-dev/setup-[email protected]
with:
miniforge-version: latest
conda-version: ">=24.11"
conda-build-version: ">=25.1"
environment-file: environment.yml
activate-environment: mkxref-dev
python-version: ${{ matrix.python-version }}
condarc-file: github-condarc.yml
auto-activate-base: true
use-mamba: false
- name: Dev install package
run: |
conda run -n mkxref-dev pip install -e . --no-deps --no-build-isolation
pixi-version: v0.43.3
cache: true
auth-host: prefix.dev
auth-token: ${{ secrets.GITHUB_TOKEN }}
- name: ruff
run: |
make ruff
pixi run ruff
- name: mypy
if: success() || failure()
run: |
make mypy
pixi run mypy
- name: Test with pytest
if: success() || failure()
run: |
make coverage-test
pixi run coverage
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ conda-meta-data.json




# pixi environments
.pixi
*.egg-info
1 change: 1 addition & 0 deletions .idea/garpy.mkdocstrings.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dependencies:
- coverage >=7.4.0
- pytest >=8.2
- pytest-cov >=5.0
- pylint >=3.0.3
- mypy >=1.10
- ruff >=0.4.10
- beautifulsoup4 >=4.12
Expand All @@ -24,4 +23,3 @@ dependencies:
- mkdocs >=1.5.3,<2.0
- mkdocs-material >=9.5.4
- linkchecker >=10.4
- pydantic >=2.0
1,530 changes: 1,530 additions & 0 deletions pixi.lock

Large diffs are not rendered by default.

71 changes: 71 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,34 @@ dependencies = [
Repository = "https://github.com/analog-garage/mkdocstrings-python-xref"
Documentation = "https://analog-garage.github.io/mkdocstrings-python-xref/"

[project.optional-dependencies]
dev = [
"build >=1.0.0", # python-build on conda
"hatchling >=1.21",
"coverage >=7.4.0",
"pytest >=8.2",
"pytest-cov >=5.0",
"mypy >=1.10",
"ruff >=0.4.10",
"beautifulsoup4 >=4.12",
"black >=23.12",
"mike >=1.1,<2.0",
"mkdocs >=1.5.3,<2.0",
"mkdocs-material >=9.5.4",
"linkchecker >=10.4"
]

[tool.pixi.workspace]
name = "mkxref-dev"
channels = ["conda-forge"]
platforms = ["osx-arm64", "linux-64", "win-64"]

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

[tool.pixi.environments]
default = {features = ["dev"]}

[tool.hatch.version]
path = "src/mkdocstrings_handlers/python_xref/VERSION"
pattern = "\\s*(?P<version>[\\w.]*)"
Expand Down Expand Up @@ -174,3 +202,46 @@ disable = [
"wrong-spelling-in-comment",
"wrong-spelling-in-docstring",
]

[tool.pixi.tasks]
# linting tasks
mypy = "mypy"
ruff = "ruff check src/mkdocstrings_handlers tests"
lint = {depends-on = ["ruff", "mypy"]}

# testing tasks
pytest = "pytest -sv -ra tests"
test = {depends-on = ["pytest", "lint"]}
coverage = "pytest -ra --cov --cov-report=html --cov-report=term -- tests"
coverage-show = "python -m webbrowser file://$PIXI_PROJECT_ROOT/htmlcov/index.html"

# doc tasks

# cleanup tasks
clean-build = "rm -rf build dist"
clean-coverage = "rm -rf .coverage .coverage.* htmlcov"
clean-docs = "rm -rf site"
clean-test = "rm -rf .pytest_cache .mypy_cache .ruff_cache"
clean = {depends-on = ["clean-build", "clean-coverage", "clean-test"]}

# build tasks
build = {depends-on = ["build-wheel", "build-sdist", "build-conda"]}

[tool.pixi.tasks.build-wheel]
env = {VERSION = "$(cat src/mkdocstrings_handlers/python_xref/VERSION)"}
cmd = "pip wheel . --no-deps --no-build-isolation -w dist"
inputs = ["pyproject.toml", "LICENSE.md", "src/**/*"]
outputs = ["dist/mkdocstrings_python_xref-$VERSION-py3-none-any.whl"]

[tool.pixi.tasks.build-sdist]
env = {VERSION = "$(cat src/mkdocstrings_handlers/python_xref/VERSION)"}
cmd = "python -m build --sdist --no-isolation --outdir dist"
inputs = ["pyproject.toml", "LICENSE.md", "src/**/*"]
outputs = ["dist/mkdocstrings_python_xref-$VERSION.tar.gz"]

[tool.pixi.tasks.build-conda]
#env = {VERSION = "$(cat src/mkdocstrings_handlers/python_xref/VERSION)"}
cmd = "whl2conda convert dist/*.whl -w dist --overwrite"
depends-on = ["build-wheel"]
inputs = ["dist/mkdocstrings_python_xref-$VERSION-py3-none-any.whl"]

Loading