Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
python-poetry
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
python-poetry
Commits
852000f8
Commit
852000f8
authored
Mar 31, 2023
by
Randy Döring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs: promote semantic versioning less aggressively
parent
c2a7a8d6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
6 deletions
+18
-6
docs/faq.md
+14
-3
docs/libraries.md
+4
-3
No files found.
docs/faq.md
View file @
852000f8
...
@@ -33,21 +33,32 @@ Once Poetry has cached the releases' information on your machine, the dependency
...
@@ -33,21 +33,32 @@ Once Poetry has cached the releases' information on your machine, the dependency
will be much faster.
will be much faster.
{{% /note %}}
{{% /note %}}
###
Why a
re unbound version constraints a bad idea?
###
A
re unbound version constraints a bad idea?
A version constraint without an upper bound such as
`*`
or
`>=3.4`
will allow updates to any future version of the dependency.
A version constraint without an upper bound such as
`*`
or
`>=3.4`
will allow updates to any future version of the dependency.
This includes major versions breaking backward compatibility.
This includes major versions breaking backward compatibility.
Once a release of your package is published, you cannot tweak its dependencies anymore in case a dependency breaks BC
Once a release of your package is published, you cannot tweak its dependencies anymore in case a dependency breaks BC
– you have to do a new release but the previous one stays broken.
– you have to do a new release but the previous one stays broken.
(Users can still work around the broken dependency by restricting it by themselves.)
T
he only good alternative is to
define an upper bound on your constraints,
T
o avoid such issues you can
define an upper bound on your constraints,
which you can increase in a new release after testing that your package is compatible
which you can increase in a new release after testing that your package is compatible
with the new major version of your dependency.
with the new major version of your dependency.
For example instead of using
`>=3.4`
you
should
use
`^3.4`
which allows all versions
`<4.0`
.
For example instead of using
`>=3.4`
you
can
use
`^3.4`
which allows all versions
`<4.0`
.
The
`^`
operator works very well with libraries following
[
semantic versioning
](
https://semver.org
)
.
The
`^`
operator works very well with libraries following
[
semantic versioning
](
https://semver.org
)
.
However, when defining an upper bound, users of your package are not able to update
a dependency beyond the upper bound even if it does not break anything
and is fully compatible with your package.
You have to release a new version of your package with an increased upper bound first.
If your package will be used as a library in other packages, it might be better to avoid
upper bounds and thus unnecessary dependency conflicts (unless you already know for sure
that the next release of the dependency will break your package).
If your package will be used as an application, it might be worth to define an upper bound.
### Is tox supported?
### Is tox supported?
**Yes**
. By using the
[
isolated builds
](
https://tox.readthedocs.io/en/latest/config.html#conf-isolated_build
)
`tox`
provides,
**Yes**
. By using the
[
isolated builds
](
https://tox.readthedocs.io/en/latest/config.html#conf-isolated_build
)
`tox`
provides,
...
...
docs/libraries.md
View file @
852000f8
...
@@ -19,10 +19,11 @@ This chapter will tell you how to make your library installable through Poetry.
...
@@ -19,10 +19,11 @@ This chapter will tell you how to make your library installable through Poetry.
Poetry requires
[
PEP 440
](
https://peps.python.org/pep-0440
)
-compliant versions for all projects.
Poetry requires
[
PEP 440
](
https://peps.python.org/pep-0440
)
-compliant versions for all projects.
While Poetry does not enforce any release convention, it
does
encourage the use of
While Poetry does not enforce any release convention, it
used to
encourage the use of
[
semantic versioning
](
https://semver.org/
)
within the scope 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
[
PEP 440
](
https://peps.python.org/pep-0440/#semantic-versioning
)
and supports
and allows them to set appropriate
[
version constraints
](
{{
<
relref
"
dependency-specification
#
version-constraints
"
>
}}).
[
version constraints
](
{{
<
relref
"
dependency-specification
/#
caret-requirements
"
>
}})
that are especially suitable for semver.
{{% note %}}
{{% note %}}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment