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
5ea2d8dc
Unverified
Commit
5ea2d8dc
authored
Mar 06, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update README
parent
0adbac0f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
29 deletions
+16
-29
README.md
+16
-29
No files found.
README.md
View file @
5ea2d8dc
...
...
@@ -388,11 +388,7 @@ poetry lock
## The `pyproject.toml` file
A
`pyproject.toml`
file is composed of multiple sections.
### package
This section describes the specifics of the package
The
`tool.poetry`
section of the
`pyproject.toml`
file is composed of multiple sections.
#### name
...
...
@@ -405,10 +401,6 @@ The version of the package. **Required**
This should follow
[
semantic versioning
](
http://semver.org/
)
. However it will not be enforced and you remain
free to follow another specification.
#### python-version
A list of Python versions for which the package is compatible.
**Required**
#### description
A short description of the package.
**Required**
...
...
@@ -492,44 +484,39 @@ include = ["package/**/*.py", "package/**/.c"]
exclude
=
["package/excluded.py"]
```
If you packages lies elsewhere (say in a
`src`
directory), you can tell
`poet`
to find them from there:
```
toml
include
=
{
from
=
'src'
,
include
=
'**/*'
}
```
Similarly, you can tell that the
`src`
directory represent the
`foo`
package:
```
toml
include
=
{
from
=
'src'
,
include
=
'**/*'
,
as
=
'foo'
}
```
### `dependencies` and `dev-dependencies`
Poet is configured to look for dependencies on
[
PyPi
](
https://pypi.org
)
by default.
Poet
ry
is configured to look for dependencies on
[
PyPi
](
https://pypi.org
)
by default.
Only the name and a version string are required in this case.
```
toml
[dependencies]
[
tool.poetry.
dependencies]
requests
=
"^2.13.0"
```
If you want to use a private repository, you can add it to your
`pyproject.toml`
file, like so:
```
toml
[[source]]
[[
tool.poetry.
source]]
name
=
'private'
url
=
'http://example.com/simple'
```
Be aware that declaring the python version for which your package
is compatible is mandatory:
```
toml
[tool.poetry.dependencies]
python
=
"^3.6"
```
#### Caret requirement
**Caret requirements**
allow SemVer compatible updates to a specified version.
An update is allowed if the new version number does not modify the left-most non-zero digit in the major, minor, patch grouping.
In this case, if we ran
`poet
update requests`
, poet
would update us to version
`2.14.0`
if it was available,
In this case, if we ran
`poet
ry update requests`
, poetry
would update us to version
`2.14.0`
if it was available,
but would not update us to
`3.0.0`
.
If instead we had specified the version string as
`^0.1.13`
, poet would update to
`0.1.14`
but not
`0.2.0`
.
If instead we had specified the version string as
`^0.1.13`
, poet
ry
would update to
`0.1.14`
but not
`0.2.0`
.
`0.0.x`
is not considered compatible with any other version.
Here are some more examples of caret requirements and the versions that would be allowed with them:
...
...
@@ -613,12 +600,12 @@ You can also specify that a dependency should be installed only for specific Pyt
```
toml
[dependencies]
pathlib2
=
{
version
=
"^2.2"
,
python
-versions
=
"~2.7"
}
pathlib2
=
{
version
=
"^2.2"
,
python
=
"~2.7"
}
```
```
toml
[dependencies]
pathlib2
=
{
version
=
"^2.2"
,
python
-versions
=
[
"~2.7"
,
"^3.2"
]
}
pathlib2
=
{
version
=
"^2.2"
,
python
=
[
"~2.7"
,
"^3.2"
]
}
```
### `scripts`
...
...
@@ -679,5 +666,5 @@ To match the example in the setuptools documentation, you would use the followin
## Resources
*
[
Official Website
](
https://p
yproject
.eustace.io
)
*
[
Official Website
](
https://p
oetry
.eustace.io
)
*
[
Issue Tracker
](
https://github.com/sdispater/poetry/issues
)
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