-
Notifications
You must be signed in to change notification settings - Fork 24
✨ Introduce pixi for project management
#489
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
munechika-koyo
wants to merge
20
commits into
cherab:development
Choose a base branch
from
munechika-koyo:feature/pixi
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
7d285d1
1st commit for introducing `pixi`
munechika-koyo dbf61a2
Merge branch 'development' into feature/pixi
munechika-koyo f2ee0d3
Update raysect dependency version to 0.9.1.*
munechika-koyo 6f9dddd
Revert "Update raysect dependency version to 0.9.1.*"
munechika-koyo c145a4d
Update Python version range in pixi.toml
munechika-koyo 8c8a189
Add HTML file removal to build artifacts cleanup
munechika-koyo 053cf8c
Update Python version features in pixi.toml
munechika-koyo f90feae
Update channels and remove sphinx-tabs dependency
munechika-koyo 31aca80
Refactor pixi.toml: reorganize build configuration and clean up commands
munechika-koyo 36763a0
Add doc-serve task to start a local server for documentation
munechika-koyo e687161
Replace taplo with tombi for TOML formatting in lint tasks
munechika-koyo b8d5f28
Add Pixi developer guide with environment and task documentation
munechika-koyo 536705b
Merge branch 'development' into feature/pixi
munechika-koyo e69f53c
Fix links in Pixi developer guide and remove top header's emoji
munechika-koyo 3890c0e
Add myst-parser dependency for documentation generation
munechika-koyo c596630
Add myst_parser extension and update documentation structure for deve…
munechika-koyo 05ca189
Update link to Python version features in Pixi developer guide
munechika-koyo 5f63cec
Add pixi feature into changelog
munechika-koyo 0c5fbed
Add TODO comment about sphinx_rtd_theme version constraint
munechika-koyo 9aee81b
Format python version constraints in pixi.toml for better readability
munechika-koyo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,181 @@ | ||
| # Pixi developer guide | ||
|
|
||
| This document describes the development environments and tasks configured in | ||
| [`pixi.toml`](https://github.com/cherab/core/blob/development/pixi.toml). Pixi | ||
| manages the development dependencies in isolated environments and provides a | ||
| common interface for running tests, building the documentation, and checking | ||
| the source tree. | ||
|
|
||
| Pixi installs or updates the selected environment automatically when a command | ||
| is run. The workspace currently supports Linux x86-64, macOS x86-64, and macOS | ||
| Arm64. | ||
|
|
||
| ## 🔎 Discovering tasks | ||
|
|
||
| List every task in the workspace with: | ||
|
|
||
| ```console | ||
| pixi task list | ||
| ``` | ||
|
|
||
| To show only the tasks available in a particular environment, pass its name: | ||
|
|
||
| ```console | ||
| pixi task list -e test | ||
| ``` | ||
|
|
||
| Use `pixi run --help` for general command help. When a task is available in | ||
| more than one environment, use `-e <environment>` to select the environment | ||
| explicitly. | ||
|
|
||
| ## 🧩 Environments | ||
|
|
||
| | Environment | Purpose | | ||
| | --- | --- | | ||
| | `default` | Basic development tools; Cherab is not installed | | ||
| | `test` | Run the complete test suite using the latest supported Python; currently equivalent to `test-pylatest` | | ||
| | `test-pylatest` | Run the complete test suite using the latest supported Python | | ||
| | `test-pyoldest` | Run the complete test suite using the oldest supported Python | | ||
| | `test-opencl` | Run the OpenCL SART tests with Cherab's `opencl` extra | | ||
| | `docs` | Build the documentation | | ||
| | `lint` | Run formatting and static-analysis tools without installing Cherab | | ||
|
|
||
| See the [`pyoldest` and `pylatest` features and environment definitions in | ||
| `pixi.toml`](https://github.com/cherab/core/blob/development/pixi.toml#:~:text=Python%20Version%20Features) | ||
| for the Python versions used by each environment. | ||
|
|
||
| ## 🛠️ Basic development tasks | ||
|
|
||
| Start an IPython session in the default environment: | ||
|
|
||
| ```console | ||
| pixi run ipython | ||
| ``` | ||
|
|
||
| Remove generated C/Cython libraries and HTML files from the `cherab/` source | ||
| tree: | ||
|
|
||
| ```console | ||
| pixi run clean | ||
| ``` | ||
|
|
||
| The `clean` task deletes files matching `*.c`, `*.so`, `*.pyd`, `*.dll`, and | ||
| `*.html` below `cherab/`. | ||
|
|
||
| ## 🧪 Testing | ||
|
|
||
| Run the complete test suite with the latest supported Python: | ||
|
|
||
| ```console | ||
| pixi run -e test test | ||
| ``` | ||
|
|
||
| The `test` environment currently uses the same solve group as | ||
| `test-pylatest`. The explicit alias can also be used: | ||
|
|
||
| ```console | ||
| pixi run -e test-pylatest test | ||
| ``` | ||
|
|
||
| Run the suite with the oldest supported Python: | ||
|
|
||
| ```console | ||
| pixi run -e test-pyoldest test | ||
| ``` | ||
|
|
||
| Run the OpenCL SART tests: | ||
|
|
||
| ```console | ||
| pixi run -e test-opencl test-opencl | ||
| ``` | ||
|
|
||
| The regular test task runs `python -m unittest discover cherab -v`. The OpenCL | ||
| task runs `cherab.tools.tests.test_sart_opencl` only. | ||
|
|
||
| ## 📚 Documentation | ||
|
|
||
| Build the HTML documentation: | ||
|
|
||
| ```console | ||
| pixi run -e docs doc-build | ||
| ``` | ||
|
|
||
| `html` is the default Sphinx builder. A different builder can be supplied as | ||
| the final argument; for example, check external and internal links with: | ||
|
|
||
| ```console | ||
| pixi run -e docs doc-build linkcheck | ||
| ``` | ||
|
|
||
| Build output is written below `docs/build/<builder>`. Remove all documentation | ||
| build output with: | ||
|
|
||
| ```console | ||
| pixi run doc-clean | ||
| ``` | ||
|
|
||
| After building the HTML documentation, serve it locally on port 8000 with: | ||
|
|
||
| ```console | ||
| pixi run doc-serve | ||
| ``` | ||
|
|
||
| Then open <http://localhost:8000> in a browser. To use a different port, pass | ||
| it as the final argument: | ||
|
|
||
| ```console | ||
| pixi run doc-serve 8080 | ||
| ``` | ||
|
|
||
| ## 🧹 Formatting and static analysis | ||
|
|
||
| The `lint` environment keeps code-quality tools separate from the environments | ||
| that build and install Cherab. Because the task names below are unique to this | ||
| environment, Pixi selects it automatically; `-e lint` is not required. | ||
|
|
||
| | Task | Action | | ||
| | --- | --- | | ||
| | `lefthook` | Run Lefthook | | ||
| | `hooks` | Install the Git hooks managed by Lefthook | | ||
| | `pre-commit` | Run the Lefthook `pre-commit` group | | ||
| | `ruff-check` | Run `ruff check` | | ||
| | `ruff-format` | Run `ruff format` | | ||
| | `toml-format` | Run `tombi format` | | ||
| | `dprint` | Run `dprint fmt` | | ||
| | `typos` | Find and fix spelling errors | | ||
| | `actionlint` | Run Actionlint | | ||
| | `blacken-docs` | Format Python examples in documentation | | ||
| | `validate-pyproject` | Validate `pyproject.toml` | | ||
| | `cython-lint` | Run Cython-Lint | | ||
| | `lint` | Run the Lefthook `pre-commit` group on all files | | ||
|
|
||
| For example: | ||
|
|
||
| ```console | ||
| pixi run ruff-check | ||
| pixi run toml-format | ||
| pixi run cython-lint | ||
| pixi run validate-pyproject | ||
| ``` | ||
|
|
||
| The `hooks`, `lefthook`, `pre-commit`, and aggregate `lint` tasks invoke | ||
| Lefthook. | ||
|
|
||
| > [!WARNING] | ||
| > A Lefthook configuration file has not been added to the repository yet, so | ||
| > these tasks are not currently available. | ||
|
|
||
| Install the Git hooks and run all configured checks with: | ||
|
|
||
| ```console | ||
| pixi run hooks | ||
| pixi run lint | ||
| ``` | ||
|
|
||
| Running `pixi run hooks` installs the Git hooks once. After installation, the | ||
| configured pre-commit checks are triggered automatically for every commit. To | ||
| remove the installed hooks and stop the automatic checks, run: | ||
|
|
||
| ```console | ||
| pixi run lefthook uninstall | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| .. include:: ../../../dev/pixi.md | ||
| :parser: myst_parser.sphinx_ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.