Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.
- Fork and clone the repository:
git clone https://github.com/bjhardcastle/lazynwb
cd lazynwb- Install with
uv
uv python pin 3.11
uv sync- Activate the environment:
-
Windows
.venv\scripts\activate
-
Unix
source .venv/bin/scripts/activate
You now have an editable pip install of the project, with all dev dependencies. The following should work:
python -c "import lazynwb; print(lazynwb.__version__)"The project uses uv for reproducible dev environments, with
configuration for tools in pyproject.toml
While working on the project, use uv to manage dependencies:
- add dependencies:
uv add numpy pandas- add dev dependencies:
uv add --dev mypy
- add dev dependencies:
- remove dependencies correctly:
uv remove numpy# does nothing because pandas still needs numpy! - update the environment to reflect changes in
pyproject.toml:uv syncAlways commit & pushuv.lockto share the up-to-date dev environment
-
Edit the code and/or the documentation on the main branch
-
Add simple doctests to functions or more elaborate tests to modules in
tests -
If you updated the project's dependencies (or you pulled changes):
- run
uv sync - if it fails due to dependencies you added, follow any error messages to resolve dependency version conflicts
- when it doesn't fail, commit any changes to
uv.lockalong with the changes topyproject.toml
- Run tests with
uv run task test
-
mypy will check all functions that contain type annotations in their signature
-
pytest will run doctests and any tests in the
testsdir -
if you are unsure about how to fix a test, just push your changes - the continuous integration will fail on Github and someone else can have a look
-
don't update the changelog, it will be taken care of automatically
-
link to any related issue number in the Commit message:
Fix variable name #13 -
pull changes with
git pull --rebaseto keep the commit history easy to read
With a clean working directory, run pipx run copier update --defaults.
See here for more info.