Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion flit_gettext/core.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from flit_core import buildapi
from flit_core.buildapi import * # noqa: F403
from flit_core.buildapi import *

from flit_gettext.utils import compile_gettext_translations

Expand Down
4 changes: 2 additions & 2 deletions flit_gettext/scm.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# pragma: no cover
# covered in integration test using subprocess
from flit_scm import * # noqa: F403
from flit_scm import *

from .core import * # noqa: F403
from .core import *
6 changes: 4 additions & 2 deletions flit_gettext/utils.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import shutil
import subprocess # nosec
import sys
from pathlib import Path


def compile_gettext_translations(config):
"""Compile gettext translations."""
print("\33[1m* Compiling gettext translations...\33[0m")
sys.stdout.write("\33[1m* Compiling gettext translations...\33[0m\n")

msgfmt = shutil.which("msgfmt")

if msgfmt is None:
raise OSError("msgfmt not found, please install gettext or check your PATH.")
msg = "msgfmt not found, please install gettext or check your PATH."
raise OSError(msg)

# working directory is the source tree
for file in Path().rglob(f"{config.module}/**/*.po"):
Expand Down
36 changes: 21 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,29 @@ quote-style = "double"
line-ending = "auto"
skip-magic-trailing-comma = false
[tool.ruff.lint]
select = [
"D", # pydocstyle
"E", # pycodestyle errors
"EXE", # flake8-executable
"F", # pyflakes
"I", # isort
"PGH", # pygrep-hooks
"PT", # flake8-pytest-style
"RET", # flake8-return
"S", # flake8-bandit
"SIM", # flake8-simplify
"UP", # pyupgrade
"W", # pycodestyle warnings
extend-select = [
"C90",
"D",
"D213",
"DJ",
"E",
"G",
"N",
"PERF",
"PT",
"PTH",
"RET",
"S",
"SIM",
"SLOT",
"T20",
"TRY",
"UP",
"W",
]
ignore = [ "D1" ]
ignore = [ "D1", "D203", "D212", "E501", "RUF01" ]
per-file-ignores."*/migrations/*.py" = [ "E501" ]
per-file-ignores."*/test*.py" = [ "PLR2004", "S101" ]
per-file-ignores."tests/**" = [ "DJ006", "DJ007", "DJ008", "PLR2004", "S101", "S105", "S106", "S311", "S603", "S607" ]
flake8-pytest-style.fixture-parentheses = false
flake8-pytest-style.mark-parentheses = false
isort.combine-as-imports = true
Expand Down
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@


def copy_backend(temp_dir):
"""Copy the in-tree build backend into the package directory.
"""
Copy the in-tree build backend into the package directory.

``backend-path`` must point to a directory inside the project.
"""
Expand Down
6 changes: 3 additions & 3 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_build_sdist(package):
"""
)

output = subprocess.check_output( # noqa: S603
output = subprocess.check_output(
[sys.executable, "-m", "build", "--sdist"],
cwd=package,
env={**os.environ, "PYTHONPATH": f".:{ROOT}"},
Expand Down Expand Up @@ -54,7 +54,7 @@ def test_build_wheel(package):
"""
)

output = subprocess.check_output( # noqa: S603
output = subprocess.check_output(
[sys.executable, "-m", "build", "--wheel"],
cwd=package,
env={**os.environ, "PYTHONPATH": f".:{ROOT}"},
Expand Down Expand Up @@ -86,7 +86,7 @@ def test_editable_editable(package):
packages_dir = package / "packages"
packages_dir.mkdir(parents=True)

output = subprocess.check_output( # noqa: S603
output = subprocess.check_output(
[
sys.executable,
"-m",
Expand Down
6 changes: 3 additions & 3 deletions tests/test_scm.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_build_sdist(package_scm):
"""
)

output = subprocess.check_output( # noqa: S603
output = subprocess.check_output(
[sys.executable, "-m", "build", "--sdist"],
cwd=package_scm,
env={**os.environ, "PYTHONPATH": f".:{ROOT}"},
Expand Down Expand Up @@ -54,7 +54,7 @@ def test_build_wheel(package_scm):
"""
)

output = subprocess.check_output( # noqa: S603
output = subprocess.check_output(
[sys.executable, "-m", "build", "--wheel"],
cwd=package_scm,
env={**os.environ, "PYTHONPATH": f".:{ROOT}"},
Expand Down Expand Up @@ -86,7 +86,7 @@ def test_editable_editable(package_scm):
packages_dir = package_scm / "packages"
packages_dir.mkdir(parents=True)

output = subprocess.check_output( # noqa: S603
output = subprocess.check_output(
[
sys.executable,
"-m",
Expand Down
Loading