Skip to content

Commit 194eafa

Browse files
authored
update copier (#16)
* update copier * fix: set warning stack level 2 * style: flake8 line width
1 parent 4b2bcc0 commit 194eafa

File tree

12 files changed

+86
-29
lines changed

12 files changed

+86
-29
lines changed

.copier-answers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2-
_commit: d9ab46a
2+
_commit: 9cf97d4
33
_src_path: gh:scipp/copier_template
44
description: Reflectometry data reduction for the European Spallation Source
55
max_python: '3.12'

.github/workflows/nightly_at_main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name: Nightly test at main branch
66
on:
77
workflow_dispatch:
88
schedule:
9-
- cron: '30 23 * * *'
9+
- cron: '30 1 * * 1-5'
1010

1111
jobs:
1212
setup:

.github/workflows/nightly_at_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name: Nightly tests at latest release
66
on:
77
workflow_dispatch:
88
schedule:
9-
- cron: '0 23 * * *'
9+
- cron: '0 1 * * 1-5'
1010

1111
jobs:
1212
setup:

.github/workflows/unpinned.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# SPDX-License-Identifier: BSD-3-Clause
2+
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
3+
4+
name: Unpinned tests at latest release
5+
6+
on:
7+
workflow_dispatch:
8+
schedule:
9+
- cron: '0 2 * * 1'
10+
11+
jobs:
12+
setup:
13+
name: Setup variables
14+
runs-on: 'ubuntu-20.04'
15+
outputs:
16+
min_python: ${{ steps.vars.outputs.min_python }}
17+
release_tag: ${{ steps.release.outputs.release_tag }}
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0 # history required so we can determine latest release tag
22+
- name: Get last release tag from git
23+
id: release
24+
run: echo "release_tag=$(git describe --tags --abbrev=0 --match '[0-9]*.[0-9]*.[0-9]*')" >> $GITHUB_OUTPUT
25+
- name: Get Python version for other CI jobs
26+
id: vars
27+
run: echo "min_python=$(cat .github/workflows/python-version-ci)" >> $GITHUB_OUTPUT
28+
29+
tests:
30+
name: Tests
31+
needs: setup
32+
strategy:
33+
matrix:
34+
os: ['ubuntu-20.04']
35+
python:
36+
- version: '${{needs.setup.outputs.min_python}}'
37+
tox-env: 'unpinned'
38+
uses: ./.github/workflows/test.yml
39+
with:
40+
os-variant: ${{ matrix.os }}
41+
python-version: ${{ matrix.python.version }}
42+
tox-env: ${{ matrix.python.tox-env }}
43+
checkout_ref: ${{ needs.setup.outputs.release_tag }}

.pre-commit-config.yaml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.3.0
3+
rev: v4.5.0
44
hooks:
55
- id: check-added-large-files
66
- id: check-json
@@ -18,7 +18,7 @@ repos:
1818
- id: isort
1919
name: isort (python)
2020
- repo: https://github.com/psf/black-pre-commit-mirror
21-
rev: 23.9.0
21+
rev: 23.11.0
2222
hooks:
2323
- id: black
2424
- repo: https://github.com/kynan/nbstripout
@@ -29,28 +29,27 @@ repos:
2929
args: [ "--drop-empty-cells",
3030
"--extra-keys 'metadata.language_info.version cell.metadata.jp-MarkdownHeadingCollapsed cell.metadata.pycharm'" ]
3131
- repo: https://github.com/pycqa/flake8
32-
rev: 4.0.1
32+
rev: 6.1.0
3333
hooks:
3434
- id: flake8
3535
types: ["python"]
36-
additional_dependencies: ["flake8-bugbear==22.10.27"]
36+
additional_dependencies: ["flake8-bugbear==23.9.16"]
3737
- repo: https://github.com/pycqa/bandit
38-
rev: 1.7.4
38+
rev: 1.7.5
3939
hooks:
4040
- id: bandit
4141
additional_dependencies: ["bandit[toml]"]
4242
args: ["-c", "pyproject.toml"]
4343
- repo: https://github.com/codespell-project/codespell
44-
rev: v2.2.2
44+
rev: v2.2.6
4545
hooks:
4646
- id: codespell
4747
additional_dependencies:
4848
- tomli
4949
- repo: https://github.com/pre-commit/pygrep-hooks
50-
rev: v1.9.0
50+
rev: v1.10.0
5151
hooks:
5252
- id: python-no-eval
53-
exclude: "object_list.py"
5453
- id: python-no-log-warn
5554
- id: python-use-type-annotations
5655
- id: rst-backticks

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ representative at an online or offline event.
6161

6262
Instances of abusive, harassing, or otherwise unacceptable behavior may be
6363
reported to the community leaders responsible for enforcement at
64-
scipp@ess.eu.
64+
scipp[at]ess.eu.
6565
All complaints will be reviewed and investigated promptly and fairly.
6666

6767
All community leaders are obligated to respect the privacy and security of the

docs/developer/getting-started.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ tox -e linkcheck
7878
Build the documentation using
7979
8080
```sh
81-
python -m sphinx -v -b html -d build/.doctrees docs build/html
81+
python -m sphinx -v -b html -d .tox/docs_doctrees docs html
8282
```
8383
8484
Additionally, test the documentation using
8585
8686
```sh
87-
python -m sphinx -v -b doctest -d build/.doctrees docs build/html
88-
python -m sphinx -v -b linkcheck -d build/.doctrees docs build/html
87+
python -m sphinx -v -b doctest -d .tox/docs_doctrees docs html
88+
python -m sphinx -v -b linkcheck -d .tox/docs_doctrees docs html
8989
```
9090
````
9191
`````

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ dynamic = ["version"]
4646

4747
[project.urls]
4848
"Bug Tracker" = "https://github.com/scipp/essreflectometry/issues"
49+
"Documentation" = "https://scipp.github.io/essreflectometry"
4950
"Source" = "https://github.com/scipp/essreflectometry"
5051

5152
[tool.setuptools_scm]
@@ -70,6 +71,7 @@ skip-string-normalization = true
7071
[tool.isort]
7172
skip_gitignore = true
7273
profile = "black"
74+
known_first_party = ["essreflectometry"]
7375

7476
[tool.mypy]
7577
strict = true

requirements/make_base.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import sys
22
from argparse import ArgumentParser
3+
from typing import List
34

45
import tomli
56

@@ -12,7 +13,14 @@
1213
)
1314
args = parser.parse_args()
1415

15-
header = "# Generated by 'tox -e deps', DO NOT EDIT MANUALLY!'\n"
16+
17+
def write_dependencies(dependency_name: str, dependencies: List[str]) -> None:
18+
header = "# Generated by 'tox -e deps', DO NOT EDIT MANUALLY!'\n"
19+
with open(f"{dependency_name}.in", "w") as f:
20+
f.write(header)
21+
f.write("\n".join(dependencies))
22+
f.write("\n")
23+
1624

1725
with open("../pyproject.toml", "rb") as toml_file:
1826
pyproject = tomli.load(toml_file)
@@ -21,9 +29,7 @@
2129
raise RuntimeError("No dependencies found in pyproject.toml")
2230
dependencies = [dep.strip().strip('"') for dep in dependencies]
2331

24-
with open("base.in", "w") as f:
25-
f.write(header)
26-
f.write("\n".join(dependencies))
32+
write_dependencies("base", dependencies)
2733

2834

2935
def as_nightly(repo: str) -> str:
@@ -39,10 +45,8 @@ def as_nightly(repo: str) -> str:
3945
return f"{repo} @ git+https://github.com/{org}/{repo}@main"
4046

4147

42-
nightly = args.nightly.split(",") if args.nightly else []
43-
dependencies = [dep for dep in dependencies if not dep.startswith(tuple(nightly))]
44-
dependencies += [as_nightly(arg) for arg in nightly]
48+
nightly = tuple(args.nightly.split(",") if args.nightly else [])
49+
nightly_dependencies = [dep for dep in dependencies if not dep.startswith(nightly)]
50+
nightly_dependencies += [as_nightly(arg) for arg in nightly]
4551

46-
with open("nightly.in", "w") as f:
47-
f.write(header)
48-
f.write("\n".join(dependencies))
52+
write_dependencies("nightly", nightly_dependencies)

src/essreflectometry/orso.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ def not_found_warning():
1111
"For metadata to be logged in the data array, "
1212
"it is necessary to install the orsopy package.",
1313
UserWarning,
14+
stacklevel=2,
1415
)

0 commit comments

Comments
 (0)