Skip to content

Commit 73dcef5

Browse files
authored
Merge pull request #25 from pyfar/new-cookiecutter
fix
2 parents 553f603 + bc814ee commit 73dcef5

File tree

4 files changed

+37
-27
lines changed

4 files changed

+37
-27
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.9"
179+
- "3.12"
180180
requires:
181181
- build_and_test
182182

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

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

199199
- test_pypi_publish:
200200
matrix:
201201
parameters:
202202
version:
203-
- "3.9"
203+
- "3.12"
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.9"
233+
- "3.12"
234234
requires:
235235
- build_and_test
236236
filters:
@@ -244,7 +244,7 @@ workflows:
244244
matrix:
245245
parameters:
246246
version:
247-
- "3.9"
247+
- "3.12"
248248
requires:
249249
- build_and_test
250250
filters:
@@ -258,7 +258,7 @@ workflows:
258258
matrix:
259259
parameters:
260260
version:
261-
- "3.9"
261+
- "3.12"
262262
requires:
263263
- build_and_test
264264
filters:
@@ -272,7 +272,7 @@ workflows:
272272
matrix:
273273
parameters:
274274
version:
275-
- "3.9"
275+
- "3.12"
276276
requires:
277277
- build_and_test
278278
- ruff

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,4 @@ docs/_static/favicon.ico
121121
docs/_static/header.rst
122122
docs/_static/css/custom.css
123123
docs/resources/logos/pyfar_logos_fixed_size_imkar.png
124+
docs/resources/logos/pyfar_logos_fixed_size_pyfar.png

docs/conf.py

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
"navbar_start": ["navbar-logo"],
118118
"navbar_end": ["navbar-icon-links", "theme-switcher"],
119119
"navbar_align": "content",
120-
"header_links_before_dropdown": 8,
120+
"header_links_before_dropdown": 10,
121121
"icon_links": [
122122
{
123123
"name": "GitHub",
@@ -144,6 +144,17 @@
144144
}
145145

146146
# -- download navbar and style files from gallery -----------------------------
147+
def download_files_from_gallery(link, folders_in):
148+
c = urllib3.PoolManager()
149+
for file in folders_in:
150+
url = link + file
151+
filename = file
152+
os.makedirs(os.path.dirname(filename), exist_ok=True)
153+
with c.request('GET', url, preload_content=False) as res:
154+
if res.status == 200:
155+
with open(filename, 'wb') as out_file:
156+
shutil.copyfileobj(res, out_file)
157+
147158
branch = 'main'
148159
link = f'https://github.com/pyfar/gallery/raw/{branch}/docs/'
149160
folders_in = [
@@ -152,23 +163,21 @@
152163
'_static/header.rst',
153164
'resources/logos/pyfar_logos_fixed_size_imkar.png',
154165
]
155-
c = urllib3.PoolManager()
156-
for file in folders_in:
157-
url = link + file
158-
filename = file
159-
os.makedirs(os.path.dirname(filename), exist_ok=True)
160-
with c.request('GET', url, preload_content=False) as res, open(filename, 'wb') as out_file:
161-
shutil.copyfileobj(res, out_file)
166+
download_files_from_gallery(link, folders_in)
167+
# if logo does not exist, use pyfar logo
168+
if not os.path.exists(html_logo):
169+
download_files_from_gallery(
170+
link, ['resources/logos/pyfar_logos_fixed_size_pyfar.png'])
171+
shutil.copyfile(
172+
'resources/logos/pyfar_logos_fixed_size_pyfar.png', html_logo)
162173

163174
# replace imkar hard link to internal link
164175
with open("_static/header.rst", "rt") as fin:
165176
with open("header.rst", "wt") as fout:
166-
contains_imkar = False
167-
for line in fin:
168-
line_new = line.replace(f'https://{project}.readthedocs.io', project)
169-
if line_new != line:
170-
contains_imkar = True
171-
fout.write(line_new)
172-
if not contains_imkar:
173-
fout.write(f' {project} <{project}>\n')
177+
lines = [line.replace(f'https://{project}.readthedocs.io', project) for line in fin]
178+
contains_project = any(project in line for line in lines)
174179

180+
fout.writelines(lines)
181+
182+
if not contains_project:
183+
fout.write(f' {project} <{project}>\n')

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ tests = [
4848
"pytest",
4949
"pytest-cov",
5050
"watchdog",
51-
"ruff==0.4.1",
51+
"ruff==0.8.3",
5252
"coverage",
5353
]
5454
docs = [

0 commit comments

Comments
 (0)