Skip to content

Commit 32d9945

Browse files
authored
Merge pull request #28 from python-project-templates/tkp/docs
update gitignore and hatch for check manifest exclusions
2 parents 325b8b8 + 76f02d5 commit 32d9945

6 files changed

Lines changed: 74 additions & 12 deletions

File tree

.github/workflows/build.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,30 @@ jobs:
2222
build:
2323
strategy:
2424
matrix:
25-
template: ["python", "cpp", "js", "jupyter", "rust"]
25+
template:
26+
- python
27+
# - cpp
28+
- js
29+
- jupyter
30+
- rust
2631
runs-on: ubuntu-latest
2732
steps:
2833
- uses: actions/checkout@v4
2934
- uses: actions/setup-python@v5
3035
with:
3136
python-version: '3.11'
32-
cache: 'pip'
33-
cache-dependency-path: 'pyproject.toml'
3437
- run: pip install copier
35-
- run: make gen-${{matrix.template}}
38+
- uses: actions/setup-node@v4
39+
with:
40+
node-version: 20.x
41+
- uses: pnpm/action-setup@v4
42+
with:
43+
version: 9
44+
- name: Set up Rust
45+
uses: dtolnay/rust-toolchain@stable
46+
with:
47+
toolchain: stable
48+
components: clippy, rustfmt
49+
- run: |
50+
make gen-${{matrix.template}}
51+
make test-${{matrix.template}}

Makefile

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,33 +18,67 @@ SED = sed -i '' -e
1818
endif
1919

2020

21-
.PHONY: gen-python
21+
.PHONY: gen-python gen-cpp gen-js gen-jupyter gen-rust
2222
gen-python: ## regenerate the python template from scratch
2323
mkdir -p ../python-template && cd ../python-template && rm -rf ./* && rm -rf .copier-answers.yml .gitignore .github .gitattributes
2424
copier copy -w . ../python-template --data-file examples/python.yml
2525
cd ../python-template && $(SED) 's#_src_path: .#_src_path: https://github.com/python-project-templates/base.git#g' ./.copier-answers.yml
2626

27-
.PHONY: gen-cpp
2827
gen-cpp: ## regenerate the c++ template from scratch
2928
mkdir -p ../python-template-cpp && cd ../python-template-cpp && rm -rf ./* && rm -rf .copier-answers.yml .gitignore .github .gitattributes
3029
copier copy -w . ../python-template-cpp --data-file examples/cpp.yml
3130
cd ../python-template-cpp && $(SED) 's#_src_path: .#_src_path: https://github.com/python-project-templates/base.git#g' ./.copier-answers.yml
3231

33-
.PHONY: gen-js
3432
gen-js: ## regenerate the js template from scratch
3533
mkdir -p ../python-template-js && cd ../python-template-js && rm -rf ./* && rm -rf .copier-answers.yml .gitignore .github .gitattributes
3634
copier copy -w . ../python-template-js --data-file examples/js.yml
3735
cd ../python-template-js && $(SED) 's#_src_path: .#_src_path: https://github.com/python-project-templates/base.git#g' ./.copier-answers.yml
3836

39-
.PHONY: gen-jupyter
4037
gen-jupyter: ## regenerate the jupyter template from scratch
4138
mkdir -p ../python-template-jupyter && cd ../python-template-jupyter && rm -rf ./* && rm -rf .copier-answers.yml .gitignore .github .gitattributes
4239
copier copy -w . ../python-template-jupyter --data-file examples/jupyter.yml
4340
cd ../python-template-jupyter && $(SED) 's#_src_path: .#_src_path: https://github.com/python-project-templates/base.git#g' ./.copier-answers.yml
4441

45-
.PHONY: gen-rust
4642
gen-rust: ## regenerate the rust template from scratch
4743
mkdir -p ../python-template-rust && cd ../python-template-rust && rm -rf ./* && rm -rf .copier-answers.yml .gitignore .github .gitattributes
4844
copier copy -w . ../python-template-rust --data-file examples/rust.yml
4945
cd ../python-template-rust && $(SED) 's#_src_path: .#_src_path: https://github.com/python-project-templates/base.git#g' ./.copier-answers.yml
5046

47+
.PHONY: test-python test-cpp test-js test-jupyter test-rust
48+
test-python:
49+
cd ../python-template && git config --global user.name "github-actions" && git config --global user.email "41898282+github-actions[bot]@users.noreply.github.c@example.com" && git init && git add . && git commit -m "initial commit"
50+
cd ../python-template && make develop
51+
cd ../python-template && make lint
52+
cd ../python-template && make checks
53+
cd ../python-template && make test
54+
55+
test-cpp:
56+
cd ../python-template-cpp && git config --global user.name "github-actions" && git config --global user.email "41898282+github-actions[bot]@users.noreply.github.c@example.com" && git init && git add . && git commit -m "initial commit"
57+
cd ../python-template-cpp && git init && git add . && git commit -m "initial commit"
58+
cd ../python-template-cpp && make develop
59+
cd ../python-template-cpp && make lint
60+
cd ../python-template-cpp && make checks
61+
cd ../python-template-cpp && make test
62+
63+
test-js:
64+
cd ../python-template-js && git config --global user.name "github-actions" && git config --global user.email "41898282+github-actions[bot]@users.noreply.github.c@example.com" && git init && git add . && git commit -m "initial commit"
65+
cd ../python-template-js && make develop
66+
cd ../python-template-js && make lint
67+
cd ../python-template-js && make checks
68+
cd ../python-template-js && make test
69+
70+
test-jupyter:
71+
cd ../python-template-jupyter && git config --global user.name "github-actions" && git config --global user.email "41898282+github-actions[bot]@users.noreply.github.c@example.com" && git init && git add . && git commit -m "initial commit"
72+
cd ../python-template-jupyter && make develop
73+
cd ../python-template-jupyter && make lint
74+
cd ../python-template-jupyter && make checks
75+
cd ../python-template-jupyter && make test
76+
77+
test-rust:
78+
cd ../python-template-rust && git config --global user.name "github-actions" && git config --global user.email "41898282+github-actions[bot]@users.noreply.github.c@example.com" && git init && git add . && git commit -m "initial commit"
79+
cd ../python-template-rust && make develop
80+
cd ../python-template-rust && git add Cargo.lock && git commit -m "lockfile"
81+
cd ../python-template-rust && make lint
82+
cd ../python-template-rust && make checks
83+
cd ../python-template-rust && make test
84+

js/pyproject.toml.jinja

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ ignore = [
7474
"js/pnpm-lock.yaml",
7575
"Makefile",
7676
"setup.py",
77-
"{{module}}/**/*",
77+
"{{module}}/extension/**/*",
78+
"docs/**/*",
79+
"js/dist/**/*",
7880
]
7981

8082
[tool.coverage.run]
@@ -111,6 +113,7 @@ exclude = [
111113
"/.github",
112114
"/.gitattributes",
113115
"/.gitignore",
116+
"/docs",
114117
"/js/node_modules",
115118
]
116119

@@ -123,8 +126,9 @@ exclude = [
123126
"/.github",
124127
"/.gitattributes",
125128
"/.gitignore",
126-
"/js/node_modules",
127129
"/pyproject.toml",
130+
"/docs",
131+
"/js/node_modules",
128132
]
129133

130134
[tool.hatch.build.hooks.jupyter-builder]

jupyter/pyproject.toml.jinja

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ ignore = [
7878
"setup.py",
7979
"{{module}}/labextension/**",
8080
"{{module}}/nbextension/**",
81+
"docs/**/*",
8182
]
8283
8384
[tool.coverage.run]
@@ -116,6 +117,7 @@ exclude = [
116117
"/.gitattributes",
117118
"/.gitignore",
118119
"/js/node_modules",
120+
"/docs",
119121
]
120122
121123
[tool.hatch.build.targets.wheel]
@@ -127,8 +129,9 @@ exclude = [
127129
"/.github",
128130
"/.gitattributes",
129131
"/.gitignore",
130-
"/js/node_modules",
131132
"/pyproject.toml",
133+
"/docs",
134+
"/js/node_modules",
132135
]
133136
134137
[tool.hatch.build.targets.wheel.shared-data]

python/pyproject.toml.jinja

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ ignore = [
6464
".copier-answers.yml",
6565
"Makefile",
6666
"setup.py",
67+
"docs/**/*",
6768
]
6869

6970
[tool.coverage.run]
@@ -97,6 +98,7 @@ exclude = [
9798
"/.github",
9899
"/.gitattributes",
99100
"/.gitignore",
101+
"/docs",
100102
]
101103

102104
[tool.hatch.build.targets.wheel]
@@ -109,6 +111,7 @@ exclude = [
109111
"/.gitattributes",
110112
"/.gitignore",
111113
"/pyproject.toml",
114+
"/docs",
112115
]
113116

114117
[tool.hatch.build.targets.wheel.shared-data]

rust/pyproject.toml.jinja

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ ignore = [
7676
".copier-answers.yml",
7777
"Makefile",
7878
"setup.py",
79+
"docs/**/*",
80+
"rust/.config/*",
7981
"rust/Cargo.lock",
8082
"rust/README.md",
8183
]

0 commit comments

Comments
 (0)