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
9 changes: 5 additions & 4 deletions .ci/scripts/validate_commit_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from pathlib import Path

import tomllib
from github import Github

with Path("pyproject.toml").open("rb") as fp:
PYPROJECT_TOML = tomllib.load(fp)
Expand All @@ -36,11 +35,13 @@
if any(re.match(pattern, message) for pattern in BLOCKING_REGEX):
sys.exit("This PR is not ready for consumption.")

g = Github(os.environ.get("GITHUB_TOKEN"))
repo = g.get_repo("pulp/pulp-cli")


def check_status(issue: str) -> None:
from github import Github

g = Github(os.environ.get("GITHUB_TOKEN"))
repo = g.get_repo("pulp/pulp-cli")

gi = repo.get_issue(int(issue))
if gi.pull_request:
sys.exit(f"Error: issue #{issue} is a pull request.")
Expand Down
1 change: 1 addition & 0 deletions CHANGES/1428.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Dust off bootstrap template.
1 change: 1 addition & 0 deletions CHANGES/1434.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Dust off bootstrap template.
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ dependencies = [
]

[project.urls]
repository = "https://github.com/pulp/{{ cookiecutter.__project_name }}"
changelog = "https://github.com/pulp/{{ cookiecutter.__project_name }}/blob/main/CHANGES.md"
repository = "{{ cookiecutter.repository }}"
changelog = "{{ cookiecutter.repository }}/blob/main/CHANGES.md"
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ changelog = "{{ cookiecutter.repository }}/blob/main/CHANGES.md"
app_label = {{ cookiecutter.app_label | toml_value }}
glue = {{ cookiecutter.glue | toml_value }}
docs = {{ cookiecutter.docs | toml_value }}
repository = {{ cookiecutter.repository | toml_value }}
src_layout = true
translations = {{ cookiecutter.translations | toml_value }}

Expand Down
9 changes: 4 additions & 5 deletions cookiecutter/ci/hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

for base_path in [
".",
{%- if cookiecutter.glue %}
"pulp-glue{{ cookiecutter.__app_label_suffix }}",
{%- endif %}
]:
# Merge pyproject.toml.update into pyproject.toml
with open(os.path.join(base_path, "pyproject.toml"), "r") as fp:
Expand All @@ -17,13 +19,10 @@

# TODO How deep is your merge?
# Is merging on the tool level appropriate?
pyproject_toml["tool"].update(pyproject_toml_update["tool"])
pyproject_toml.setdefault("tool", {}).update(pyproject_toml_update["tool"])

if "dependency-groups" in pyproject_toml_update:
if "dependency-groups" not in pyproject_toml:
pyproject_toml["dependency-groups"]=pyproject_toml_update["dependency-groups"]
else:
pyproject_toml["dependency-groups"].update(pyproject_toml_update["dependency-groups"])
pyproject_toml.setdefault("dependency-groups", {}).update(pyproject_toml_update["dependency-groups"])

# Remove legacy tools.
for tool in ["flake8", "black", "isort"]:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# /// script
# requires-python = ">=3.11"
# dependencies = [
{%- if cookiecutter.repository.startswith("https://github.com/") %}
# "pygithub>=2.8.1,<3.0.0",
{%- endif %}
# ]
# ///

Expand All @@ -12,7 +14,6 @@
from pathlib import Path

import tomllib
from github import Github

with Path("pyproject.toml").open("rb") as fp:
PYPROJECT_TOML = tomllib.load(fp)
Expand All @@ -36,16 +37,22 @@
if any(re.match(pattern, message) for pattern in BLOCKING_REGEX):
sys.exit("This PR is not ready for consumption.")

g = Github(os.environ.get("GITHUB_TOKEN"))
repo = g.get_repo("pulp/pulp-cli{{ cookiecutter.__app_label_suffix }}")


def check_status(issue: str) -> None:
{%- if cookiecutter.repository.startswith("https://github.com/") %}
from github import Github

g = Github(os.environ.get("GITHUB_TOKEN"))
repo = g.get_repo("{{ cookiecutter.repository[19:] }}")

gi = repo.get_issue(int(issue))
if gi.pull_request:
sys.exit(f"Error: issue #{issue} is a pull request.")
if gi.closed_at:
sys.exit(f"Error: issue #{issue} is closed.")
{%- else %}
pass
{%- endif %}


def check_changelog(issue: str) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ test = [
"secretstorage>=3.5.0",
"trustme>=1.1.0,<1.3",
]
{%- if cookiecutter.glue %}

[tool.uv.sources]
# This section is managed by the cookiecutter templates.
Expand All @@ -36,6 +37,7 @@ pulp-glue{{ cookiecutter.__app_label_suffix }} = { workspace = true }
[tool.uv.workspace]
# This section is managed by the cookiecutter templates.
members = ["pulp-glue{{ cookiecutter.__app_label_suffix }}"]
{%- endif %}

[tool.uv.build-backend]
# This section is managed by the cookiecutter templates.
Expand Down
Loading