Skip to content

Commit 553f603

Browse files
authored
Merge pull request #24 from pyfar/new-cookiecutter
New cookiecutter
2 parents c0ba0a5 + 526ed64 commit 553f603

29 files changed

+674
-684
lines changed

.circleci/config.yml

Lines changed: 146 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,19 @@ jobs:
3434
executor:
3535
name: python-docker
3636
version: <<parameters.version>>
37-
3837
steps:
3938
- checkout
4039
# - run:
4140
# name: Install System Dependencies
4241
# command: sudo apt-get update && sudo apt-get install -y libsndfile1
43-
- python/install-packages:
44-
pkg-manager: pip
45-
# app-dir: ~/project/package-directory/ # If you're requirements.txt isn't in the root directory.
46-
pip-dependency-file: requirements_dev.txt
42+
- run:
43+
name: install dependencies
44+
command: pip install ".[tests]"
4745
- run:
4846
name: Run tests
4947
command: pytest
5048

51-
flake:
49+
ruff:
5250
parameters:
5351
version:
5452
description: "version tag"
@@ -57,41 +55,58 @@ jobs:
5755
executor:
5856
name: python-docker
5957
version: <<parameters.version>>
58+
steps:
59+
- checkout
60+
- run:
61+
name: install dependencies
62+
command: pip install ".[tests]"
63+
- run:
64+
name: Ruff
65+
command: ruff check
6066

67+
test_documentation_build:
68+
parameters:
69+
version:
70+
description: "version tag"
71+
default: "latest"
72+
type: string
73+
executor:
74+
name: python-docker
75+
version: <<parameters.version>>
6176
steps:
6277
- checkout
63-
- python/install-packages:
64-
pkg-manager: pip
65-
# app-dir: ~/project/package-directory/ # If you're requirements.txt isn't in the root directory.
66-
pip-dependency-file: requirements_dev.txt
78+
# - run:
79+
# name: Install System Dependencies
80+
# command: sudo apt-get update && sudo apt-get install -y libsndfile1 texlive-latex-extra dvipng
6781
- run:
68-
name: Flake8
69-
command: flake8 imkar
70-
71-
# test_examples:
72-
# parameters:
73-
# version:
74-
# description: "version tag"
75-
# default: "latest"
76-
# type: string
77-
# executor:
78-
# name: python-docker
79-
# version: <<parameters.version>>
80-
81-
# steps:
82-
# - checkout
83-
# # - run:
84-
# # name: Install System Dependencies
85-
# # command: sudo apt-get update && sudo apt-get install -y libsndfile1
86-
# - python/install-packages:
87-
# pkg-manager: pip
88-
# # app-dir: ~/project/package-directory/ # If you're requirements.txt isn't in the root directory.
89-
# pip-dependency-file: requirements_dev.txt
90-
# - run:
91-
# name: Examples
92-
# command: |
93-
# pip install -e .
94-
# pytest --nbmake examples/*.ipynb
82+
name: Sphinx
83+
command: |
84+
pip install ".[docs]"
85+
cd docs/
86+
make html SPHINXOPTS="-W"
87+
88+
test_deprecation_warnings:
89+
parameters:
90+
version:
91+
description: "version tag"
92+
default: "latest"
93+
type: string
94+
executor:
95+
name: python-docker
96+
version: <<parameters.version>>
97+
steps:
98+
- checkout
99+
# - run:
100+
# name: Install System Dependencies
101+
# command: sudo apt-get update && sudo apt-get install -y libsndfile1 texlive-latex-extra dvipng
102+
- run:
103+
name: install dependencies
104+
command: pip install ".[tests]"
105+
- run: |
106+
python --version
107+
- run:
108+
name: Run tests
109+
command: pytest tests -W error::DeprecationWarning
95110

96111
test_pypi_publish:
97112
parameters:
@@ -102,20 +117,42 @@ jobs:
102117
executor:
103118
name: python-docker
104119
version: <<parameters.version>>
120+
steps:
121+
- checkout
122+
# - run:
123+
# name: Install System Dependencies
124+
# command: sudo apt-get update && sudo apt-get install -y libsndfile1
125+
- run:
126+
name: install dependencies
127+
command: pip install ".[deploy]"
128+
- run:
129+
name: deploy
130+
command: | # create whl, install twine and publish to Test PyPI
131+
python -m build
132+
twine check dist/*
105133
134+
run_pypi_publish:
135+
parameters:
136+
version:
137+
description: "version tag"
138+
default: "latest"
139+
type: string
140+
executor:
141+
name: python-docker
142+
version: <<parameters.version>>
106143
steps:
107144
- checkout
108-
# - run:
109-
# name: Install System Dependencies
110-
# command: sudo apt-get update && sudo apt-get install -y libsndfile1
111-
- python/install-packages:
112-
pkg-manager: pip
113-
# app-dir: ~/project/package-directory/ # If you're requirements.txt isn't in the root directory.
114-
pip-dependency-file: requirements_dev.txt
145+
- run:
146+
name: Install System Dependencies
147+
command: sudo apt-get update && sudo apt-get install -y libsndfile1
148+
- run:
149+
name: install dependencies
150+
command: pip install ".[deploy]"
115151
- run:
116152
name: deploy
117153
command: | # create whl, install twine and publish to Test PyPI
118-
python setup.py sdist bdist_wheel
154+
python -m build
155+
twine check dist/*
119156
twine upload dist/*
120157
121158
# Invoke jobs via workflows
@@ -131,24 +168,43 @@ workflows:
131168
- "3.8"
132169
- "3.9"
133170
- "3.10"
134-
- flake:
171+
- "3.11"
172+
- "3.12"
173+
- "3.13"
174+
175+
- ruff:
135176
matrix:
136177
parameters:
137178
version:
138179
- "3.9"
139180
requires:
140181
- build_and_test
141182

142-
# - test_examples:
143-
# matrix:
144-
# parameters:
145-
# version:
146-
# - "3.9"
147-
# requires:
148-
# - build_and_test
183+
- test_documentation_build:
184+
matrix:
185+
parameters:
186+
version:
187+
- "3.9"
188+
requires:
189+
- build_and_test
149190

191+
- test_deprecation_warnings:
192+
matrix:
193+
parameters:
194+
version:
195+
- "3.9"
196+
requires:
197+
- build_and_test
150198

151-
test_and_publish:
199+
- test_pypi_publish:
200+
matrix:
201+
parameters:
202+
version:
203+
- "3.9"
204+
requires:
205+
- build_and_test
206+
207+
test_and_publish:
152208
# Test and publish on new git version tags
153209
# This requires its own workflow to successfully trigger the test and build
154210
jobs:
@@ -159,14 +215,32 @@ test_and_publish:
159215
- "3.8"
160216
- "3.9"
161217
- "3.10"
218+
- "3.11"
219+
- "3.12"
220+
- "3.13"
221+
222+
filters:
223+
branches:
224+
ignore: /.*/
225+
# only act on version tags
226+
tags:
227+
only: /^v[0-9]+(\.[0-9]+)*$/
228+
229+
- ruff:
230+
matrix:
231+
parameters:
232+
version:
233+
- "3.9"
234+
requires:
235+
- build_and_test
162236
filters:
163237
branches:
164238
ignore: /.*/
165239
# only act on version tags
166240
tags:
167241
only: /^v[0-9]+(\.[0-9]+)*$/
168242

169-
- flake:
243+
- test_documentation_build:
170244
matrix:
171245
parameters:
172246
version:
@@ -180,29 +254,30 @@ test_and_publish:
180254
tags:
181255
only: /^v[0-9]+(\.[0-9]+)*$/
182256

183-
# - test_examples:
184-
# matrix:
185-
# parameters:
186-
# version:
187-
# - "3.9"
188-
# requires:
189-
# - build_and_test
190-
# filters:
191-
# branches:
192-
# ignore: /.*/
193-
# # only act on version tags
194-
# tags:
195-
# only: /^v[0-9]+(\.[0-9]+)*$/
257+
- test_deprecation_warnings:
258+
matrix:
259+
parameters:
260+
version:
261+
- "3.9"
262+
requires:
263+
- build_and_test
264+
filters:
265+
branches:
266+
ignore: /.*/
267+
# only act on version tags
268+
tags:
269+
only: /^v[0-9]+(\.[0-9]+)*$/
196270

197-
- test_pypi_publish:
271+
- run_pypi_publish:
198272
matrix:
199273
parameters:
200274
version:
201275
- "3.9"
202276
requires:
203277
- build_and_test
204-
- flake
205-
# - test_examples
278+
- ruff
279+
- test_documentation_build
280+
- test_deprecation_warnings
206281
filters:
207282
branches:
208283
ignore: /.*/

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ insert_final_newline = true
1010
charset = utf-8
1111
end_of_line = lf
1212

13+
[*.yml]
14+
indent_size = 2
15+
1316
[*.bat]
1417
indent_style = tab
1518
end_of_line = crlf

.github/ISSUE_TEMPLATE.md

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,18 @@
1+
## General
2+
13
* imkar version:
24
* Python version:
35
* Operating System:
6+
* Did you install pyfar via pip:
47

5-
### Description
8+
## Description
69

710
Describe what you were trying to get done.
811
Tell us what happened, what went wrong, and what you expected to happen.
912

10-
### What I Did
13+
## What I Did
1114

1215
```
1316
Paste the command(s) you ran and the output.
1417
If there was a crash, please include the traceback here.
1518
```
16-
17-
## Labels
18-
19-
Label your issue to make it easier for us to assign and track:
20-
21-
Use one of these labels:
22-
- **hot:** For bugs on the master branch
23-
- **bug:** For bugs not on the master branch
24-
- **enhancement:** For suggesting enhancements of current functionality
25-
- **feature:** For requesting new features
26-
- **documentation:** Everything related to docstrings and comments
27-
- **question:** General questions, e.g., regarding the general structure or future directions

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,3 @@ Closes #
77
-
88
-
99
-
10-
11-
### Labels
12-
13-
Label your issue to make it easier for us to assign and track:
14-
15-
Use one of these labels:
16-
- **hot:** For bugs on the master branch
17-
- **bug:** For bugs not on the master branch
18-
- **enhancement:** For suggesting enhancements of current functionality
19-
- **feature:** For requesting new features
20-
- **documentation:** Everything related to docstrings and comments
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
on:
2+
pull_request:
3+
types: [ labeled ]
4+
name: Create issue if pr gets a cookiecutter label
5+
jobs:
6+
stuff:
7+
permissions:
8+
contents: read
9+
issues: write
10+
name: create issue
11+
environment: test
12+
if: github.event.label.name == 'cookiecutter'
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
repository: 'pyfar/cookiecutter-pypackage'
18+
- uses: dacbd/create-issue-action@v2
19+
with:
20+
title: ${{ github.event.pull_request.title }}
21+
token: ${{ secrets.cookiecutter_PAT }}
22+
owner: pyfar
23+
repo: cookiecutter-pypackage
24+
body: |
25+
apply changes from https://github.com/${{ github.repository }}/pull/${{ github.event.number }}

0 commit comments

Comments
 (0)