REST API for working with Encapsia.
pip install encapsia-api
encapsia-api
is a python package managed with poetry
.
You will need python 3.8 or newer. To get started, after checking out this repository,
run:
poetry install
Code in this project should be auto-formatted using black
and adhere to isort-like
imports, and should pass linting and checks. You can run the following commands
manually, or integrate the tooling in your dev environment, but see also the next
section.
poetry run black .
poetry run ruff check .
poetry run mypy .
Ruff can fix some of the issues it finds. For example, it can fix the style of importing modules, but it can do much more. This can be done with running:
poetry run ruff check --fix .
However, please make sure you check the fixes it performs!
The release branch for this project is master
and feature branches should be merged
into it via pull requests.
This repository uses pre-commit
to run various checks with
git pre-commit hooks. To get started, run:
pre-commit install
After this, configured checks are run before you commit changes. You can also run them explicitly for all files:
pre-commit run -a
encapsia-api
adheres to Semantic Versioning.
To change the version, run:
poetry version <specifier> # e.g. patch
or edit the version string in pyproject.toml
. In any case, update the following file
to match the new version: encapsia_api/__init__.py
.
Note that we are yet in <1.0.0
land and thus version changes are not too strict and
backward-incompatible changes may still occur before 1.0.0.
Manually build by running:
poetry build
This is achieved with:
poetry update
poetry lock
poetry export -f requirements.txt > requirements.txt
Run:
poetry run pytest
This project uses Github Actions to for linting, checking, and running the tests on commit to or pull requests targeting the main branch.