Skip to content

Commit

Permalink
Merge branch 'master' into fix/skip-pre-commit-hook
Browse files Browse the repository at this point in the history
  • Loading branch information
bentocin authored Jul 20, 2023
2 parents 085634c + c71deb4 commit 765ccb8
Show file tree
Hide file tree
Showing 35 changed files with 178 additions and 248 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repos:
- id: check-docstring-first

- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.7.0
hooks:
- id: black

Expand All @@ -30,7 +30,7 @@ repos:
hooks:
- id: validate_manifest

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.272
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.278
hooks:
- id: ruff
2 changes: 1 addition & 1 deletion docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ poetry self remove poetry-plugin
You can also list all currently installed plugins by running:

```shell
poetry self show
poetry self show plugins
```

### With `pipx inject`
Expand Down
82 changes: 41 additions & 41 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ known-first-party = ["poetry"]
known-third-party = ["poetry.core"]
required-imports = ["from __future__ import annotations"]

[tool.ruff.per-file-ignores]
"src/poetry/console/*" = ["RUF012"] # Can't annotate properly until new version of Cleo

[tool.black]
target-version = ['py38']
preview = true
Expand Down
3 changes: 2 additions & 1 deletion src/poetry/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from pathlib import Path
from typing import TYPE_CHECKING
from typing import Any
from typing import ClassVar

from packaging.utils import canonicalize_name

Expand Down Expand Up @@ -104,7 +105,7 @@ def validator(cls, policy: str) -> bool:


class Config:
default_config: dict[str, Any] = {
default_config: ClassVar[dict[str, Any]] = {
"cache-dir": str(DEFAULT_CACHE_DIR),
"virtualenvs": {
"create": True,
Expand Down
8 changes: 3 additions & 5 deletions src/poetry/config/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ def __post_init__(self, default: bool, secondary: bool) -> None:
self.priority = Priority[self.priority.upper()]
if default or secondary:
warnings.warn(
(
"Parameters 'default' and 'secondary' to"
" 'Source' are deprecated. Please provide"
" 'priority' instead."
),
"Parameters 'default' and 'secondary' to"
" 'Source' are deprecated. Please provide"
" 'priority' instead.",
DeprecationWarning,
stacklevel=2,
)
Expand Down
12 changes: 4 additions & 8 deletions src/poetry/console/commands/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ class AddCommand(InstallerCommand, InitCommand):
option(
"dev",
"D",
(
"Add as a development dependency. (<warning>Deprecated</warning>) Use"
" --group=dev instead."
),
"Add as a development dependency. (<warning>Deprecated</warning>) Use"
" --group=dev instead.",
),
option("editable", "e", "Add vcs/path dependencies as editable."),
option(
Expand Down Expand Up @@ -66,10 +64,8 @@ class AddCommand(InstallerCommand, InitCommand):
option(
"dry-run",
None,
(
"Output the operations but do not execute anything (implicitly enables"
" --verbose)."
),
"Output the operations but do not execute anything (implicitly enables"
" --verbose).",
),
option("lock", None, "Do not perform operations (only update the lockfile)."),
]
Expand Down
6 changes: 2 additions & 4 deletions src/poetry/console/commands/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ class CheckCommand(Command):
option(
"lock",
None,
(
"Checks that <comment>poetry.lock</> exists for the current"
" version of <comment>pyproject.toml</>."
),
"Checks that <comment>poetry.lock</> exists for the current"
" version of <comment>pyproject.toml</>.",
),
]

Expand Down
6 changes: 2 additions & 4 deletions src/poetry/console/commands/env/remove.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ class EnvRemoveCommand(Command):
arguments = [
argument(
"python",
(
"The python executables associated with, or names of the virtual"
" environments which are to be removed."
),
"The python executables associated with, or names of the virtual"
" environments which are to be removed.",
optional=True,
multiple=True,
)
Expand Down
18 changes: 6 additions & 12 deletions src/poetry/console/commands/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,16 @@ class InitCommand(Command):
option(
"dependency",
None,
(
"Package to require, with an optional version constraint, "
"e.g. requests:^2.10.0 or requests=2.11.1."
),
"Package to require, with an optional version constraint, "
"e.g. requests:^2.10.0 or requests=2.11.1.",
flag=False,
multiple=True,
),
option(
"dev-dependency",
None,
(
"Package to require for development, with an optional version"
" constraint, e.g. requests:^2.10.0 or requests=2.11.1."
),
"Package to require for development, with an optional version"
" constraint, e.g. requests:^2.10.0 or requests=2.11.1.",
flag=False,
multiple=True,
),
Expand Down Expand Up @@ -330,10 +326,8 @@ def _determine_requirements(
choices.append("")

package = self.choice(
(
"\nEnter package # to add, or the complete package name if"
" it is not listed"
),
"\nEnter package # to add, or the complete package name if"
" it is not listed",
choices,
attempts=3,
default=len(choices) - 1,
Expand Down
Loading

0 comments on commit 765ccb8

Please sign in to comment.