-
Notifications
You must be signed in to change notification settings - Fork 46
Poetry
Poetry is a Python packaging and dependency management tool very easy to use.
Is is highly recommended to use while developing for HyPyP.
Poetry can be installed on any OS (https://python-poetry.org/docs/#installation)
Once installed, open a shell on your local HyPyP Git directory and type the following:
poetry installIt creates a Python virtual environment dedicated to the project and install all the required libraries within this environment.
If you want to add a library to the project, do not use pip but type :
poetry add your_lib_nameIf this is a dependency required only for documentation, test or development help (linter, formatter ...) type the following :
poetry add --group dev your_lib_nameTo remove a dependency, just type :
poetry remove your_lib_nameTo update all packages to the last compatible version :
poetry updateOn the root of the git folder, there is a pyproject.toml configuration file for this poetry project.
It contains all the requirements information but it's not recommended to use it for add or remove package and rather use the poetry addand poetry remove commands.
The more important with this file is information for PyPi packaging. For more information : https://python-poetry.org/docs/pyproject/.
Here comes the magic ;-) Once your ready to publish on PyPi a new version with a pyproject.toml ready, just type :
poetry build
poetry publishWarning: it is now recommended to use API tokens. More info: "How To Publish Python Packages to PyPI using Poetry"
To update the doc on readthedocs, you must run with bash the script update_docs_requirements.sh.
Note: to test doc generation python -m mkdocs build --clean --site-dir _build/html --config-file mkdocs.yml and to test locally with a webserver python -m mkdocs serve
If you want to dive more on poetry usage, check the documentation : https://python-poetry.org/docs/