Skip to content

Commit d4e3b39

Browse files
authored
Merge pull request #29 from pyfar/apply-cookiecutter
Apply cookiecutter
2 parents 73dcef5 + 6b50eff commit d4e3b39

File tree

7 files changed

+72
-30
lines changed

7 files changed

+72
-30
lines changed

.circleci/config.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -171,36 +171,36 @@ workflows:
171171
- "3.11"
172172
- "3.12"
173173
- "3.13"
174-
174+
175175
- ruff:
176176
matrix:
177177
parameters:
178178
version:
179-
- "3.12"
179+
- "3.13"
180180
requires:
181181
- build_and_test
182182

183183
- test_documentation_build:
184184
matrix:
185185
parameters:
186186
version:
187-
- "3.12"
187+
- "3.13"
188188
requires:
189189
- build_and_test
190190

191191
- test_deprecation_warnings:
192192
matrix:
193193
parameters:
194194
version:
195-
- "3.12"
195+
- "3.13"
196196
requires:
197197
- build_and_test
198198

199199
- test_pypi_publish:
200200
matrix:
201201
parameters:
202202
version:
203-
- "3.12"
203+
- "3.13"
204204
requires:
205205
- build_and_test
206206

@@ -218,7 +218,7 @@ workflows:
218218
- "3.11"
219219
- "3.12"
220220
- "3.13"
221-
221+
222222
filters:
223223
branches:
224224
ignore: /.*/
@@ -230,7 +230,7 @@ workflows:
230230
matrix:
231231
parameters:
232232
version:
233-
- "3.12"
233+
- "3.13"
234234
requires:
235235
- build_and_test
236236
filters:
@@ -244,7 +244,7 @@ workflows:
244244
matrix:
245245
parameters:
246246
version:
247-
- "3.12"
247+
- "3.13"
248248
requires:
249249
- build_and_test
250250
filters:
@@ -258,7 +258,7 @@ workflows:
258258
matrix:
259259
parameters:
260260
version:
261-
- "3.12"
261+
- "3.13"
262262
requires:
263263
- build_and_test
264264
filters:
@@ -272,7 +272,7 @@ workflows:
272272
matrix:
273273
parameters:
274274
version:
275-
- "3.12"
275+
- "3.13"
276276
requires:
277277
- build_and_test
278278
- ruff

.github/ISSUE_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* imkar version:
44
* Python version:
55
* Operating System:
6-
* Did you install pyfar via pip:
6+
* Did you install imkar via pip:
77

88
## Description
99

.github/workflows/has_version_label.yml renamed to .github/workflows/has_label.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: PR Check Label for version Label
1+
name: pull_request label
22

33
on:
44
pull_request:
@@ -12,17 +12,15 @@ jobs:
1212
check-labels:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- name: Check for version label
15+
- name: pull_request label
1616
run: |
17-
echo "Checking for version label on pull request..."
17+
echo "Checking for label on pull request..."
1818
PR_DATA=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }})
1919
LABEL_NAMES=$(echo "$PR_DATA" | jq -r '.labels[].name')
2020
echo "Labels: $LABEL_NAMES"
2121
22-
REGEX="^v[0-9]+\.[0-9]+\.[0-9]+$"
23-
MATCHES=$(echo "$LABEL_NAMES" | grep -E "$REGEX")
24-
if [ -z "$MATCHES" ]; then
25-
echo "Error: No version label found on this pull request. Please add a label in the format vX.Y.Z."
22+
if [ -z "$LABEL_NAMES" ]; then
23+
echo "Error: No label found on this pull request. Please add a label."
2624
exit 1
2725
fi
2826
env:
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: pull_request version milestone
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- labeled
8+
- unlabeled
9+
- synchronize
10+
11+
jobs:
12+
check-labels:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: pull_request version milestone
16+
run: |
17+
echo "Checking for version milestone on pull request..."
18+
PR_DATA=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }})
19+
MILESTONE_NAME=$(echo "$PR_DATA" | jq -r '.milestone.title')
20+
echo "Milestone: $MILESTONE_NAME"
21+
22+
REGEX="^v[0-9]+\.[0-9]+\.[0-9]+$"
23+
MATCHES=$(echo "$MILESTONE_NAME" | grep -E "$REGEX")
24+
if [ -z "$MATCHES" ]; then
25+
echo "Error: No version milestone found on this pull request. Please add a milestone in the format vX.Y.Z."
26+
exit 1
27+
fi
28+
env:
29+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024, The pyfar developers
3+
Copyright (c) 2025, The pyfar developers
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

docs/conf.py

100755100644
Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import sys
1111
import urllib3
1212
import shutil
13+
import numpy as np
1314
sys.path.insert(0, os.path.abspath('..'))
1415

1516
import imkar # noqa
@@ -55,7 +56,7 @@
5556

5657
# General information about the project.
5758
project = 'imkar'
58-
copyright = "2024, The pyfar developers"
59+
copyright = "2025, The pyfar developers"
5960
author = "The pyfar developers"
6061

6162
# The version info for the project you're documenting, acts as replacement
@@ -117,7 +118,8 @@
117118
"navbar_start": ["navbar-logo"],
118119
"navbar_end": ["navbar-icon-links", "theme-switcher"],
119120
"navbar_align": "content",
120-
"header_links_before_dropdown": 10,
121+
"header_links_before_dropdown": None, # will be automatically set later based on headers.rst
122+
"header_dropdown_text": "Packages", # Change dropdown name from "More" to "Packages"
121123
"icon_links": [
122124
{
123125
"name": "GitHub",
@@ -144,6 +146,15 @@
144146
}
145147

146148
# -- download navbar and style files from gallery -----------------------------
149+
branch = 'main'
150+
link = f'https://github.com/pyfar/gallery/raw/{branch}/docs/'
151+
folders_in = [
152+
'_static/css/custom.css',
153+
'_static/favicon.ico',
154+
'_static/header.rst',
155+
'resources/logos/pyfar_logos_fixed_size_imkar.png',
156+
]
157+
147158
def download_files_from_gallery(link, folders_in):
148159
c = urllib3.PoolManager()
149160
for file in folders_in:
@@ -155,14 +166,6 @@ def download_files_from_gallery(link, folders_in):
155166
with open(filename, 'wb') as out_file:
156167
shutil.copyfileobj(res, out_file)
157168

158-
branch = 'main'
159-
link = f'https://github.com/pyfar/gallery/raw/{branch}/docs/'
160-
folders_in = [
161-
'_static/css/custom.css',
162-
'_static/favicon.ico',
163-
'_static/header.rst',
164-
'resources/logos/pyfar_logos_fixed_size_imkar.png',
165-
]
166169
download_files_from_gallery(link, folders_in)
167170
# if logo does not exist, use pyfar logo
168171
if not os.path.exists(html_logo):
@@ -179,5 +182,16 @@ def download_files_from_gallery(link, folders_in):
179182

180183
fout.writelines(lines)
181184

185+
# add project to the list of projects if not in header
182186
if not contains_project:
183187
fout.write(f' {project} <{project}>\n')
188+
189+
# count the number of gallery headings
190+
count_gallery_headings = np.sum(
191+
['https://pyfar-gallery.readthedocs.io' in line for line in lines])
192+
193+
194+
# set dropdown header after gallery headings
195+
html_theme_options['header_links_before_dropdown'] = count_gallery_headings+1
196+
197+

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ classifiers = [
2727
"Programming Language :: Python :: 3.11",
2828
"Programming Language :: Python :: 3.12",
2929
"Programming Language :: Python :: 3.13",
30-
30+
3131
]
3232
dependencies = [
3333
'numpy',
@@ -50,6 +50,7 @@ tests = [
5050
"watchdog",
5151
"ruff==0.8.3",
5252
"coverage",
53+
5354
]
5455
docs = [
5556
"sphinx",

0 commit comments

Comments
 (0)