File tree 9 files changed +1032
-280
lines changed
9 files changed +1032
-280
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 7
7
- " examples/**.yml"
8
8
- " src/**"
9
9
- " copier.yml"
10
+ workflow_call :
10
11
workflow_dispatch :
11
12
12
13
concurrency :
13
- group : ${{ github.workflow }} -${{ github.head_ref }}
14
+ group : examples -${{ github.head_ref }}
14
15
cancel-in-progress : true
15
16
16
17
env :
17
18
PYTHONUNBUFFERED : " 1"
18
19
FORCE_COLOR : " 1"
19
20
20
21
jobs :
21
- examples :
22
+ generate :
22
23
runs-on : ubuntu-latest
23
24
steps :
24
25
- uses : actions/checkout@v4
25
26
26
27
- uses : extractions/setup-just@v2
27
28
28
- - uses : westerveltco/setup-ci-action@v0
29
+ - name : Install uv
30
+ uses : astral-sh/setup-uv@v3
29
31
with :
30
- python-version : " 3.8"
31
- python-requirements : requirements-dev.lock
32
- use-uv : true
32
+ enable-cache : true
33
+ version : " 0.4.x"
33
34
34
35
- name : Setup Git
35
36
run : |
40
41
run : |
41
42
just generate-examples
42
43
44
+ - name : Upload examples artifact
45
+ if : github.event_name != 'pull_request'
46
+ uses : actions/upload-artifact@v4
47
+ with :
48
+ name : generated-examples
49
+ path : examples/
50
+
51
+ update-repo :
52
+ needs : generate
53
+ if : github.event_name != 'pull_request'
54
+ runs-on : ubuntu-latest
55
+ steps :
56
+ - uses : actions/checkout@v4
57
+
58
+ - name : Download examples artifact
59
+ uses : actions/download-artifact@v4
60
+ with :
61
+ name : generated-examples
62
+ path : examples/
63
+
64
+ - name : Setup Git
65
+ run : |
66
+ git config --global user.name "GitHub Actions"
67
+ git config --global user.email "[email protected] "
68
+
43
69
- name : Get SHA of push commit
44
70
id : shortsha
45
71
run : echo "shortsha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
Original file line number Diff line number Diff line change 6
6
pull_request :
7
7
8
8
concurrency :
9
- group : ${{ github.workflow }} -${{ github.head_ref }}
9
+ group : test -${{ github.head_ref }}
10
10
cancel-in-progress : true
11
11
12
12
env :
@@ -19,34 +19,15 @@ jobs:
19
19
steps :
20
20
- uses : actions/checkout@v4
21
21
22
- - uses : westerveltco/setup-ci-action@v0
22
+ - name : Install uv
23
+ uses : astral-sh/setup-uv@v3
23
24
with :
24
- python-version : " 3.8"
25
- python-requirements : requirements-dev.lock
26
- use-uv : true
25
+ enable-cache : true
26
+ version : " 0.4.x"
27
27
28
28
- name : Run tests
29
29
run : |
30
- python -m pytest
30
+ uv run pytest
31
31
32
32
examples :
33
- runs-on : ubuntu-latest
34
- steps :
35
- - uses : actions/checkout@v4
36
-
37
- - uses : extractions/setup-just@v2
38
-
39
- - uses : westerveltco/setup-ci-action@v0
40
- with :
41
- python-version : " 3.8"
42
- python-requirements : requirements-dev.lock
43
- use-uv : true
44
-
45
- - name : Setup Git
46
- run : |
47
- git config --global user.name "GitHub Actions"
48
- git config --global user.email "[email protected] "
49
-
50
- - name : Generate examples
51
- run : |
52
- just generate-examples
33
+ uses : ./.github/workflows/examples.yml
Original file line number Diff line number Diff line change 1
1
set dotenv-load := true
2
+ set unstable := true
2
3
3
- @_ default :
4
- just --list
4
+ [private ]
5
+ default :
6
+ @ just --list
5
7
6
- bootstrap * ARGS :
7
- rye sync {{ ARGS }}
8
-
9
- lock * ARGS :
10
- rye lock {{ ARGS }}
11
-
12
- # ----------------------------------------------------------------------
13
- # EXAMPLES
14
- # ----------------------------------------------------------------------
15
-
16
- # generate all examples from examples/*.yml copier answer files
17
- @ generate-examples :
18
- for file in ` ls examples/* .yml ` ; do \
19
- just _generate-example $file; \
20
- done
8
+ [private ]
9
+ fmt :
10
+ @ just --fmt
21
11
22
- _ generate-example DATA_FILE :
12
+ [private ]
13
+ @ generate-example DATA_FILE :
23
14
#!/usr/bin/env bash
24
15
25
16
set -euo pipefail
26
17
27
18
DIRECTORY=" {{ trim_end_match (DATA_FILE, ' .yml' ) }} "
28
19
rm -rf $DIRECTORY
29
20
30
- COMMAND=" copier copy -r HEAD . $DIRECTORY --force --trust --data-file {{ DATA_FILE }} "
31
- if [ -z " $(command -v rye)" ]; then
32
- eval $COMMAND
33
- else
34
- rye run $COMMAND
35
- fi
21
+ uv run copier copy -r HEAD . $DIRECTORY --force --trust --data-file {{ DATA_FILE }}
36
22
37
- # ----------------------------------------------------------------------
38
- # UTILS
39
- # ----------------------------------------------------------------------
23
+ bootstrap :
24
+ uv python install
25
+ uv sync --frozen
40
26
41
- # format justfile
42
- fmt :
43
- just --fmt --unstable
27
+ generate-examples :
28
+ for file in ` ls examples/* .yml ` ; do \
29
+ just generate-example $file; \
30
+ done
44
31
45
- # run pre-commit on all files
46
32
lint :
47
- rye run pre-commit run --all-files
33
+ uv run --with pre-commit-uv pre-commit run --all-files
34
+
35
+ lock * ARGS :
36
+ uv lock {{ ARGS }}
Original file line number Diff line number Diff line change 1
1
# django-twc-package
2
2
3
- [ ![ Rye] ( https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/mitsuhiko/rye/main/artwork/badge.json )] ( https://rye-up.com )
4
3
[ ![ Copier] ( https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/joshuadavidthomas/7c88611504b557ff7aa2a7524ad996e2/raw/4ba6834953dd8a14afc3dbb7bb41f49f181a59bf/badge.json )] ( https://copier.readthedocs.io )
5
4
6
5
` django-twc-package ` is the template for a Django package at The Westervelt Company. This template is a starting point for creating a new Django package that can be installed and used in other projects.
Original file line number Diff line number Diff line change 1
- [build-system ]
2
- build-backend = " hatchling.build"
3
- requires = [" hatchling" ]
4
-
5
1
[project ]
6
2
authors = [{
name =
" Josh" ,
email =
" [email protected] " }]
7
- dependencies = [" copier>=9.1.1" , " copier-templates-extensions>=0.3.0" ]
3
+ dependencies = [
4
+ " copier>=9.1.1" ,
5
+ " copier-templates-extensions>=0.3.0"
6
+ ]
8
7
description = " A Django package template for The Westervelt Company."
9
8
dynamic = [" version" ]
10
9
license = {file = " LICENSE" }
@@ -25,13 +24,6 @@ version_pattern = "YYYY.INC1"
25
24
"copier.yml" = [' default: "{version}"' ]
26
25
"tests/test_version.py" = [' assert version == "{version}"' ]
27
26
28
- [tool .hatch .metadata ]
29
- allow-direct-references = true
30
-
31
- [tool .hatch .version ]
32
- path = " VERSION"
33
- pattern = " ^(?P<version>[0-9]+(?:\\ .[0-9]+)*)$"
34
-
35
27
[tool .pytest .ini_options ]
36
28
addopts = " -n auto --dist loadfile --doctest-modules"
37
29
norecursedirs = " .* bin build dist *.egg examples htmlcov logs node_modules src templates venv"
@@ -103,7 +95,7 @@ required-imports = ["from __future__ import annotations"]
103
95
# Preserve types, even if a file imports `from __future__ import annotations`.
104
96
keep-runtime-typing = true
105
97
106
- [tool .rye ]
98
+ [tool .uv ]
107
99
dev-dependencies = [
108
100
" bumpver>=2023.1129" ,
109
101
" djlint>=1.34.1" ,
@@ -115,5 +107,3 @@ dev-dependencies = [
115
107
" jinja2>=3.1.3" ,
116
108
" pre-commit>=3.5.0"
117
109
]
118
- managed = true
119
- virtual = true
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments