Skip to content

Commit

Permalink
Updated documentation and merged upstream.
Browse files Browse the repository at this point in the history
  • Loading branch information
DustinMoriarty committed Mar 12, 2021
2 parents a0c16c0 + adc3cde commit 56564f4
Show file tree
Hide file tree
Showing 195 changed files with 4,040 additions and 3,299 deletions.
10 changes: 4 additions & 6 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
freebsd_instance:
image_family: freebsd-12-1-snap
image_family: freebsd-12-2

test_task:
name: "Tests / FreeBSD / "
only_if: $CIRRUS_TAG == ''
skip: "!changesInclude('.cirrus.yml', 'poetry.lock', 'pyproject.toml', '**.json','**.py')"
env:
matrix:
- PYTHON: python2.7
- PYTHON: python3.7
- PYTHON: python3.6
- PYTHON: python3.8
python_script:
- PYPACKAGE=$(printf '%s' $PYTHON | tr -d '.')
- SQLPACKAGE=$(printf '%s-sqlite3' $PYPACKAGE | sed 's/thon//')
Expand All @@ -31,7 +31,6 @@ release_task:
env:
GITHUB_TOKEN: ENCRYPTED[2b573a2d28a03523ac6fb5b3c2f513a41c0a98db81e40e50e1d103b171f85c57e58ae38d957499dbf7fd7635cfcfd7be]
PYTHON: python3.8
PYTHON27: python2.7
PYTHON36: python3.6
PYTHON37: python3.7
PYTHON38: python3.8
Expand All @@ -40,9 +39,8 @@ release_task:
- image_family: freebsd-12-1-snap
- image_family: freebsd-13-0-snap
- image_family: freebsd-11-4-snap
python_script: pkg install -y curl bash jq python3 python27 python36 python37 python38
python_script: pkg install -y curl bash jq python3 python36 python37 python38
pip_script:
- python2.7 -m ensurepip
- python3.6 -m ensurepip
- python3.7 -m ensurepip
- python3.8 -m ensurepip
Expand Down
4 changes: 3 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[flake8]
max-line-length = 88
ignore = E501, E203, W503
per-file-ignores = __init__.py:F401
per-file-ignores =
__init__.py:F401
tests/console/commands/debug/test_resolve.py:W291
exclude =
.git
__pycache__
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
matrix:
os: [Ubuntu, MacOS, Windows]
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2

Expand Down
15 changes: 2 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,18 @@ jobs:
poetry install --no-dev
- name: Preparing Python executables
run: |
curl -L https://github.com/sdispater/python-binaries/releases/download/2.7.17/python-2.7.17.macos.tar.xz -o python-2.7.17.tar.xz
curl -L https://github.com/sdispater/python-binaries/releases/download/3.5.9/python-3.5.9.macos.tar.xz -o python-3.5.9.tar.xz
curl -L https://github.com/sdispater/python-binaries/releases/download/3.6.8/python-3.6.8.macos.tar.xz -o python-3.6.8.tar.xz
curl -L https://github.com/sdispater/python-binaries/releases/download/3.7.6/python-3.7.6.macos.tar.xz -o python-3.7.6.tar.xz
curl -L https://github.com/sdispater/python-binaries/releases/download/3.8.3/python-3.8.3.macos.tar.xz -o python-3.8.3.tar.xz
curl -L https://github.com/sdispater/python-binaries/releases/download/3.9.0b4/python-3.9.0b4.macos.tar.xz -o python-3.9.0b4.tar.xz
tar -zxf python-2.7.17.tar.xz
tar -zxf python-3.5.9.tar.xz
tar -zxf python-3.6.8.tar.xz
tar -zxf python-3.7.6.tar.xz
tar -zxf python-3.8.3.tar.xz
tar -zxf python-3.9.0b4.tar.xz
- name: Build specific release
run: |
source $HOME/.poetry/env
poetry run python sonnet make release --ansi -P "2.7:python-2.7.17/bin/python" -P "3.5:python-3.5.9/bin/python" -P "3.6:python-3.6.8/bin/python" -P "3.7:python-3.7.6/bin/python" -P "3.8:python-3.8.3/bin/python" -P "3.9:python-3.9.0b4/bin/python"
poetry run python sonnet make release --ansi -P "3.6:python-3.6.8/bin/python" -P "3.7:python-3.7.6/bin/python" -P "3.8:python-3.8.3/bin/python" -P "3.9:python-3.9.0b4/bin/python"
- name: Upload release file
uses: actions/upload-artifact@v1
with:
Expand Down Expand Up @@ -104,29 +100,22 @@ jobs:
poetry install --no-dev
- name: Preparing Python executables
run: |
Invoke-WebRequest https://github.com/sdispater/python-binaries/releases/download/2.7.17/python-2.7.17.windows.tar.xz -O python-2.7.17.tar.xz
Invoke-WebRequest https://github.com/sdispater/python-binaries/releases/download/3.5.4/python-3.5.4.windows.tar.xz -O python-3.5.4.tar.xz
Invoke-WebRequest https://github.com/sdispater/python-binaries/releases/download/3.6.8/python-3.6.8.windows.tar.xz -O python-3.6.8.tar.xz
Invoke-WebRequest https://github.com/sdispater/python-binaries/releases/download/3.7.6/python-3.7.6.windows.tar.xz -O python-3.7.6.tar.xz
Invoke-WebRequest https://github.com/sdispater/python-binaries/releases/download/3.8.3/python-3.8.3.windows.tar.xz -O python-3.8.3.tar.xz
Invoke-WebRequest https://github.com/sdispater/python-binaries/releases/download/3.9.0b4/python-3.9.0b4.windows.tar.xz -O python-3.9.0b4.tar.xz
7z x python-2.7.17.tar.xz
7z x python-3.5.4.tar.xz
7z x python-3.6.8.tar.xz
7z x python-3.7.6.tar.xz
7z x python-3.8.3.tar.xz
7z x python-3.9.0b4.tar.xz
7z x python-2.7.17.tar
7z x python-3.4.4.tar
7z x python-3.5.4.tar
7z x python-3.6.8.tar
7z x python-3.7.6.tar
7z x python-3.8.3.tar
7z x python-3.9.0b4.tar
- name: Build specific release
run: |
$env:Path += ";$env:Userprofile\.poetry\bin"
poetry run python sonnet make release --ansi -P "2.7:python-2.7.17\python.exe" -P "3.5:python-3.5.4\python.exe" -P "3.6:python-3.6.8\python.exe" -P "3.7:python-3.7.6\python.exe" -P "3.8:python-3.8.3\python.exe" -P "3.9:python-3.9.0b4\python.exe"
poetry run python sonnet make release --ansi -P "3.6:python-3.6.8\python.exe" -P "3.7:python-3.7.6\python.exe" -P "3.8:python-3.8.3\python.exe" -P "3.9:python-3.9.0b4\python.exe"
- name: Upload release file
uses: actions/upload-artifact@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/skip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ jobs:
strategy:
matrix:
os: [Ubuntu, MacOS, Windows]
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
- run: exit 0
14 changes: 9 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
repos:
- repo: https://github.com/psf/black
rev: 19.10b0
rev: 20.8b1
hooks:
- id: black

- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.3
rev: 3.8.4
hooks:
- id: flake8

- repo: https://github.com/timothycrosley/isort
rev: 5.4.2
rev: 5.7.0
hooks:
- id: isort
additional_dependencies: [toml]
exclude: ^.*/?setup\.py$

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
rev: v3.4.0
hooks:
- id: trailing-whitespace
exclude: ^tests/.*/fixtures/.*
exclude: |
(?x)(
^tests/.*/fixtures/.*
| ^tests/console/commands/debug/test_resolve.py
)
- id: end-of-file-fixer
exclude: ^tests/.*/fixtures/.*
- id: debug-statements
23 changes: 22 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Change Log

## [1.1.4] - 2020-10-23

### Added

- Added `installer.parallel` boolean flag (defaults to `true`) configuration to enable/disable parallel execution of operations when using the new installer. ([#3088](https://github.com/python-poetry/poetry/pull/3088))

### Changed

- When using system environments as an unprivileged user, user site and bin directories are created if they do not already exist. ([#3107](https://github.com/python-poetry/poetry/pull/3107))

### Fixed

- Fixed editable installation of poetry projects when using system environments. ([#3107](https://github.com/python-poetry/poetry/pull/3107))
- Fixed locking of nested extra activations. If you were affected by this issue, you will need to regenerate the lock file using `poetry lock --no-update`. ([#3229](https://github.com/python-poetry/poetry/pull/3229))
- Fixed prioritisation of non-default custom package sources. ([#3251](https://github.com/python-poetry/poetry/pull/3251))
- Fixed detection of installed editable packages when non-poetry managed `.pth` file exists. ([#3210](https://github.com/python-poetry/poetry/pull/3210))
- Fixed scripts generated by editable builder to use valid import statements. ([#3214](https://github.com/python-poetry/poetry/pull/3214))
- Fixed recursion error when locked dependencies contain cyclic dependencies. ([#3237](https://github.com/python-poetry/poetry/pull/3237))
- Fixed propagation of editable flag for VCS dependencies. ([#3264](https://github.com/python-poetry/poetry/pull/3264))

## [1.1.3] - 2020-10-14

### Changed
Expand Down Expand Up @@ -1063,7 +1083,8 @@ Initial release



[Unreleased]: https://github.com/python-poetry/poetry/compare/1.1.3...master
[Unreleased]: https://github.com/python-poetry/poetry/compare/1.1.4...master
[1.1.4]: https://github.com/python-poetry/poetry/compare/1.1.4
[1.1.3]: https://github.com/python-poetry/poetry/compare/1.1.3
[1.1.2]: https://github.com/python-poetry/poetry/releases/tag/1.1.2
[1.1.1]: https://github.com/python-poetry/poetry/releases/tag/1.1.1
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ dependency management, packaging and publishing.

It takes inspiration in tools that exist in other languages, like `composer` (PHP) or `cargo` (Rust).

And, finally, there is no reliable tool to properly resolve dependencies in Python, so I started `poetry`
to bring an exhaustive dependency resolver to the Python community.
And, finally, I started `poetry` to bring another exhaustive dependency resolver to the Python community apart from
[Conda's](https://conda.io).

### What about Pipenv?

Expand Down
14 changes: 7 additions & 7 deletions docs/docs/basic-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,21 @@ To deactivate the virtual environment without leaving the shell use `deactivate`
that an activated virtual environment remains active after the Poetry command
has completed execution.

Therefore, Poetry has to create a sub-shell with the virtual envrionment activated
Therefore, Poetry has to create a sub-shell with the virtual environment activated
in order for the subsequent commands to run from within the virtual environment.


Alternatively, to avoid creating a new shell, you can manually activate the
virtual environment by running `source {path_to_venv}/bin/activate` (`source {path_to_venv}\Scripts\activate.bat` on Windows).
virtual environment by running `source {path_to_venv}/bin/activate` (`{path_to_venv}\Scripts\activate.bat` on Windows).
To get the path to your virtual environment run `poetry env info --path`.
You can also combine these into a nice one-liner, `source $(poetry env info --path)/bin/activate`
To deactivate this virtual environment simply use `deactivate`.

| | POSIX Shell | Windows | Exit/Deactivate |
|-------------------|------------------------------------------------|---------------------------------------------|-----------------|
| New Shell | `poetry shell` | `poetry shell` | `exit` |
| Manual Activation | `source {path_to_venv}/bin/activate` | `source {path_to_venv}\Scripts\activate.bat`| `deactivate` |
| One-liner | ```source`poetry env info --path`/bin/activate```| | `deactivate` |
| | POSIX Shell | Windows | Exit/Deactivate |
|-------------------|---------------------------------------------------|---------------------------------------------|-----------------|
| New Shell | `poetry shell` | `poetry shell` | `exit` |
| Manual Activation | `source {path_to_venv}/bin/activate` | `{path_to_venv}\Scripts\activate.bat` | `deactivate` |
| One-liner | ```source `poetry env info --path`/bin/activate```| | `deactivate` |


### Version constraints
Expand Down
35 changes: 31 additions & 4 deletions docs/docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ then `--help` combined with any of those can give you more information.
* `--ansi`: Force ANSI output.
* `--no-ansi`: Disable ANSI output.
* `--version (-V)`: Display this application version.
* `--no-interaction (-n)`: Do not ask any interactive question.


## new
Expand Down Expand Up @@ -108,6 +109,13 @@ the `--no-dev` option.
poetry install --no-dev
```

Conversely, you can specify to the command that you only want to install the development dependencies
by passing the `--dev-only` option. Note that `--no-dev` takes priority if both options are passed.

```bash
poetry install --dev-only
```

If you want to remove old dependencies no longer present in the lock file, use the
`--remove-untracked` option.

Expand Down Expand Up @@ -141,10 +149,16 @@ If you want to skip this installation, use the `--no-root` option.
poetry install --no-root
```

Installation of your project's package is also skipped when the `--dev-only`
option is passed.

### Options

* `--no-dev`: Do not install dev dependencies.
* `--dev-only`: Only install dev dependencies.
* `--no-root`: Do not install the root package (your project).
* `--dry-run`: Output the operations but do not execute anything (implicitly enables --verbose).
* `--remove-untracked`: Remove dependencies not presented in the lock file
* `--extras (-E)`: Features to install (multiple values allowed).

## update
Expand Down Expand Up @@ -212,6 +226,10 @@ or use ssh instead of https:

```bash
poetry add git+ssh://git@github.com/sdispater/pendulum.git

or alternatively:

poetry add git+ssh://git@github.com:sdispater/pendulum.git
```

If you need to checkout a specific branch, tag or revision,
Expand All @@ -220,6 +238,11 @@ you can specify it when using `add`:
```bash
poetry add git+https://github.com/sdispater/pendulum.git#develop
poetry add git+https://github.com/sdispater/pendulum.git#2.0.5

or using SSH instead:

poetry add git+ssh://github.com/sdispater/pendulum.git#develop
poetry add git+ssh://github.com/sdispater/pendulum.git#2.0.5
```

or make them point to a local directory or file:
Expand Down Expand Up @@ -254,10 +277,14 @@ poetry add "git+https://github.com/pallets/flask.git@1.1.1[dotenv,dev]"
### Options

* `--dev (-D)`: Add package as development dependency.
* `--path`: The path to a dependency.
* `--optional` : Add as an optional dependency.
* `--dry-run` : Outputs the operations but will not execute anything (implicitly enables --verbose).
* `--lock` : Do not perform install (only update the lockfile).
* `--extras (-E)`: Extras to activate for the dependency. (multiple values allowed)
* `--optional`: Add as an optional dependency.
* `--python`: Python version for which the dependency must be installed.
* `--platform`: Platforms for which the dependency must be installed.
* `--source`: Name of the source to use to install the package.
* `---allow-prereleases`: Accept prereleases.
* `--dry-run`: Outputs the operations but will not execute anything (implicitly enables --verbose).
* `--lock`: Do not perform install (only update the lockfile).


## remove
Expand Down
16 changes: 16 additions & 0 deletions docs/docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ which will give you something similar to this:
cache-dir = "/path/to/cache/directory"
virtualenvs.create = true
virtualenvs.in-project = null
virtualenvs.options.always-copy = true
virtualenvs.path = "{cache-dir}/virtualenvs" # /path/to/cache/directory/virtualenvs
```

Expand Down Expand Up @@ -102,6 +103,15 @@ Defaults to one of the following directories:
- Windows: `C:\Users\<username>\AppData\Local\pypoetry\Cache`
- Unix: `~/.cache/pypoetry`

### `installer.parallel`: boolean

Use parallel execution when using the new (`>=1.1.0`) installer.
Defaults to `true`.

!!!note:
This configuration will be ignored, and parallel execution disabled when running
Python 2.7 under Windows.

### `virtualenvs.create`: boolean

Create a new virtual environment if one doesn't already exist.
Expand All @@ -128,6 +138,12 @@ If not set explicitly (default), `poetry` will use the virtualenv from the `.ven
Directory where virtual environments will be created.
Defaults to `{cache-dir}/virtualenvs` (`{cache-dir}\virtualenvs` on Windows).

### `virtualenvs.options.always-copy`: boolean

If set to `true` the `--always-copy` parameter is passed to `virtualenv` on creation of the venv. Thus all needed files are copied into the venv instead of symlinked.
Defaults to `false`.


### `repositories.<name>`: string

Set a new alternative repository. See [Repositories](/docs/repositories/) for more information.
14 changes: 8 additions & 6 deletions docs/docs/dependency-specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@ of the dependency and on the optional constraints that might be needed for it to

### Caret requirements

**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 `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`.
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.
**Caret requirements** allow [SemVer](https://semver.org/) 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. For instance, if we previously ran `poetry add requests@^2.13.0` and wanted to update the library and 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`. 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.

Here are some more examples of caret requirements and the versions that would be allowed with them:

Expand Down Expand Up @@ -103,6 +98,13 @@ flask = { git = "https://github.com/pallets/flask.git", rev = "38eb5d3b" }
numpy = { git = "https://github.com/numpy/numpy.git", tag = "v0.13.2" }
```

To use an SSH connection, for example in the case of private repositories, use the following example syntax:

```toml
[tool.poetry.dependencies]
requests = { git = "git@github.com:requests/requests.git" }
```

## `path` dependencies

To depend on a library located in a local directory or file,
Expand Down
9 changes: 9 additions & 0 deletions docs/docs/managing-environments.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,13 @@ poetry env remove 3.7
poetry env remove test-O3eWbxRl-py3.7
```

You can delete more than one environment at a time.
```bash
poetry env remove 3.6 3.7 3.8
```
Use the `--all` option to delete all virtual environments at once.
```bash
poetry env remove --all
```

If you remove the currently activated virtual environment, it will be automatically deactivated.
Loading

0 comments on commit 56564f4

Please sign in to comment.