libraries.md (poetry-1.1.15) | : | libraries.md (poetry-1.2.0) | ||
---|---|---|---|---|
skipping to change at line 18 | skipping to change at line 18 | |||
docs: | docs: | |||
weight: 20 | weight: 20 | |||
--- | --- | |||
# Libraries | # Libraries | |||
This chapter will tell you how to make your library installable through Poetry. | This chapter will tell you how to make your library installable through Poetry. | |||
## Versioning | ## Versioning | |||
While Poetry does not enforce any convention regarding package versioning, | Poetry requires [PEP 440](https://peps.python.org/pep-0440)-compliant versions f | |||
it **strongly** recommends to follow [semantic versioning](https://semver.org). | or all projects. | |||
This has many advantages for the end users and allows them to set appropriate | While Poetry does not enforce any release convention, it does encourage the use | |||
[version constraints]({{< relref "dependency-specification#version-constraints" | of | |||
>}}). | [semantic versioning](https://semver.org/) within the scope of | |||
[PEP 440](https://peps.python.org/pep-0440/#semantic-versioning). This has many | ||||
advantages for the end users | ||||
and allows them to set appropriate [version constraints]({{< relref "dependency- | ||||
specification#version-constraints" >}}). | ||||
{{% note %}} | ||||
As an example, `1.0.0-hotfix.1` is not compatible with [PEP 440](https://peps.py | ||||
thon.org/pep-0440). You can instead | ||||
choose to use `1.0.0-post1` or `1.0.0.post1`. | ||||
{{% /note %}} | ||||
## Lock file | ## Lock file | |||
For your library, you may commit the `poetry.lock` file if you want to. | For your library, you may commit the `poetry.lock` file if you want to. | |||
This can help your team to always test against the same dependency versions. | This can help your team to always test against the same dependency versions. | |||
However, this lock file will not have any effect on other projects that depend o n it. | However, this lock file will not have any effect on other projects that depend o n it. | |||
It only has an effect on the main project. | It only has an effect on the main project. | |||
If you do not want to commit the lock file and you are using git, add it to the `.gitignore`. | If you do not want to commit the lock file and you are using git, add it to the `.gitignore`. | |||
End of changes. 2 change blocks. | ||||
5 lines changed or deleted | 17 lines changed or added |