Commit 5ea2d8dc by Sébastien Eustace

Update README

parent 0adbac0f
...@@ -388,11 +388,7 @@ poetry lock ...@@ -388,11 +388,7 @@ poetry lock
## The `pyproject.toml` file ## The `pyproject.toml` file
A `pyproject.toml` file is composed of multiple sections. The `tool.poetry` section of the `pyproject.toml` file is composed of multiple sections.
### package
This section describes the specifics of the package
#### name #### name
...@@ -405,10 +401,6 @@ The version of the package. **Required** ...@@ -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 This should follow [semantic versioning](http://semver.org/). However it will not be enforced and you remain
free to follow another specification. free to follow another specification.
#### python-version
A list of Python versions for which the package is compatible. **Required**
#### description #### description
A short description of the package. **Required** A short description of the package. **Required**
...@@ -492,44 +484,39 @@ include = ["package/**/*.py", "package/**/.c"] ...@@ -492,44 +484,39 @@ include = ["package/**/*.py", "package/**/.c"]
exclude = ["package/excluded.py"] 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` ### `dependencies` and `dev-dependencies`
Poet is configured to look for dependencies on [PyPi](https://pypi.org) by default. Poetry 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. Only the name and a version string are required in this case.
```toml ```toml
[dependencies] [tool.poetry.dependencies]
requests = "^2.13.0" requests = "^2.13.0"
``` ```
If you want to use a private repository, you can add it to your `pyproject.toml` file, like so: If you want to use a private repository, you can add it to your `pyproject.toml` file, like so:
```toml ```toml
[[source]] [[tool.poetry.source]]
name = 'private' name = 'private'
url = 'http://example.com/simple' 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 requirement
**Caret requirements** allow SemVer compatible updates to a specified version. **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. 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 `poetry update requests`, poetry would update us to version `2.14.0` if it was available,
but would not update us to `3.0.0`. 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`, poetry would update to `0.1.14` but not `0.2.0`.
`0.0.x` is not considered compatible with any other version. `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: 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 ...@@ -613,12 +600,12 @@ You can also specify that a dependency should be installed only for specific Pyt
```toml ```toml
[dependencies] [dependencies]
pathlib2 = { version = "^2.2", python-versions = "~2.7" } pathlib2 = { version = "^2.2", python = "~2.7" }
``` ```
```toml ```toml
[dependencies] [dependencies]
pathlib2 = { version = "^2.2", python-versions = ["~2.7", "^3.2"] } pathlib2 = { version = "^2.2", python = ["~2.7", "^3.2"] }
``` ```
### `scripts` ### `scripts`
...@@ -679,5 +666,5 @@ To match the example in the setuptools documentation, you would use the followin ...@@ -679,5 +666,5 @@ To match the example in the setuptools documentation, you would use the followin
## Resources ## Resources
* [Official Website](https://pyproject.eustace.io) * [Official Website](https://poetry.eustace.io)
* [Issue Tracker](https://github.com/sdispater/poetry/issues) * [Issue Tracker](https://github.com/sdispater/poetry/issues)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment