I use standard python environments which I install in the root folder of the
project. I typically call the folder .venv
, and this is in the .gitignore
.
~/bareASGI$ python3.8 -m venv .venv
~/bareASGI$ . .venv/bin/activate
(.venv) ~/bareASGI$
The project uses the poetry build system. I set the following poetry config options, but this may not be necessary.
(.venv) ~/bareASGI$ poetry config virtualenvs.in-project true
The required packages can be installed wit the following command.
(.venv) ~/bareASGI$ poetry install
The python code is fully typed. Types can be checked by running the standalone
mypy
command.
(.venv) ~/bareASGI$ poetry install
Success: no issues found in 58 source files
The project uses pylint.
(.venv) ~/bareASGI$ pylint bareasgi
There are a growing number of tests. The tests can be run as follows.
(.venv) ~/bareASGI$ pytest tests
The following commands build the package and publish it. Note that publishing requires authentication.
(.venv) ~/bareASGI$ poetry build
Building bareasgi (4.0.1)
- Building sdist
- Built bareasgi-4.0.1.tar.gz
- Building wheel
- Built bareasgi-4.0.1-py3-none-any.whl
(.venv) ~/bareASGI$ poetry publish
Username:
The project uses mkdocs to build the docs
and mike to handle multiple versions. The
docs are served by GitHub Pages on the gh-pages
branch.
The following would build and publish version 4.0
and update the latest
alias to point to 4.0
.
mike deploy --push --update-aliases 4.0 latest
Two aliases are configured: latest
and stable
. The following would set the
default to latest
.
mike set-default --push latest