-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: wip update docs to reflect PEP 621 more explicit
- Loading branch information
1 parent
f3deb4c
commit 0a7c222
Showing
1 changed file
with
18 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,7 @@ authors = [ | |
{name = "Sébastien Eustace", email = "[email protected]"} | ||
] | ||
readme = "README.md" | ||
requires-python = ">=3.8" | ||
requires-python = ">=3.9" | ||
|
||
[tool.poetry] | ||
packages = [{include = "poetry_demo"}] | ||
|
@@ -57,11 +57,11 @@ requires = ["poetry-core"] | |
build-backend = "poetry.core.masonry.api" | ||
``` | ||
|
||
Poetry assumes your package contains a package with the same name as `tool.poetry.name` located in the root of your | ||
Poetry assumes your package contains a package with the same name as `project.name` located in the root of your | ||
project. If this is not the case, populate [`tool.poetry.packages`]({{< relref "pyproject#packages" >}}) to specify | ||
your packages and their locations. | ||
|
||
Similarly, the traditional `MANIFEST.in` file is replaced by the `tool.poetry.readme`, `tool.poetry.include`, and | ||
Similarly, the traditional `MANIFEST.in` file is replaced by the `project.readme`, `tool.poetry.include`, and | ||
`tool.poetry.exclude` sections. `tool.poetry.exclude` is additionally implicitly populated by your `.gitignore`. For | ||
full documentation on the project format, see the [pyproject section]({{< relref "pyproject" >}}) of the documentation. | ||
|
||
|
@@ -79,11 +79,11 @@ Again, it's important to remember that -- unlike other dependencies -- setting a | |
For example, in this `pyproject.toml` file: | ||
|
||
```toml | ||
[tool.poetry.dependencies] | ||
python = "^3.7.0" | ||
[project] | ||
requires-python = ">=3.9" | ||
``` | ||
|
||
we are allowing any version of Python 3 that is greater than `3.7.0`. | ||
we are allowing any version of Python 3 that is greater than `3.9.0`. | ||
|
||
When you run `poetry install`, you must have access to some version of a Python interpreter that satisfies this constraint available on your system. | ||
Poetry will not install a Python interpreter for you. | ||
|
@@ -122,11 +122,14 @@ In the [pyproject section]({{< relref "pyproject" >}}) you can see which fields | |
{{% /note %}} | ||
|
||
### Specifying dependencies | ||
See the [Dependency specification]({{< relref "dependency-specification" >}}) | ||
for detailed information. | ||
|
||
{{< tabs tabTotal="2" tabID1="pep621-dependencies" tabID2="legacy-dependencies" tabName1="Default (PEP 621)" tabName2="Legacy">}} | ||
|
||
{{< tab tabID="pep621-dependencies" >}} | ||
If you want to add dependencies to your project, you can specify them in the | ||
`project` or `tool.poetry.dependencies` section. | ||
See the [Dependency specification]({{< relref "dependency-specification" >}}) | ||
for more information. | ||
`project` section. | ||
|
||
```toml | ||
[project] | ||
|
@@ -135,13 +138,18 @@ dependencies = [ | |
"pendulum (>=2.1,<3.0)" | ||
] | ||
``` | ||
{{< /tab >}} | ||
|
||
or | ||
{{< tab tabID="legacy-dependencies" >}} | ||
If you want to add dependencies to your project, you can specify them in the | ||
`tool.poetry.dependencies` section. | ||
|
||
```toml | ||
[tool.poetry.dependencies] | ||
pendulum = "^2.1" | ||
``` | ||
{{< /tab >}} | ||
{{< /tabs >}} | ||
|
||
As you can see, it takes a mapping of **package names** and **version constraints**. | ||
|
||
|