Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
37b10b4
Rename Library project to NuGetLibrary
ptr727 May 3, 2026
5243352
Add devcontainer + per-OS host and SSH signing docs
ptr727 May 3, 2026
5155075
Add PyPiLibrary Python sibling project
ptr727 May 3, 2026
410f174
Address Copilot review on PR #63
ptr727 May 3, 2026
aa0a1e7
Drop USERPROFILE concat from devcontainer mount sources
ptr727 May 3, 2026
0334729
Address Copilot review on PR #64
ptr727 May 3, 2026
2e9dbb4
Restore HOME/USERPROFILE fallback for devcontainer mount sources
ptr727 May 3, 2026
4c939f6
Move PyPi publish job out of reusable workflow chain
ptr727 May 3, 2026
43d2bbf
Merge remote-tracking branch 'origin/develop' into pypilibrary
ptr727 May 3, 2026
6b95dd4
Address Copilot review on PR #63
ptr727 May 3, 2026
6dbe5ba
Address Copilot review on PR #64
ptr727 May 3, 2026
e2626a2
Drop hard-coded ruff and Python interpreter paths from workspace
ptr727 May 3, 2026
07a101a
Enforce uv version pin even when uv is already installed
ptr727 May 3, 2026
692f27e
Make publish-pypi permissions explicit for download-artifact
ptr727 May 3, 2026
b0cfcb1
Merge remote-tracking branch 'origin/develop' into pypilibrary
ptr727 May 3, 2026
ba24ee0
Address Copilot review on PR #63 (post-merge round)
ptr727 May 3, 2026
dd7073d
Drop ms-pyright.pyright; mark mypy/pylint/black/etc as unwanted
ptr727 May 3, 2026
a1092d2
Drop ms-pyright.pyright from devcontainer extension list
ptr727 May 3, 2026
6067aa3
Pin uv in CI; skip-existing on PyPI publish; document version scheme
ptr727 May 3, 2026
a1b4d4b
Restructure agent docs for polyglot template; add review runbook
ptr727 May 3, 2026
6ee7ccb
Merge remote-tracking branch 'origin/develop' into pypilibrary
ptr727 May 3, 2026
b77a936
Address Copilot review on PR #64
ptr727 May 3, 2026
176bb4d
Use official PyPI capitalization in prose; consistent plural
ptr727 May 3, 2026
89c7f0a
Tighten workflow naming conventions; fix one step name deviation
ptr727 May 3, 2026
22db3bc
Fix dependabot.yml path in deletion checklists
ptr727 May 3, 2026
e76aab0
Bump default Python target to 3.14; fix pyright per-path strict config
ptr727 May 3, 2026
ab57f01
Add PEP 561 py.typed; alphabetize README defs; canonical PyPI URL
ptr727 May 3, 2026
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
519 changes: 139 additions & 380 deletions .github/copilot-instructions.md

Large diffs are not rendered by default.

56 changes: 33 additions & 23 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:

# main
- package-ecosystem: "nuget"
target-branch: "main"
directory: "/"
schedule:
interval: "daily"
groups:
nuget-deps:
patterns:
- "*"
- package-ecosystem: "github-actions"
target-branch: "main"
directory: "/"
schedule:
interval: "daily"
groups:
actions-deps:
patterns:
- "*"
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:

- package-ecosystem: "nuget"
target-branch: "main"
directory: "/"
schedule:
interval: "daily"
groups:
nuget-deps:
patterns:
- "*"

- package-ecosystem: "github-actions"
target-branch: "main"
directory: "/"
schedule:
interval: "daily"
groups:
actions-deps:
patterns:
- "*"

- package-ecosystem: "uv"
target-branch: "main"
directory: "/PyPiLibrary"
schedule:
interval: "daily"
groups:
pypi-deps:
patterns:
- "*"
71 changes: 71 additions & 0 deletions .github/workflows/build-pypilibrary-task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Build PyPI library task

# This reusable workflow only builds the PyPI library and uploads the
# wheel + sdist as a workflow-run artifact. It does NOT publish to PyPI.
# Publishing happens directly in `publish-release.yml` so that the
# `id-token: write` permission required by Trusted Publishing is granted
# at the entry-point job, not propagated through a reusable-workflow
# chain (which would require every caller — including `test-release-task.yml`
# during PR validation — to also grant id-token write, even when no
# publishing happens).

on:
workflow_call:
outputs:
artifact-name:
value: ${{ jobs.build-pypilibrary.outputs.artifact-name }}
artifact-id:
value: ${{ jobs.build-pypilibrary.outputs.artifact-id }}

jobs:

build-pypilibrary:
name: Build PyPI library project job
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./PyPiLibrary
outputs:
artifact-name: pypilibrary-build
artifact-id: ${{ steps.artifact-upload-step.outputs.artifact-id }}

steps:

- name: Checkout code step
uses: actions/checkout@v6

- name: Setup uv step
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
Comment thread
ptr727 marked this conversation as resolved.
# Pin uv to the same version as `.devcontainer/post-create.sh`
# (UV_VERSION) so CI and local devcontainer behavior cannot drift
# — same uv resolves the same lockfile the same way. Bump in lock-
# step with the devcontainer pin.
version: "0.11.8"
enable-cache: true
cache-dependency-glob: "PyPiLibrary/uv.lock"

- name: Sync dependencies step
run: uv sync --all-groups --frozen

- name: Lint with ruff step
run: uv run ruff check

- name: Verify formatting with ruff step
run: uv run ruff format --check

- name: Type check with pyright step
run: uv run pyright

- name: Run pytest step
run: uv run pytest

- name: Build sdist and wheel step
run: uv build

- name: Upload build artifacts step
id: artifact-upload-step
uses: actions/upload-artifact@v6
with:
name: pypilibrary-build
path: PyPiLibrary/dist/*
11 changes: 10 additions & 1 deletion .github/workflows/build-release-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ jobs:
# Conditional push to NuGet.org
push: ${{ inputs.nuget }}

# PyPI publishing happens in `publish-release.yml`, not here, so that
# `id-token: write` only needs to be granted at the entry-point job.
# This reusable workflow just builds and uploads the artifact; the
# publish-release workflow downloads it by name in a sibling job.
build-pypilibrary:
name: Build PyPI library job
uses: ./.github/workflows/build-pypilibrary-task.yml
secrets: inherit

build-executable:
name: Build executable job
uses: ./.github/workflows/build-executable-task.yml
Expand All @@ -51,7 +60,7 @@ jobs:
name: Publish GitHub release job
if: ${{ inputs.github }}
runs-on: ubuntu-latest
needs: [get-version, build-nugetlibrary, build-executable, build-docker]
needs: [get-version, build-nugetlibrary, build-pypilibrary, build-executable, build-docker]

steps:

Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,47 @@ jobs:
nuget: true
dockerhub: true

publish-pypi:
name: Publish PyPI library job
needs: [create-release]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/ptr727-projecttemplate-library/
# When a `permissions:` block is present, every scope not listed
# collapses to `none`. The job needs three things explicitly:
# - `id-token: write` for Trusted Publishing's OIDC exchange
# (pypa/gh-action-pypi-publish swaps the token for a short-lived
# PyPI upload token; no PYPI_API_TOKEN secret involved).
# - `contents: read` so `actions/checkout`-style operations and any
# repo metadata reads continue to work.
# - `actions: read` so `actions/download-artifact` can list and
# fetch the artifact uploaded by the build workflow earlier in
# the same run.
permissions:
id-token: write
contents: read
actions: read

steps:

- name: Download PyPI library build artifacts step
uses: actions/download-artifact@v7
with:
name: pypilibrary-build
path: ./dist
Comment thread
ptr727 marked this conversation as resolved.

- name: Publish to PyPI step
uses: pypa/gh-action-pypi-publish@6733eb7d741f0b11ec6a39b58540dab7590f9b7d # v1.14.0
with:
packages-dir: ./dist
Comment thread
ptr727 marked this conversation as resolved.
# Skip rather than fail when the version already exists on PyPI.
# The template ships with `__version__ = "0.0.0"` as a placeholder
# — the release-on-every-push model would otherwise re-upload the
# same version and fail the workflow until the adopter wires a
# real version scheme (see PyPiLibrary/README.md).
skip-existing: true

date-badge:
name: Create BYOB date badge job
needs: [create-release]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
[ test-release ]
if: always()
steps:
- name: Check workflow results
- name: Check workflow results step
run: |
exit_on_result() {
if [[ "$2" == "failure" || "$2" == "cancelled" ]]; then
Expand Down
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,13 @@
.artifacts
.DS_Store
*.user

# Python / uv
__pycache__/
*.py[cod]
*.egg-info/
.venv/
dist/
.pytest_cache/
.ruff_cache/
.pyright/
26 changes: 26 additions & 0 deletions .husky/task-runner.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,32 @@
"include": [
"**/*.cs"
]
},
{
"name": "Ruff Format",
"command": "bash",
"args": [
"-c",
"command -v uv >/dev/null 2>&1 || { echo 'uv not on PATH; skipping ruff format' >&2; exit 0; }; exec uv run --project PyPiLibrary ruff format \"$@\"",
"--",
"${staged}"
],
Comment thread
ptr727 marked this conversation as resolved.
"include": [
"PyPiLibrary/**/*.py"
]
Comment thread
ptr727 marked this conversation as resolved.
},
{
"name": "Ruff Check",
"command": "bash",
"args": [
"-c",
"command -v uv >/dev/null 2>&1 || { echo 'uv not on PATH; skipping ruff check' >&2; exit 0; }; exec uv run --project PyPiLibrary ruff check \"$@\"",
"--",
"${staged}"
],
Comment thread
ptr727 marked this conversation as resolved.
"include": [
"PyPiLibrary/**/*.py"
]
Comment thread
ptr727 marked this conversation as resolved.
}
]
}
Loading
Loading