Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#216)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Branch Vincent <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and branchvincent authored Jul 16, 2023
1 parent a6ca696 commit 36ee7c9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ repos:
- id: check-docstring-first

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

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.272
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.277
hooks:
- id: ruff
8 changes: 3 additions & 5 deletions src/poetry_plugin_export/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@ class ExportCommand(GroupCommand):
name = "export"
description = "Exports the lock file to alternative formats."

options = [
options = [ # noqa: RUF012
option(
"format",
"f",
(
"Format to export to. Currently, only constraints.txt and"
" requirements.txt are supported."
),
"Format to export to. Currently, only constraints.txt and"
" requirements.txt are supported.",
flag=False,
default=Exporter.FORMAT_REQUIREMENTS_TXT,
),
Expand Down
3 changes: 2 additions & 1 deletion src/poetry_plugin_export/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
if TYPE_CHECKING:
from collections.abc import Collection
from pathlib import Path
from typing import ClassVar

from packaging.utils import NormalizedName
from poetry.poetry import Poetry
Expand All @@ -30,7 +31,7 @@ class Exporter:
FORMAT_REQUIREMENTS_TXT = "requirements.txt"
ALLOWED_HASH_ALGORITHMS = ("sha256", "sha384", "sha512")

EXPORT_METHODS = {
EXPORT_METHODS: ClassVar[dict[str, str]] = {
FORMAT_CONSTRAINTS_TXT: "_export_constraints_txt",
FORMAT_REQUIREMENTS_TXT: "_export_requirements_txt",
}
Expand Down

0 comments on commit 36ee7c9

Please sign in to comment.