You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/contributing/index.md
+60-21Lines changed: 60 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,36 +8,75 @@ We have a design document providing a conceptual overview of VirtualShip. This d
8
8
9
9
### Development installation
10
10
11
-
We use `conda` to manage our development installation. Make sure you have `conda` installed by following [the instructions here](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html) and then run the following commands:
11
+
```{note}
12
+
VirtualShip uses [Pixi](https://pixi.sh) to manage environments and run developer tooling. Pixi is a modern alternative to Conda and also includes other powerful tooling useful for a project like VirtualShip. It is our sole development workflow - we do not offer a Conda development workflow. Give Pixi a try, you won't regret it!
**Step 2:**[Fork the repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo#forking-a-repository)
20
+
21
+
**Step 3:** Clone your fork with submodules and `cd` into the repository.
The `--recurse-submodules` flag is required to clone the Parcels submodule, which is used for testing and development.
30
+
```
31
+
32
+
**Step 4:** Install the Pixi environment
12
33
13
34
```bash
14
-
conda create -n ship python=3.10
15
-
conda activate ship
16
-
conda env update --file environment.yml
17
-
pip install -e . --no-deps --no-build-isolation
35
+
pixi install
18
36
```
19
37
20
-
This creates an environment, and installs all the dependencies that you need for development, including:
38
+
Now you have a development installation of VirtualShip, as well as a bunch of developer tooling to run tests, check code quality, and build the documentation! Simple as that.
21
39
22
-
- core dependencies
23
-
- development dependencies (e.g., for testing)
24
-
- documentation dependencies
40
+
### Pixi workflows
25
41
26
-
then installs the package in editable mode.
42
+
You can use the following Pixi commands to run common development tasks.
27
43
28
-
### Useful commands
44
+
**Testing**
29
45
30
-
The following commands are useful for local development:
46
+
-`pixi run tests` - Run the full test suite using pytest with coverage reporting
47
+
-`pixi run tests-notebooks` - Run notebook tests
31
48
32
-
-`pytest` to run tests
33
-
-`pre-commit run --all-files` to run pre-commit checks
34
-
-`pre-commit install` (optional) to install pre-commit hooks
35
-
- this means that every time you commit, pre-commit checks will run on the files you changed
36
-
-`sphinx-autobuild docs docs/_build` to build and serve the documentation
37
-
-`sphinx-apidoc -o docs/api/ --module-first --no-toc --force src/virtualship` (optional) to generate the API documentation
38
-
-`sphinx-build -b linkcheck docs/ _build/linkcheck` to check for broken links in the documentation
49
+
**Documentation**
39
50
40
-
The running of these commands is useful for local development and quick iteration, but not _vital_ as they will be run automatically in the CI pipeline (`pre-commit` by pre-commit.ci, `pytest` by GitHub Actions, and `sphinx` by ReadTheDocs).
51
+
-`pixi run docs` - Build the documentation using Sphinx
52
+
-`pixi run docs-watch` - Build and auto-rebuild documentation when files change (useful for live editing)
53
+
54
+
**Code quality**
55
+
56
+
-`pixi run lint` - Run pre-commit hooks on all files (includes formatting, linting, and other code quality checks)
57
+
-`pixi run typing` - Run mypy type checking on the codebase
58
+
59
+
**Different environments**
60
+
61
+
VirtualShip supports testing against different environments (e.g., different Python versions) with different feature sets. In CI we test against these environments, and you can too locally. For example:
62
+
63
+
-`pixi run -e test-py311 tests` - Run tests using Python 3.11
64
+
-`pixi run -e test-py312 tests` - Run tests using Python 3.12
65
+
-`pixi run -e test-latest tests` - Run tests using latest Python
66
+
67
+
The name of the workflow on GitHub contains the command you have to run locally to recreate the workflow - making it super easy to reproduce CI failures locally.
68
+
69
+
**Typical development workflow**
70
+
71
+
1. Make your code changes
72
+
2. Run `pixi run lint` to ensure code formatting and style compliance
73
+
3. Run `pixi run tests` to verify your changes don't break existing functionality
74
+
4. If you've added new features, run `pixi run typing` to check type annotations
75
+
5. If you've modified documentation, run `pixi run docs` to build and verify the docs
76
+
77
+
```{tip}
78
+
You can run `pixi info` to see all available environments and `pixi task list` to see all available tasks across environments.
79
+
```
41
80
42
81
## For maintainers
43
82
@@ -52,5 +91,5 @@ The running of these commands is useful for local development and quick iteratio
52
91
53
92
When adding a dependency, make sure to modify the following files where relevant:
54
93
55
-
-`environment.yml` for core and development dependencies (important for the development environment, and CI)
94
+
-`pixi.toml` for core and development dependencies (important for the development environment, and CI)
56
95
-`pyproject.toml` for core dependencies (important for the pypi package, this should propagate through automatically to `recipe/meta.yml` in the conda-forge feedstock)
0 commit comments