Skip to content

Commit 833fdff

Browse files
committed
uv run pre-commit run -a
1 parent a66cae5 commit 833fdff

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

docs/features/cicd.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ files to set-up the environment, run the tests, and check the code
2323
formatting.
2424

2525
`on-release-main.yml` does all of the former whenever a new release is
26-
made on the `main` branch.
26+
made on the `main` branch.
2727
In addition, `on-release-main.yml` also
2828
publishes the project to different package indexes depending on `publish_python_package` value.
2929
- pypi
@@ -34,7 +34,7 @@ publishes the project to different package indexes depending on `publish_python_
3434
- Doesn't publish
3535

3636
It also it builds and deploys the documentation
37-
if `mkdocs` is set to `"y"`.
37+
if `mkdocs` is set to `"y"`.
3838

3939
To learn more about these features,
4040
see [Publishing to PyPI](./publishing.md) and [Documentation with MkDocs](./mkdocs.md)

docs/features/publishing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Depending on `publish_python_package` value, `on-release-main.yml` workflow publishes the code to different locations whenever a [new release](./cicd.md#how-to-trigger-a-release) is made.
66
- pypi
7-
- [PyPI](https://pypi.org)
7+
- [PyPI](https://pypi.org)
88
- azure_artifacts
99
- [Azure Artifacts](https://azure.microsoft.com/en-us/products/devops/artifacts)
1010
- None

hooks/post_gen_project.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ def move_dir(src: str, target: str) -> None:
2727
if "{{cookiecutter.include_github_actions}}" != "y":
2828
remove_dir(".github")
2929
else:
30-
if "{{cookiecutter.mkdocs}}" != "y" and "{{cookiecutter.publish_python_package}}" not in ["pypi", "azure_artifacts"]:
30+
if "{{cookiecutter.mkdocs}}" != "y" and "{{cookiecutter.publish_python_package}}" not in [
31+
"pypi",
32+
"azure_artifacts",
33+
]:
3134
remove_file(".github/workflows/on-release-main.yml")
3235

3336
if "{{cookiecutter.mkdocs}}" != "y":

tests/test_cookiecutter.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,19 @@ def test_cicd_contains_pypi_secrets(cookies, tmp_path):
7676
assert file_contains_text(f"{result.project_path}/.github/workflows/on-release-main.yml", "PYPI_TOKEN")
7777
assert file_contains_text(f"{result.project_path}/Makefile", "build-and-publish")
7878

79+
7980
def test_cicd_contains_azure_artifacts_secrets(cookies, tmp_path):
8081
with run_within_dir(tmp_path):
8182
result = cookies.bake(extra_context={"publish_python_package": "azure_artifacts"})
8283
assert result.exit_code == 0
8384
assert is_valid_yaml(result.project_path / ".github" / "workflows" / "on-release-main.yml")
8485

85-
assert file_contains_text(f"{result.project_path}/.github/workflows/on-release-main.yml", "UV_INDEX_PRIVATE_REGISTRY_PASSWORD")
86-
assert file_contains_text(f"{result.project_path}/.github/workflows/on-release-main.yml", "UV_INDEX_PRIVATE_REGISTRY_USERNAME")
86+
assert file_contains_text(
87+
f"{result.project_path}/.github/workflows/on-release-main.yml", "UV_INDEX_PRIVATE_REGISTRY_PASSWORD"
88+
)
89+
assert file_contains_text(
90+
f"{result.project_path}/.github/workflows/on-release-main.yml", "UV_INDEX_PRIVATE_REGISTRY_USERNAME"
91+
)
8792
assert file_contains_text(f"{result.project_path}/.github/workflows/on-release-main.yml", "UV_PUBLISH_PASSWORD")
8893
assert file_contains_text(f"{result.project_path}/.github/workflows/on-release-main.yml", "UV_PUBLISH_USERNAME")
8994

0 commit comments

Comments
 (0)