Skip to content

Commit ed8241b

Browse files
pulpbotmdellweg
authored andcommitted
Update cookiecutter
1 parent 343550b commit ed8241b

File tree

12 files changed

+89
-45
lines changed

12 files changed

+89
-45
lines changed

.ci/gen_certs.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# /// script
2+
# requires-python = ">=3.10"
3+
# dependencies = [
4+
# "trustme>=1.2.1,<1.3.0",
5+
# ]
6+
# ///
7+
18
import argparse
29
import os
310
import sys
@@ -6,7 +13,6 @@
613

714

815
def main() -> None:
9-
1016
parser = argparse.ArgumentParser(prog="gen_certs")
1117
parser.add_argument(
1218
"-d",

.ci/scripts/calc_constraints.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
#!/bin/python3
2+
# /// script
3+
# requires-python = ">=3.10"
4+
# dependencies = [
5+
# "packaging>=25.0,<25.1",
6+
# "tomli>=2.3.0,<2.4.0;python_version<'3.11'",
7+
# ]
8+
# ///
29

310
import argparse
411
import fileinput

.ci/scripts/check_cli_dependencies.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
#!/bin/env python3
2-
import tomllib
2+
# /// script
3+
# requires-python = ">=3.11"
4+
# dependencies = [
5+
# "packaging>=25.0,<25.1",
6+
# ]
7+
# ///
8+
39
import typing as t
410
from pathlib import Path
511

12+
import tomllib
613
from packaging.requirements import Requirement
714

815
GLUE_DIR = "pulp-glue-ostree"

.ci/scripts/check_click_for_mypy.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
#!/bin/env python3
2+
# /// script
3+
# requires-python = ">=3.11"
4+
# dependencies = [
5+
# "packaging>=25.0,<25.1",
6+
# ]
7+
# ///
28

39
from importlib import metadata
410

.ci/scripts/collect_changes.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
#!/bin/env python3
2+
# /// script
3+
# requires-python = ">=3.11"
4+
# dependencies = [
5+
# "gitpython>=3.1.46,<3.2.0",
6+
# "packaging>=25.0,<25.1",
7+
# ]
8+
# ///
29

310
import itertools
411
import os
512
import re
6-
import tomllib
713

14+
import tomllib
815
from git import GitCommandError, Repo
916
from packaging.version import parse as parse_version
1017

.ci/scripts/pr_labels.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
#!/bin/env python3
2+
# /// script
3+
# requires-python = ">=3.11"
4+
# dependencies = [
5+
# "gitpython>=3.1.46,<3.2.0",
6+
# ]
7+
# ///
28

39
# This script is running with elevated privileges from the main branch against pull requests.
410

511
import re
612
import sys
7-
import tomllib
813
from pathlib import Path
914

15+
import tomllib
1016
from git import Repo
1117

1218

.ci/scripts/validate_commit_message.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1+
# /// script
2+
# requires-python = ">=3.11"
3+
# dependencies = [
4+
# "gitpython>=3.1.46,<3.2.0",
5+
# ]
6+
# ///
7+
18
import os
29
import re
310
import subprocess
411
import sys
5-
import tomllib
612
from pathlib import Path
713

14+
import tomllib
815
from github import Github
916

1017
with open("pyproject.toml", "rb") as fp:

Makefile

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,28 @@
22
GLUE_PLUGINS=$(notdir $(wildcard pulp-glue-ostree/pulp_glue/*))
33
CLI_PLUGINS=$(notdir $(wildcard pulpcore/cli/*))
44

5+
.PHONY: info
56
info:
67
@echo Pulp glue
78
@echo plugins: $(GLUE_PLUGINS)
89
@echo Pulp CLI
910
@echo plugins: $(CLI_PLUGINS)
1011

12+
.PHONY: build
1113
build:
1214
cd pulp-glue-ostree; pyproject-build -n
1315
pyproject-build -n
1416

15-
black: format
16-
17+
.PHONY: format
1718
format:
18-
isort .
19-
cd pulp-glue-ostree; isort .
20-
black .
19+
ruff format
20+
ruff check --fix
2121

22+
.PHONY: lint
2223
lint:
2324
find tests .ci -name '*.sh' -print0 | xargs -0 shellcheck -x
24-
isort -c --diff .
25-
cd pulp-glue-ostree; isort -c --diff .
26-
black --diff --check .
27-
flake8
25+
ruff format --check --diff
26+
ruff check --diff
2827
.ci/scripts/check_cli_dependencies.py
2928
.ci/scripts/check_click_for_mypy.py
3029
MYPYPATH=pulp-glue-ostree mypy
@@ -35,15 +34,18 @@ tests/cli.toml:
3534
cp $@.example $@
3635
@echo "In order to configure the tests to talk to your test server, you might need to edit $@ ."
3736

37+
.PHONY: test
3838
test: | tests/cli.toml
3939
python3 -m pytest -v tests pulp-glue-ostree/tests
4040

41+
.PHONY: livetest
4142
livetest: | tests/cli.toml
4243
python3 -m pytest -v tests pulp-glue-ostree/tests -m live
4344

45+
.PHONY: unittest
4446
unittest:
4547
python3 -m pytest -v tests pulp-glue-ostree/tests -m "not live"
4648

49+
.PHONY: unittest_glue
4750
unittest_glue:
4851
python3 -m pytest -v pulp-glue-ostree/tests -m "not live"
49-
.PHONY: build info black lint test

lint_requirements.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# Lint requirements
2-
black==25.12.0
3-
flake8==7.3.0
4-
flake8-pyproject==1.2.4
5-
isort==7.0.0
2+
ruff==0.14.11
63
mypy==1.19.1
74
shellcheck-py==0.11.0.1
85

pulp-glue-ostree/pyproject.toml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,38 @@ repository = "https://github.com/pulp/pulp-cli-ostree"
3131
changelog = "https://github.com/pulp/pulp-cli-ostree/blob/main/CHANGES.md"
3232

3333
[tool.setuptools.packages.find]
34+
# This section is managed by the cookiecutter templates.
3435
where = ["."]
3536
include = ["pulp_glue.*"]
3637
namespaces = true
3738

3839
[tool.setuptools.package-data]
39-
"*" = ["py.typed", "locale/*/LC_MESSAGES/*.mo"]
40+
# This section is managed by the cookiecutter templates.
41+
"*" = ["py.typed"]
4042

41-
[tool.black]
42-
line-length = 100
43-
44-
[tool.isort]
45-
profile = "black"
46-
line_length = 100
4743

4844
[tool.mypy]
45+
# This section is managed by the cookiecutter templates.
4946
strict = true
47+
warn_unused_ignores = false
5048
show_error_codes = true
51-
files = "pulp_glue/**/*.py"
49+
files = "pulp_glue/**/*.py, tests/**/*.py"
5250
namespace_packages = true
5351
explicit_package_bases = true
5452

5553
[[tool.mypy.overrides]]
54+
# This section is managed by the cookiecutter templates.
5655
module = [
5756
"schema.*",
5857
]
5958
ignore_missing_imports = true
59+
60+
61+
[tool.ruff]
62+
# This section is managed by the cookiecutter templates.
63+
line-length = 100
64+
65+
[tool.ruff.lint]
66+
# This section is managed by the cookiecutter templates.
67+
extend-select = ["I"]
68+

0 commit comments

Comments
 (0)