Skip to content

Commit bf1270b

Browse files
authored
Merge branch 'main' into lock-markers-and-groups3a
2 parents 713e672 + 73302b3 commit bf1270b

File tree

126 files changed

+335
-1579
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+335
-1579
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ repos:
2727
- id: validate_manifest
2828

2929
- repo: https://github.com/astral-sh/ruff-pre-commit
30-
rev: v0.5.4
30+
rev: v0.7.3
3131
hooks:
3232
- id: ruff
3333
- id: ruff-format

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Change Log
22

3+
## [1.8.4] - 2024-10-14
4+
5+
### Added
6+
7+
- **Add official support for Python 3.13** ([#9523](https://github.com/python-poetry/poetry/pull/9523)).
8+
9+
### Changed
10+
11+
- Require `virtualenv>=20.26.6` to mitigate potential command injection when running `poetry shell` in untrusted projects ([#9757](https://github.com/python-poetry/poetry/pull/9757)).
12+
13+
### poetry-core ([`1.9.1`](https://github.com/python-poetry/poetry-core/releases/tag/1.9.1))
14+
15+
- Add `3.13` to the list of available Python versions ([#747](https://github.com/python-poetry/poetry-core/pull/747)).
316

417
## [1.8.3] - 2024-05-08
518

poetry.lock

Lines changed: 36 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ extend-exclude = [
9898
# External to the project's coding standards
9999
"tests/fixtures/git/*",
100100
"tests/fixtures/project_with_setup*/*",
101-
"tests/masonry/builders/fixtures/pep_561_stub_only*/*",
102-
"tests/utils/fixtures/setups/*",
103101
]
104102
fix = true
105103
line-length = 88

src/poetry/console/application.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
from cleo.events.event_dispatcher import EventDispatcher
1717
from cleo.exceptions import CleoError
1818
from cleo.formatters.style import Style
19-
from cleo.io.null_io import NullIO
2019

2120
from poetry.__version__ import __version__
2221
from poetry.console.command_loader import CommandLoader
@@ -322,13 +321,10 @@ def configure_installer_for_command(command: InstallerCommand, io: IO) -> None:
322321
)
323322
command.set_installer(installer)
324323

325-
def _load_plugins(self, io: IO | None = None) -> None:
324+
def _load_plugins(self, io: IO) -> None:
326325
if self._plugins_loaded:
327326
return
328327

329-
if io is None:
330-
io = NullIO()
331-
332328
self._disable_plugins = io.input.has_parameter_option("--no-plugins")
333329

334330
if not self._disable_plugins:

src/poetry/factory.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,11 @@ def create_package_source(
195195
raise InvalidSourceError(
196196
"The PyPI repository cannot be configured with a custom url."
197197
)
198-
return PyPiRepository(disable_cache=disable_cache, pool_size=pool_size)
198+
return PyPiRepository(
199+
config=config,
200+
disable_cache=disable_cache,
201+
pool_size=pool_size,
202+
)
199203

200204
try:
201205
url = source["url"]

src/poetry/inspection/lazy_wheel.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@
1010
from bisect import bisect_right
1111
from contextlib import contextmanager
1212
from tempfile import NamedTemporaryFile
13+
from typing import IO
1314
from typing import TYPE_CHECKING
1415
from typing import Any
15-
from typing import BinaryIO
1616
from typing import ClassVar
17-
from typing import cast
1817
from urllib.parse import urlparse
1918
from zipfile import BadZipFile
2019
from zipfile import ZipFile
@@ -168,14 +167,14 @@ def minimal_intervals_covering(
168167
yield from self._merge(start, end, left, right)
169168

170169

171-
class ReadOnlyIOWrapper(BinaryIO):
172-
"""Implement read-side ``BinaryIO`` methods wrapping an inner ``BinaryIO``.
170+
class ReadOnlyIOWrapper(IO[bytes]):
171+
"""Implement read-side ``IO[bytes]`` methods wrapping an inner ``IO[bytes]``.
173172
174173
This wrapper is useful because Python currently does not distinguish read-only
175174
streams at the type level.
176175
"""
177176

178-
def __init__(self, inner: BinaryIO) -> None:
177+
def __init__(self, inner: IO[bytes]) -> None:
179178
self._file = inner
180179

181180
def __enter__(self) -> Self:
@@ -296,7 +295,8 @@ def __init__(
296295
session: Session | Authenticator,
297296
delete_backing_file: bool = True,
298297
) -> None:
299-
super().__init__(cast(BinaryIO, NamedTemporaryFile(delete=delete_backing_file)))
298+
inner = NamedTemporaryFile(delete=delete_backing_file) # noqa: SIM115
299+
super().__init__(inner)
300300

301301
self._merge_intervals: MergeIntervals | None = None
302302
self._length: int | None = None

src/poetry/repositories/cached_repository.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class CachedRepository(Repository, ABC):
2525
CACHE_VERSION = parse_constraint("2.0.0")
2626

2727
def __init__(
28-
self, name: str, disable_cache: bool = False, config: Config | None = None
28+
self, name: str, *, disable_cache: bool = False, config: Config | None = None
2929
) -> None:
3030
super().__init__(name)
3131
self._disable_cache = disable_cache

src/poetry/repositories/http_repository.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,12 @@ def __init__(
4949
self,
5050
name: str,
5151
url: str,
52+
*,
5253
config: Config | None = None,
5354
disable_cache: bool = False,
5455
pool_size: int = requests.adapters.DEFAULT_POOLSIZE,
5556
) -> None:
56-
super().__init__(name, disable_cache, config)
57+
super().__init__(name, disable_cache=disable_cache, config=config)
5758
self._url = url
5859
if config is None:
5960
config = Config.create()

src/poetry/repositories/legacy_repository.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,21 @@ def __init__(
3030
self,
3131
name: str,
3232
url: str,
33+
*,
3334
config: Config | None = None,
3435
disable_cache: bool = False,
3536
pool_size: int = requests.adapters.DEFAULT_POOLSIZE,
3637
) -> None:
3738
if name == "pypi":
3839
raise ValueError("The name [pypi] is reserved for repositories")
3940

40-
super().__init__(name, url.rstrip("/"), config, disable_cache, pool_size)
41+
super().__init__(
42+
name,
43+
url.rstrip("/"),
44+
config=config,
45+
disable_cache=disable_cache,
46+
pool_size=pool_size,
47+
)
4148

4249
def package(
4350
self, name: str, version: Version, extras: list[str] | None = None

0 commit comments

Comments
 (0)