copier-python 0.25.0__tar.gz → 0.26.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. {copier_python-0.25.0 → copier_python-0.26.1}/PKG-INFO +1 -1
  2. {copier_python-0.25.0 → copier_python-0.26.1}/copier_python/update.py +2 -9
  3. {copier_python-0.25.0 → copier_python-0.26.1}/docs/project-setup.md +1 -1
  4. {copier_python-0.25.0 → copier_python-0.26.1}/docs/setup.md +1 -1
  5. {copier_python-0.25.0 → copier_python-0.26.1}/tests/template/__snapshots__/test_workflows.ambr +215 -6
  6. {copier_python-0.25.0 → copier_python-0.26.1}/tests/template/test_workflows.py +40 -1
  7. {copier_python-0.25.0 → copier_python-0.26.1}/tests/test_update.py +2 -4
  8. {copier_python-0.25.0 → copier_python-0.26.1}/.gitignore +0 -0
  9. {copier_python-0.25.0 → copier_python-0.26.1}/AGENTS.md +0 -0
  10. {copier_python-0.25.0 → copier_python-0.26.1}/CONTRIBUTING.md +0 -0
  11. {copier_python-0.25.0 → copier_python-0.26.1}/LICENSE +0 -0
  12. {copier_python-0.25.0 → copier_python-0.26.1}/README.md +0 -0
  13. {copier_python-0.25.0 → copier_python-0.26.1}/copier_python/__init__.py +0 -0
  14. {copier_python-0.25.0 → copier_python-0.26.1}/copier_python/__main__.py +0 -0
  15. {copier_python-0.25.0 → copier_python-0.26.1}/copier_python/py.typed +0 -0
  16. {copier_python-0.25.0 → copier_python-0.26.1}/copier_python/repo.py +0 -0
  17. {copier_python-0.25.0 → copier_python-0.26.1}/docs/contributing.md +0 -0
  18. {copier_python-0.25.0 → copier_python-0.26.1}/docs/development/requirements.md +0 -0
  19. {copier_python-0.25.0 → copier_python-0.26.1}/docs/development/updates.md +0 -0
  20. {copier_python-0.25.0 → copier_python-0.26.1}/docs/development/workflow.md +0 -0
  21. {copier_python-0.25.0 → copier_python-0.26.1}/docs/index.md +0 -0
  22. {copier_python-0.25.0 → copier_python-0.26.1}/docs/license.md +0 -0
  23. {copier_python-0.25.0 → copier_python-0.26.1}/docs/project-creation.md +0 -0
  24. {copier_python-0.25.0 → copier_python-0.26.1}/docs/project-development.md +0 -0
  25. {copier_python-0.25.0 → copier_python-0.26.1}/docs/project-release.md +0 -0
  26. {copier_python-0.25.0 → copier_python-0.26.1}/docs/project-updates.md +0 -0
  27. {copier_python-0.25.0 → copier_python-0.26.1}/docs/releasing.md +0 -0
  28. {copier_python-0.25.0 → copier_python-0.26.1}/docs/requirements.md +0 -0
  29. {copier_python-0.25.0 → copier_python-0.26.1}/pyproject.toml +0 -0
  30. {copier_python-0.25.0 → copier_python-0.26.1}/tests/__init__.py +0 -0
  31. {copier_python-0.25.0 → copier_python-0.26.1}/tests/conftest.py +0 -0
  32. {copier_python-0.25.0 → copier_python-0.26.1}/tests/template/__init__.py +0 -0
  33. {copier_python-0.25.0 → copier_python-0.26.1}/tests/template/__snapshots__/test_agents.ambr +0 -0
  34. {copier_python-0.25.0 → copier_python-0.26.1}/tests/template/__snapshots__/test_commit_check.ambr +0 -0
  35. {copier_python-0.25.0 → copier_python-0.26.1}/tests/template/__snapshots__/test_compose.ambr +0 -0
  36. {copier_python-0.25.0 → copier_python-0.26.1}/tests/template/__snapshots__/test_contributing.ambr +0 -0
  37. {copier_python-0.25.0 → copier_python-0.26.1}/tests/template/__snapshots__/test_dockerfile.ambr +0 -0
  38. {copier_python-0.25.0 → copier_python-0.26.1}/tests/template/__snapshots__/test_docs.ambr +0 -0
  39. {copier_python-0.25.0 → copier_python-0.26.1}/tests/template/__snapshots__/test_license.ambr +0 -0
  40. {copier_python-0.25.0 → copier_python-0.26.1}/tests/template/__snapshots__/test_mise_toml.ambr +0 -0
  41. {copier_python-0.25.0 → copier_python-0.26.1}/tests/template/__snapshots__/test_pre_commit.ambr +0 -0
  42. {copier_python-0.25.0 → copier_python-0.26.1}/tests/template/__snapshots__/test_pyproject.ambr +0 -0
  43. {copier_python-0.25.0 → copier_python-0.26.1}/tests/template/__snapshots__/test_readme.ambr +0 -0
  44. {copier_python-0.25.0 → copier_python-0.26.1}/tests/template/__snapshots__/test_zensical.ambr +0 -0
  45. {copier_python-0.25.0 → copier_python-0.26.1}/tests/template/test_agents.py +0 -0
  46. {copier_python-0.25.0 → copier_python-0.26.1}/tests/template/test_commit_check.py +0 -0
  47. {copier_python-0.25.0 → copier_python-0.26.1}/tests/template/test_compose.py +0 -0
  48. {copier_python-0.25.0 → copier_python-0.26.1}/tests/template/test_contributing.py +0 -0
  49. {copier_python-0.25.0 → copier_python-0.26.1}/tests/template/test_dockerfile.py +0 -0
  50. {copier_python-0.25.0 → copier_python-0.26.1}/tests/template/test_docs.py +0 -0
  51. {copier_python-0.25.0 → copier_python-0.26.1}/tests/template/test_license.py +0 -0
  52. {copier_python-0.25.0 → copier_python-0.26.1}/tests/template/test_mise_toml.py +0 -0
  53. {copier_python-0.25.0 → copier_python-0.26.1}/tests/template/test_pre_commit.py +0 -0
  54. {copier_python-0.25.0 → copier_python-0.26.1}/tests/template/test_pyproject.py +0 -0
  55. {copier_python-0.25.0 → copier_python-0.26.1}/tests/template/test_readme.py +0 -0
  56. {copier_python-0.25.0 → copier_python-0.26.1}/tests/template/test_structure.py +0 -0
  57. {copier_python-0.25.0 → copier_python-0.26.1}/tests/template/test_template.py +0 -0
  58. {copier_python-0.25.0 → copier_python-0.26.1}/tests/template/test_zensical.py +0 -0
  59. {copier_python-0.25.0 → copier_python-0.26.1}/tests/test_version.py +0 -0
  60. {copier_python-0.25.0 → copier_python-0.26.1}/tests/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: copier-python
3
- Version: 0.25.0
3
+ Version: 0.26.1
4
4
  Summary: Copier template for Python projects with modern tooling
5
5
  Project-URL: Homepage, https://smkent.github.io/copier-python
6
6
  Project-URL: Repository, https://github.com/smkent/copier-python
@@ -1,7 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import json
4
- import os
5
4
  import subprocess
6
5
  from contextlib import contextmanager
7
6
  from dataclasses import dataclass, field
@@ -73,16 +72,10 @@ class UpdateAction:
73
72
  with self._success_or_shell(repo, "Lint/test"):
74
73
  repo.run_task("lt")
75
74
 
76
- title = "Apply template updates"
75
+ title = f"Apply template updates from {start_ref} to {end_ref}"
77
76
  body = ""
78
77
  if start_ref and end_ref and start_ref != end_ref:
79
- ref_range = f"{start_ref}...{end_ref}"
80
- body = os.linesep.join(
81
- (
82
- f"Applied updates from template: {ref_range}",
83
- f"{TEMPLATE_REPO_URL}/compare/{ref_range}",
84
- )
85
- )
78
+ body = f"{TEMPLATE_REPO_URL}/compare/{start_ref}...{end_ref}"
86
79
  repo.run(["git", "add", "-A"])
87
80
  repo.run(["git", "commit", "-m", f"{title}\n\n{body}".strip()])
88
81
 
@@ -22,7 +22,7 @@ icon: lucide/settings
22
22
  [Repository Settings → General][github-settings-docs]:
23
23
 
24
24
  - [x] Allow merge commits
25
- - [ ] Allow squash merging
25
+ - [x] Allow squash merging
26
26
  - [ ] Allow rebase merging
27
27
  - [x] Automatically delete head branches
28
28
 
@@ -14,7 +14,7 @@ icon: lucide/package-plus
14
14
  [Settings → General][repo-settings]:
15
15
 
16
16
  - [x] Allow merge commits
17
- - [ ] Allow squash merging
17
+ - [x] Allow squash merging
18
18
  - [ ] Allow rebase merging
19
19
  - [x] Automatically delete head branches
20
20
 
@@ -1,4 +1,47 @@
1
1
  # serializer version: 1
2
+ # name: test_workflows_audit
3
+ '''
4
+ name: Audit
5
+
6
+ on:
7
+ push:
8
+ branches:
9
+ - main
10
+ paths:
11
+ - uv.lock
12
+ pull_request:
13
+ paths:
14
+ - uv.lock
15
+
16
+ jobs:
17
+ audit:
18
+ name: Dependencies
19
+ runs-on: ubuntu-latest
20
+ env:
21
+ UV_PYTHON: '3.15'
22
+ steps:
23
+ - name: 💾 Check out repository
24
+ uses: actions/checkout@v7
25
+
26
+ - name: 📦 Cache uv managed packages
27
+ uses: actions/cache@v6
28
+ with:
29
+ path: ~/.cache/uv
30
+ key: uv-${{ runner.os }}-${{ hashFiles('pyproject.toml', 'uv.lock') }}
31
+ restore-keys: |
32
+ uv-${{ runner.os }}-
33
+
34
+ - name: 🍳 Set up mise
35
+ uses: jdx/mise-action@v5
36
+ with:
37
+ cache: true
38
+ install: true
39
+
40
+ - name: 🔍 Check dependencies
41
+ run: mise run audit
42
+
43
+ '''
44
+ # ---
2
45
  # name: test_workflows_ci[docs-coverage]
3
46
  '''
4
47
  name: CI
@@ -1311,6 +1354,177 @@
1311
1354
 
1312
1355
  '''
1313
1356
  # ---
1357
+ # name: test_workflows_container[container]
1358
+ '''
1359
+ name: Container
1360
+
1361
+ on:
1362
+ pull_request:
1363
+ push:
1364
+ branches:
1365
+ - main
1366
+ tags:
1367
+ - v[0-9]*.[0-9]*
1368
+
1369
+ jobs:
1370
+ build-push:
1371
+ name: Build and push image
1372
+ runs-on: ubuntu-latest
1373
+ permissions:
1374
+ packages: write
1375
+ contents: read
1376
+ attestations: write
1377
+ id-token: write
1378
+ steps:
1379
+ - name: 💾 Check out repository
1380
+ uses: actions/checkout@v7
1381
+
1382
+ - name: 🛠️ Set up buildx
1383
+ uses: docker/setup-buildx-action@v3
1384
+
1385
+ - name: 🔑 Log in to the container registry
1386
+ uses: docker/login-action@v3
1387
+ if: ${{ github.event_name != 'pull_request' }}
1388
+ with:
1389
+ registry: ghcr.io
1390
+ username: ${{ github.actor }}
1391
+ password: ${{ secrets.GITHUB_TOKEN }}
1392
+
1393
+ - name: 📡 Collect image metadata
1394
+ uses: docker/metadata-action@v5
1395
+ id: meta
1396
+ with:
1397
+ images: ghcr.io/${{ github.repository }}
1398
+ tags: |
1399
+ type=ref,event=branch
1400
+ type=semver,pattern={{version}}
1401
+ type=semver,pattern={{major}}.{{minor}}
1402
+ type=semver,pattern={{major}}
1403
+ type=sha
1404
+
1405
+ - name: 📦 Build and publish container image
1406
+ uses: docker/build-push-action@v6
1407
+ id: push
1408
+ with:
1409
+ context: .
1410
+ push: ${{ github.event_name != 'pull_request' }}
1411
+ platforms: linux/amd64,linux/arm64
1412
+ tags: ${{ steps.meta.outputs.tags }}
1413
+ labels: ${{ steps.meta.outputs.labels }}
1414
+ cache-from: type=gha
1415
+ cache-to: type=gha,mode=max
1416
+
1417
+ - name: 🔒 Attest build provenance
1418
+ uses: actions/attest-build-provenance@v2
1419
+ if: ${{ github.event_name != 'pull_request' }}
1420
+ with:
1421
+ subject-name: ghcr.io/${{ github.repository }}
1422
+ subject-digest: ${{ steps.push.outputs.digest }}
1423
+
1424
+ '''
1425
+ # ---
1426
+ # name: test_workflows_container[ghcr]
1427
+ '''
1428
+ name: Container Registry
1429
+
1430
+ on:
1431
+ pull_request:
1432
+ types:
1433
+ - closed
1434
+ schedule:
1435
+ - cron: 0 3 * * 0
1436
+ workflow_dispatch:
1437
+
1438
+ jobs:
1439
+ cleanup:
1440
+ name: Clean up images
1441
+ runs-on: ubuntu-latest
1442
+ permissions:
1443
+ packages: write
1444
+
1445
+ steps:
1446
+ - name: 🧹 Clean up old container images
1447
+ uses: dataaxiom/ghcr-cleanup-action@v1
1448
+ with:
1449
+ token: ${{ secrets.GITHUB_TOKEN }}
1450
+ keep-n-tagged: 5
1451
+ keep-n-untagged: 2
1452
+ delete-untagged: true
1453
+ exclude-tags: |
1454
+ ^\d+(\.\d+){0,2}$
1455
+ ^edge$
1456
+ ^latest$
1457
+ ^main$
1458
+
1459
+ '''
1460
+ # ---
1461
+ # name: test_workflows_docs
1462
+ '''
1463
+ name: Docs
1464
+
1465
+ on:
1466
+ push:
1467
+ branches:
1468
+ - main
1469
+ workflow_dispatch:
1470
+
1471
+ permissions:
1472
+ contents: read
1473
+ pages: write
1474
+ id-token: write
1475
+
1476
+ concurrency:
1477
+ group: pages
1478
+ cancel-in-progress: false
1479
+
1480
+ jobs:
1481
+ build:
1482
+ name: Build Documentation
1483
+ runs-on: ubuntu-latest
1484
+ env:
1485
+ UV_PYTHON: '3.15'
1486
+ steps:
1487
+ - name: 💾 Check out repository
1488
+ uses: actions/checkout@v7
1489
+ with:
1490
+ fetch-depth: 0
1491
+
1492
+ - name: 📦 Cache uv managed packages
1493
+ uses: actions/cache@v6
1494
+ with:
1495
+ path: ~/.cache/uv
1496
+ key: uv-${{ runner.os }}-${{ hashFiles('pyproject.toml', 'uv.lock') }}
1497
+ restore-keys: |
1498
+ uv-${{ runner.os }}-
1499
+
1500
+ - name: 🍳 Set up mise
1501
+ uses: jdx/mise-action@v5
1502
+ with:
1503
+ cache: true
1504
+ install: true
1505
+
1506
+ - name: 📖 Build documentation
1507
+ run: mise run docs-build
1508
+
1509
+ - name: 🔼 Upload artifact
1510
+ uses: actions/upload-pages-artifact@v5
1511
+ with:
1512
+ path: site/
1513
+
1514
+ deploy:
1515
+ name: Deploy Documentation
1516
+ needs: build
1517
+ runs-on: ubuntu-latest
1518
+ environment:
1519
+ name: github-pages
1520
+ url: ${{ steps.deployment.outputs.page_url }}
1521
+ steps:
1522
+ - name: 🚀 Deploy site
1523
+ uses: actions/deploy-pages@v5
1524
+ id: deployment
1525
+
1526
+ '''
1527
+ # ---
1314
1528
  # name: test_workflows_release
1315
1529
  '''
1316
1530
  name: Release
@@ -1362,11 +1576,6 @@
1362
1576
  permissions:
1363
1577
  contents: write
1364
1578
  steps:
1365
- - name: 💾 Check out repository
1366
- uses: actions/checkout@v7
1367
- with:
1368
- fetch-depth: 0
1369
-
1370
1579
  - name: 🔽 Download artifact
1371
1580
  uses: actions/download-artifact@v8
1372
1581
  with:
@@ -1376,6 +1585,7 @@
1376
1585
  - name: 🏷️ Create GitHub release
1377
1586
  run: gh release create ${{ github.ref_name }} dist/* --generate-notes
1378
1587
  env:
1588
+ GH_REPO: ${{ github.repository }}
1379
1589
  GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1380
1590
 
1381
1591
  publish:
@@ -1387,7 +1597,6 @@
1387
1597
  url: https://pypi.org/project/PKFire/
1388
1598
  permissions:
1389
1599
  id-token: write
1390
- attestations: write
1391
1600
  steps:
1392
1601
  - name: 🔽 Download artifact
1393
1602
  uses: actions/download-artifact@v8
@@ -62,9 +62,48 @@ def test_workflows_ci_versions(
62
62
  ).read_text() == snapshot
63
63
 
64
64
 
65
- def test_workflows_release(
65
+ def test_workflows_audit(
66
+ render_template: Callable[..., Path], snapshot: SnapshotAssertion
67
+ ) -> None:
68
+ rendered = render_template(
69
+ project_type="application", project_visibility="public"
70
+ )
71
+ assert (
72
+ rendered / ".github" / "workflows" / "audit.yaml"
73
+ ).read_text() == snapshot
74
+
75
+
76
+ def test_workflows_docs(
77
+ render_template: Callable[..., Path], snapshot: SnapshotAssertion
78
+ ) -> None:
79
+ rendered = render_template(
80
+ project_type="application",
81
+ project_visibility="public",
82
+ enable_docs=True,
83
+ )
84
+ assert (
85
+ rendered / ".github" / "workflows" / "docs.yaml"
86
+ ).read_text() == snapshot
87
+
88
+
89
+ @pytest.mark.parametrize("workflow", ["container", "ghcr"])
90
+ def test_workflows_container(
66
91
  render_template: Callable[..., Path],
67
92
  snapshot: SnapshotAssertion,
93
+ workflow: str,
94
+ ) -> None:
95
+ rendered = render_template(
96
+ project_type="application",
97
+ project_visibility="public",
98
+ enable_container=True,
99
+ )
100
+ assert (
101
+ rendered / ".github" / "workflows" / f"{workflow}.yaml"
102
+ ).read_text() == snapshot
103
+
104
+
105
+ def test_workflows_release(
106
+ render_template: Callable[..., Path], snapshot: SnapshotAssertion
68
107
  ) -> None:
69
108
  rendered = render_template(
70
109
  project_type="application",
@@ -282,9 +282,8 @@ def test_main_update_error(
282
282
  create_project(vcs_ref=start_ref, postcreate=_postcreate)
283
283
  commit_message = os.linesep.join(
284
284
  (
285
- "Apply template updates",
285
+ f"Apply template updates from {start_ref} to {end_ref}",
286
286
  "",
287
- (f"Applied updates from template: {start_ref}...{end_ref}"),
288
287
  (
289
288
  f"https://github.com/smkent/copier-python/compare/"
290
289
  f"{start_ref}...{end_ref}"
@@ -385,9 +384,8 @@ def test_main_update_with_project(
385
384
  create_project(vcs_ref=start_ref, project_visibility=project_visibility)
386
385
  commit_message = os.linesep.join(
387
386
  (
388
- "Apply template updates",
387
+ f"Apply template updates from {start_ref} to {end_ref}",
389
388
  "",
390
- (f"Applied updates from template: {start_ref}...{end_ref}"),
391
389
  (
392
390
  f"https://github.com/smkent/copier-python/compare/"
393
391
  f"{start_ref}...{end_ref}"
File without changes
File without changes
File without changes