This project requires Python3.
This instructions are for linux base systems. (Linux, MacOS, BSD, etc.)
Run make virtualenv
to create a virtual environment.
then activate it with source .venv/bin/activate
.
Run make install
to install the project in develop mode.
Run make test
to run all the tests.
Run make unittest
to run a quick subset of tests.
We use some snapshot testing. To update those tests, either run make snapshots
for unittests, pytest --snapshot-update
for all tests, or remove the relevant snapshot files. Then compare in git if the updated snapshots look reasonable.
Run make fmt
to format the code.
Run make lint
to run the linter.
Run make test
to run the tests.
Ensure code coverage report shows 100%
coverage, add tests to your PR.
Run make docs
to build the docs.
Ensure your new changes are documented.
This project uses conventional git commit messages.
Example: fix(package): update setup.py arguments 🎉
(emojis are fine too)
This project comes with a Makefile
that contains a number of useful utility.
❯ make
Usage: make <target>
Targets:
help: ## Show the help.
show: ## Show the current environment.
install: ## Install the project in dev mode.
fmt: ## Format/auto-lint code using ruff.
lint: ## Run ruff check and pyright
unittest: ## Run quick tests
test: lint ## Run tests and generate coverage report.
watch: ## Run tests on every change.
clean: ## Clean unused files.
virtualenv: ## Create a virtual environment.
release: ## Create a new tag for release.
docs: ## Build the documentation.
This project uses semantic versioning and tags releases with X.Y.Z
Every time a new tag is created and pushed to the remote repo, github actions will
automatically create a new release on github and trigger a release on PyPI.
For this to work you need to setup a secret called PIPY_API_TOKEN
on the project settings>secrets,
this token can be generated on pypi.org.
To trigger a new release all you need to do is.
- If you have changes to add to the repo
- Make your changes following the steps described above.
- Commit your changes following the conventional git commit messages.
- Run the tests to ensure everything is working.
- Run
make release
to create a new tag and push it to the remote repo.
the make release
will ask you the version number to create the tag, ex: type 0.1.1
when you are asked.
CAUTION: The make release will change local changelog files and commit all the unstaged changes you have.