Skip to content

Commit 592da44

Browse files
authored
use my UV repo template (#12)
* use template * remove docs * add 3.9 * fix lint * fix python req * remove docs more * py 3.10 min req * more docs removal * add entrypoint back * lint * add year
1 parent 70410ba commit 592da44

File tree

23 files changed

+3204
-283
lines changed

23 files changed

+3204
-283
lines changed

.copier-answers.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2+
_commit: v2025.02.0
3+
_src_path: https://github.com/rmorshea/python-copier-template
4+
author_email: ryan.morshead@gmail.com
5+
author_name: Ryan Morshead
6+
project_description: A Hatch plugin for creating build scripts.
7+
project_title: Hatch Build Scripts
8+
python_package_name: hatch_build_scripts
9+
python_version_range: '>=3.9'
10+
repo_url: https://github.com/rmorshea/hatch-build-scripts

.github/FUNDING.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
blank_issues_enabled: false
23
contact_links:
34
- name: Start a Discussion
Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1+
---
12
name: Plan a Task
23
description: Create a detailed plan of action (ONLY START AFTER DISCUSSION PLEASE 🙏).
3-
labels: ["flag-triage"]
4+
labels: [flag-triage]
45
body:
5-
- type: textarea
6-
attributes:
7-
label: Current Situation
8-
description: Discuss how things currently are, why they require action, and any relevant prior discussion/context.
9-
validations:
10-
required: false
11-
- type: textarea
12-
attributes:
13-
label: Proposed Actions
14-
description: Describe what ought to be done, and why that will address the reasons for action mentioned above.
15-
validations:
16-
required: false
6+
- type: textarea
7+
attributes:
8+
label: Current Situation
9+
description: Discuss how things currently are, why they require action, and any relevant prior discussion/context.
10+
validations:
11+
required: false
12+
- type: textarea
13+
attributes:
14+
label: Proposed Actions
15+
description: Describe what ought to be done, and why that will address the reasons for action mentioned
16+
above.
17+
validations:
18+
required: false

.github/pull_request_template.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/workflows/.hatch-run.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

.github/workflows/check.yml

Lines changed: 98 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,103 @@
1+
---
12
name: check
2-
33
on:
44
push:
5-
branches:
6-
- main
5+
branches: [main]
76
pull_request:
8-
branches:
9-
- main
10-
schedule:
11-
- cron: "0 0 * * 0"
12-
7+
branches: [main]
8+
env:
9+
latest-python-version: 3.13
1310
jobs:
14-
lint:
15-
uses: ./.github/workflows/.hatch-run.yml
16-
with:
17-
job-name: "python-{0}"
18-
hatch-run: "lint:all"
19-
test-matrix:
20-
uses: ./.github/workflows/.hatch-run.yml
21-
with:
22-
job-name: "python-{0} {1}"
23-
hatch-run: "test"
24-
runs-on-array: '["ubuntu-latest", "macos-latest", "windows-latest"]'
25-
python-version-array: '["3.9", "3.10", "3.11"]'
11+
py-tests:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
python-version: ['3.10', '3.11', '3.12', '3.13']
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: UV cache
19+
uses: actions/cache@v4
20+
with:
21+
path: ~/.cache/uv
22+
key: ${{ runner.os }}-${{ matrix.python-version }}-uv-${{ hashFiles('pyproject.toml') }}
23+
- name: Install UV
24+
uses: astral-sh/setup-uv@v5
25+
with:
26+
version: latest
27+
python-version: ${{ matrix.python-version }}
28+
enable-cache: true
29+
cache-dependency-glob: '**/pyproject.toml'
30+
- name: Run tests
31+
run: uv run dev.py cov
32+
- name: Upload coverage
33+
if: matrix.python-version == env.latest-python-version
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: coverage-xml
37+
include-hidden-files: true
38+
path: |
39+
${{ github.workspace }}/coverage.xml
40+
${{ github.workspace }}/.coverage
41+
if-no-files-found: error
42+
py-coverage:
43+
runs-on: ubuntu-latest
44+
needs: py-tests
45+
if: github.ref != format('refs/heads/{0}', github.event.repository.default_branch)
46+
steps:
47+
- uses: actions/checkout@v4
48+
with: {fetch-depth: 50}
49+
- name: Download new coverage
50+
uses: actions/download-artifact@v4
51+
with:
52+
name: coverage-xml
53+
path: ${{ github.workspace }}
54+
- name: Download old coverage
55+
uses: dawidd6/action-download-artifact@v6
56+
with:
57+
branch: ${{ github.event.pull_request.base.ref }}
58+
name: coverage-xml
59+
path: ${{ github.workspace }}/old-coverage
60+
- name: UV cache
61+
uses: actions/cache@v4
62+
with:
63+
path: ~/.cache/uv
64+
key: ${{ runner.os }}-${{ env.latest-python-version }}-uv-${{ hashFiles('pyproject.toml') }}
65+
- run: git fetch origin main
66+
- name: Install UV
67+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
68+
- name: Install Python
69+
run: uv python install ${{ matrix.python-version }}
70+
- name: Check coverage
71+
run: uv run dev.py cov --no-test --old-coverage-xml=${{ github.workspace }}/old-coverage/coverage.xml
72+
- name: Coverage summary
73+
run: uv run coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
74+
py-lint:
75+
runs-on: ubuntu-latest
76+
steps:
77+
- uses: actions/checkout@v4
78+
- name: UV cache
79+
uses: actions/cache@v4
80+
with:
81+
path: ~/.cache/uv
82+
key: ${{ runner.os }}-${{ env.latest-python-version }}-uv-${{ hashFiles('pyproject.toml') }}
83+
- name: Install UV
84+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
85+
- name: Install Python
86+
run: uv python install ${{ matrix.python-version }}
87+
- name: Check lint
88+
run: uv run dev.py lint --check
89+
py-build:
90+
runs-on: ubuntu-latest
91+
steps:
92+
- uses: actions/checkout@v4
93+
- name: UV cache
94+
uses: actions/cache@v4
95+
with:
96+
path: ~/.cache/uv
97+
key: ${{ runner.os }}-${{ env.latest-python-version }}-uv-${{ hashFiles('pyproject.toml') }}
98+
- name: Install UV
99+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
100+
- name: Install Python
101+
run: uv python install ${{ matrix.python-version }}
102+
- name: Check lint
103+
run: uv build

.github/workflows/publish.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: release
3+
on:
4+
release:
5+
types: [published]
6+
env:
7+
latest-python-version: 3.13
8+
jobs:
9+
py-package:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: UV cache
14+
uses: actions/cache@v4
15+
with:
16+
path: ~/.cache/uv
17+
key: ${{ runner.os }}-${{ env.latest-python-version }}-uv-${{ hashFiles('pyproject.toml') }}
18+
- name: Install UV
19+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
20+
- name: Install Python
21+
run: uv python install ${{ matrix.python-version }}
22+
- name: Build package
23+
run: uv build
24+
- name: Publish package
25+
env:
26+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
27+
run: uv publish

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,10 @@ ipython_config.py
106106
#pdm.lock
107107
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108108
# in version control.
109-
# https://pdm.fming.dev/#use-with-ide
109+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
110110
.pdm.toml
111+
.pdm-python
112+
.pdm-build/
111113

112114
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113115
__pypackages__/

0 commit comments

Comments
 (0)