Skip to content

Commit 627d77c

Browse files
committed
README: Minor updates to reflect package as part of project.
Also, Copier update to turn on package publication and data resources support.
1 parent 0ccd7b7 commit 627d77c

5 files changed

Lines changed: 130 additions & 14 deletions

File tree

.auxiliary/configuration/copier-answers.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ distribution_name: emcd-projects
99
enable_cli: true
1010
enable_executables: false
1111
enable_property_tests: false
12-
enable_publication: false
12+
enable_publication: true
1313
enable_rust_extension: false
1414
gh_owner: emcd
15-
include_data_resources: false
15+
include_data_resources: true
1616
inject_docstring_utils: false
1717
inject_exceptions: true
1818
inject_foundations: true

.github/workflows/releaser.yaml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,90 @@ jobs:
5454
with:
5555
artifacts-path: '.auxiliary/artifacts/hatch-build' # TODO: Use environment.
5656
python-version: '${{ fromJSON(needs.initialize.outputs.python-versions)[0] }}'
57+
58+
publish-pypi:
59+
if: ${{ inputs.which-pypi == 'testpypi' || startsWith(github.ref, 'refs/tags/') }}
60+
needs: [initialize, package]
61+
runs-on: ubuntu-latest
62+
environment:
63+
name: ${{ inputs.which-pypi || 'pypi' }}
64+
url: ${{ fromJSON(needs.initialize.outputs.pypi-package-urls)[inputs.which-pypi || 'pypi'] }}emcdproj
65+
permissions:
66+
id-token: write # Only needed for PyPI trusted publishing
67+
steps:
68+
69+
- name: Restore Distributions
70+
uses: actions/download-artifact@v4
71+
with:
72+
name: python-package-distributions--${{ github.run_id }}
73+
path: ${{ env.DISTRIBUTIONS_PATH }}
74+
75+
- name: Publish Distributions
76+
uses: pypa/gh-action-pypi-publish@release/v1
77+
with:
78+
packages-dir: ${{ env.DISTRIBUTIONS_PATH }}
79+
repository-url: ${{ fromJSON(needs.initialize.outputs.pypi-api-urls)[inputs.which-pypi || 'pypi'] }}
80+
print-hash: true
81+
skip-existing: ${{ inputs.which-pypi == 'testpypi' }}
82+
83+
publish-github:
84+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
85+
needs:
86+
- initialize
87+
- package
88+
- publish-pypi
89+
# --- BEGIN: Injected by Copier ---
90+
# --- END: Injected by Copier ---
91+
runs-on: ubuntu-latest
92+
permissions:
93+
contents: write
94+
id-token: write
95+
steps:
96+
97+
- name: Prepare Python
98+
uses: emcd/python-project-common/.github/actions/python-hatch@v1.13
99+
with:
100+
python-version: ${{ fromJSON(needs.initialize.outputs.python-versions)[0] }}
101+
102+
- name: Restore Distributions
103+
uses: actions/download-artifact@v4
104+
with:
105+
name: python-package-distributions--${{ github.run_id }}
106+
path: ${{ env.DISTRIBUTIONS_PATH }}
107+
108+
- name: Generate Integrity Check Values
109+
run: |
110+
set -eu -o pipefail
111+
cd ${{ env.DISTRIBUTIONS_PATH }}
112+
sha256sum emcd-projects-* >SHA256SUMS.txt
113+
114+
- name: Sign Distributions
115+
uses: sigstore/gh-action-sigstore-python@v3.0.0
116+
with:
117+
inputs: >-
118+
${{ env.DISTRIBUTIONS_PATH }}/SHA256SUMS.txt
119+
${{ env.DISTRIBUTIONS_PATH }}/emcd-projects-*
120+
121+
- name: Generate Release Notes
122+
run: |
123+
set -eu -o pipefail
124+
hatch --env develop run \
125+
towncrier build --draft --version ${GITHUB_REF_NAME} \
126+
>.auxiliary/artifacts/tc-release-notes.rst
127+
cp .auxiliary/artifacts/tc-release-notes.rst .auxiliary/artifacts/release-notes.rst
128+
129+
- name: Create Release
130+
env:
131+
GITHUB_TOKEN: ${{ github.token }}
132+
run: |
133+
gh release create '${{ github.ref_name }}' \
134+
--repo '${{ github.repository }}' \
135+
--notes-file .auxiliary/artifacts/release-notes.rst
136+
137+
- name: Publish Artifacts
138+
env:
139+
GITHUB_TOKEN: ${{ github.token }}
140+
run: |
141+
gh release upload '${{ github.ref_name }}' \
142+
${{ env.DISTRIBUTIONS_PATH }}/** \
143+
--repo '${{ github.repository }}'

README.rst

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@
2020
emcd-projects
2121
*******************************************************************************
2222

23+
.. image:: https://img.shields.io/pypi/v/emcd-projects
24+
:alt: Package Version
25+
:target: https://pypi.org/project/emcd-projects/
26+
27+
.. image:: https://img.shields.io/pypi/status/emcd-projects
28+
:alt: PyPI - Status
29+
:target: https://pypi.org/project/emcd-projects/
30+
2331
.. image:: https://github.com/emcd/python-project-common/actions/workflows/tester.yaml/badge.svg?branch=master&event=push
2432
:alt: Tests Status
2533
:target: https://github.com/emcd/python-project-common/actions/workflows/tester.yaml
@@ -32,26 +40,34 @@
3240
:alt: Project License
3341
:target: https://github.com/emcd/python-project-common/blob/master/LICENSE.txt
3442

35-
🛠️A collection of reusable GitHub Actions workflows and a Copier template for
43+
.. image:: https://img.shields.io/pypi/pyversions/emcd-projects
44+
:alt: Python Versions
45+
:target: https://pypi.org/project/emcd-projects/
46+
47+
🛠️ A collection of reusable GitHub Actions workflows and Copier template for
3648
Python projects. Provides standardized CI/CD pipelines and project structure
3749
with optional Rust extension support.
3850

3951
Features
4052
===============================================================================
4153

42-
📦 **Project Template**
43-
- Modern Python packaging setup using Hatch
44-
- Sphinx documentation framework
45-
- Quality assurance tools configuration
46-
- Optional Rust extension support via PyO3/Maturin
47-
- Optional standalone executable via PyInstaller
48-
- Property-based testing support (Hypothesis/proptest)
54+
🖨️ **Project Template**
55+
- Python environment management and packaging via Hatch.
56+
- Sphinx documentation framework.
57+
- Quality assurance tools configuration.
58+
- Optional Rust extension support via PyO3/Maturin.
59+
- Optional standalone executable via PyInstaller.
60+
- Property-based testing support (Hypothesis/proptest).
4961

5062
🔄 **Reusable GitHub Workflows**
51-
- Testing across multiple Python versions and platforms
52-
- Documentation generation and publication
53-
- Package building and publication
54-
- Code quality reporting
63+
- Testing across multiple Python versions and platforms.
64+
- Documentation generation and publication.
65+
- Package building and publication.
66+
- Code quality reporting.
67+
68+
📦 **Project Maintenance Utilities**
69+
- Maintain static site for project documentation and coverage reports. No
70+
need to hook up ReadTheDocs, Codecov, etc....
5571

5672
`More Flair <https://www.imdb.com/title/tt0151804/characters/nm0431918>`_
5773
===============================================================================
@@ -87,3 +103,11 @@ Features
87103
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
88104
:alt: Ruff
89105
:target: https://github.com/astral-sh/ruff
106+
107+
.. image:: https://img.shields.io/pypi/implementation/emcd-projects
108+
:alt: PyPI - Implementation
109+
:target: https://pypi.org/project/emcd-projects/
110+
111+
.. image:: https://img.shields.io/pypi/wheel/emcd-projects
112+
:alt: PyPI - Wheel
113+
:target: https://pypi.org/project/emcd-projects/

data/.gitignore

Whitespace-only changes.

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ email = 'emcd@users.noreply.github.com'
5353
emcdproj = 'emcdproj:main'
5454
[project.urls]
5555
'Homepage' = 'https://github.com/emcd/python-project-common'
56+
'Documentation' = 'https://emcd.github.io/python-project-common'
57+
'Download' = 'https://pypi.org/project/emcd-projects/#files'
5658
'Source Code' = 'https://github.com/emcd/python-project-common'
5759
'Issue Tracker' = 'https://github.com/emcd/python-project-common/issues'
5860

@@ -81,19 +83,22 @@ directory = '.auxiliary/artifacts/hatch-build'
8183
only-include = [
8284
'sources/emcdproj',
8385
# --- BEGIN: Injected by Copier ---
86+
'data',
8487
# --- END: Injected by Copier ---
8588
]
8689
strict-naming = false
8790
[tool.hatch.build.targets.wheel]
8891
only-include = [
8992
'sources/emcdproj',
9093
# --- BEGIN: Injected by Copier ---
94+
'data',
9195
# --- END: Injected by Copier ---
9296
]
9397
strict-naming = false
9498
[tool.hatch.build.targets.wheel.sources]
9599
'sources/emcdproj' = 'emcdproj'
96100
# --- BEGIN: Injected by Copier ---
101+
'data' = 'emcdproj/data'
97102
# --- END: Injected by Copier ---
98103
[tool.hatch.envs.default]
99104
python = '3.10'

0 commit comments

Comments
 (0)