Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove mentions of Py2.7 from docs #5529

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/dependency-specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,12 @@ You can also specify that a dependency should be installed only for specific Pyt

```toml
[tool.poetry.dependencies]
pathlib2 = { version = "^2.2", python = "~2.7" }
tomli = { version = "^2.0.1", python = "<3.11" }
```

```toml
[tool.poetry.dependencies]
pathlib2 = { version = "^2.2", python = "~2.7 || ^3.2" }
pathlib2 = { version = "^2.2", python = "^3.2" }
```

## Using environment markers
Expand All @@ -228,7 +228,7 @@ via the `markers` property:

```toml
[tool.poetry.dependencies]
pathlib2 = { version = "^2.2", markers = "python_version ~= '2.7' or sys_platform == 'win32'" }
pathlib2 = { version = "^2.2", markers = "python_version <= '3.4' or sys_platform == 'win32'" }
```

## Multiple constraints dependencies
Expand All @@ -243,7 +243,7 @@ you would declare it like so:
```toml
[tool.poetry.dependencies]
foo = [
{version = "<=1.9", python = "^2.7"},
{version = "<=1.9", python = "^3.6"},
{version = "^2.0", python = "^3.8"}
]
```
Expand Down
5 changes: 4 additions & 1 deletion docs/managing-environments.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ poetry install
```
{{% /note %}}

{{% note %}}
Since version 1.2, Poetry no longer supports managing environments for Python 2.7.
{{% /note %}}

## Switching between environments

Sometimes this might not be feasible for your system, especially Windows where `pyenv`
Expand Down Expand Up @@ -114,7 +118,6 @@ poetry env list
will output something like the following:

```text
test-O3eWbxRl-py2.7
test-O3eWbxRl-py3.6
test-O3eWbxRl-py3.7 (Activated)
```
Expand Down
2 changes: 1 addition & 1 deletion docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ version = "1.0.0"

# ...
[tool.poetry.dependencies]
python = "~2.7 || ^3.7"
python = "^3.7"
poetry = "^1.0"

[tool.poetry.plugins."poetry.plugin"]
Expand Down
2 changes: 1 addition & 1 deletion docs/pyproject.md
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ mandatory = "^1.0"

# A list of all of the optional dependencies, some of which are included in the
# below `extras`. They can be opted into by apps.
psycopg2 = { version = "^2.7", optional = true }
psycopg2 = { version = "^2.9", optional = true }
mysqlclient = { version = "^1.3", optional = true }

[tool.poetry.extras]
Expand Down
10 changes: 8 additions & 2 deletions src/poetry/utils/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import hashlib
import itertools
import json
import logging
import os
import platform
import re
Expand Down Expand Up @@ -38,6 +39,7 @@
from poetry.core.utils.helpers import temporary_directory
from virtualenv.seed.wheels.embed import get_embed_wheel

from poetry.exceptions import PoetryException
from poetry.locations import CACHE_DIR
from poetry.utils._compat import decode
from poetry.utils._compat import encode
Expand All @@ -52,6 +54,7 @@
from cleo.io.io import IO
from poetry.core.version.markers import BaseMarker

logger = logging.getLogger(__name__)

P = TypeVar("P", bound=Poetry)

Expand Down Expand Up @@ -1637,9 +1640,12 @@ def get_pip_command(self, embedded: bool = False) -> list[str]:
]

def get_supported_tags(self) -> list[Tag]:
output = self.run_python_script(GET_SYS_TAGS)
if self.get_version_info() < (3, 0, 0):
raise PoetryException("Poetry does not support python 2.7 environments")
Secrus marked this conversation as resolved.
Show resolved Hide resolved
else:
output = self.run_python_script(GET_SYS_TAGS)
Secrus marked this conversation as resolved.
Show resolved Hide resolved

return [Tag(*t) for t in json.loads(output)]
return [Tag(*t) for t in json.loads(output)]
Secrus marked this conversation as resolved.
Show resolved Hide resolved

def get_marker_env(self) -> dict[str, Any]:
output = self.run_python_script(GET_ENVIRONMENT_INFO)
Expand Down