Skip to content

Commit

Permalink
Merge pull request #132 from scipp/copier-update
Browse files Browse the repository at this point in the history
Copier update
  • Loading branch information
jl-wynen authored Nov 22, 2024
2 parents efa0ffc + 0e5ce30 commit 10de586
Show file tree
Hide file tree
Showing 21 changed files with 81 additions and 55 deletions.
4 changes: 2 additions & 2 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: bd9d844
_commit: aa5dc5e
_src_path: gh:scipp/copier_template
description: Common data reduction tools for the ESS facility
max_python: '3.12'
max_python: '3.13'
min_python: '3.10'
namespace_package: ess
nightly_deps: scippnexus,scipp,sciline,cyclebane
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
formatting:
name: Formatting and static analysis
runs-on: 'ubuntu-22.04'
runs-on: 'ubuntu-24.04'
outputs:
min_python: ${{ steps.vars.outputs.min_python }}
min_tox_env: ${{ steps.vars.outputs.min_tox_env }}
Expand All @@ -19,15 +19,15 @@ jobs:
- name: Get Python version for other CI jobs
id: vars
run: |
echo "min_python=$(cat .github/workflows/python-version-ci)" >> $GITHUB_OUTPUT
echo "min_tox_env=py$(cat .github/workflows/python-version-ci | sed 's/\.//g')" >> $GITHUB_OUTPUT
echo "min_python=$(< .github/workflows/python-version-ci)" >> "$GITHUB_OUTPUT"
echo "min_tox_env=py$(sed 's/\.//g' < .github/workflows/python-version-ci)" >> "$GITHUB_OUTPUT"
- uses: actions/setup-python@v5
with:
python-version-file: '.github/workflows/python-version-ci'
- uses: pre-commit/[email protected]
with:
extra_args: --all-files
- uses: pre-commit-ci/lite-action@v1.0.2
- uses: pre-commit-ci/lite-action@v1.1.0
if: always()
with:
msg: Apply automatic formatting
Expand All @@ -37,7 +37,7 @@ jobs:
needs: formatting
strategy:
matrix:
os: ['ubuntu-22.04']
os: ['ubuntu-24.04']
python:
- version: '${{needs.formatting.outputs.min_python}}'
tox-env: '${{needs.formatting.outputs.min_tox_env}}'
Expand All @@ -53,6 +53,6 @@ jobs:
uses: ./.github/workflows/docs.yml
with:
publish: false
linkcheck: ${{ contains(matrix.variant.os, 'ubuntu') && github.ref == 'refs/heads/main' }}
linkcheck: ${{ github.ref == 'refs/heads/main' }}
branch: ${{ github.head_ref == '' && github.ref_name || github.head_ref }}
secrets: inherit
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ env:
jobs:
docs:
name: Build documentation
runs-on: 'ubuntu-22.04'
runs-on: 'ubuntu-24.04'
env:
ESS_PROTECTED_FILESTORE_USERNAME: ${{ secrets.ESS_PROTECTED_FILESTORE_USERNAME }}
ESS_PROTECTED_FILESTORE_PASSWORD: ${{ secrets.ESS_PROTECTED_FILESTORE_PASSWORD }}
Expand All @@ -58,7 +58,7 @@ jobs:
python-version-file: '.github/workflows/python-version-ci'
- run: python -m pip install --upgrade pip
- run: python -m pip install -r requirements/ci.txt
- run: tox -e releasedocs -- ${VERSION}
- run: tox -e releasedocs -- "${VERSION}"
if: ${{ inputs.version != '' }}
- run: tox -e docs
if: ${{ inputs.version == '' }}
Expand All @@ -69,7 +69,7 @@ jobs:
name: docs_html
path: html/

- uses: JamesIves/[email protected].3
- uses: JamesIves/[email protected].9
if: ${{ inputs.publish }}
with:
branch: gh-pages
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/nightly_at_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ on:
jobs:
setup:
name: Setup variables
runs-on: 'ubuntu-22.04'
runs-on: 'ubuntu-24.04'
outputs:
min_python: ${{ steps.vars.outputs.min_python }}
steps:
- uses: actions/checkout@v4
- name: Get Python version for other CI jobs
id: vars
run: echo "min_python=$(cat .github/workflows/python-version-ci)" >> $GITHUB_OUTPUT
run: echo "min_python=$(< .github/workflows/python-version-ci)" >> "$GITHUB_OUTPUT"

tests:
name: Tests
needs: setup
strategy:
matrix:
os: ['ubuntu-22.04']
os: ['ubuntu-24.04']
python:
- version: '${{needs.setup.outputs.min_python}}'
tox-env: 'nightly'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/nightly_at_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
setup:
name: Setup variables
runs-on: 'ubuntu-22.04'
runs-on: 'ubuntu-24.04'
outputs:
min_python: ${{ steps.vars.outputs.min_python }}
release_tag: ${{ steps.release.outputs.release_tag }}
Expand All @@ -18,17 +18,17 @@ jobs:
fetch-depth: 0 # history required so we can determine latest release tag
- name: Get last release tag from git
id: release
run: echo "release_tag=$(git describe --tags --abbrev=0 --match '[0-9]*.[0-9]*.[0-9]*')" >> $GITHUB_OUTPUT
run: echo "release_tag=$(git describe --tags --abbrev=0 --match '[0-9]*.[0-9]*.[0-9]*')" >> "$GITHUB_OUTPUT"
- name: Get Python version for other CI jobs
id: vars
run: echo "min_python=$(cat .github/workflows/python-version-ci)" >> $GITHUB_OUTPUT
run: echo "min_python=$(cat .github/workflows/python-version-ci)" >> "$GITHUB_OUTPUT"

tests:
name: Tests
needs: setup
strategy:
matrix:
os: ['ubuntu-22.04']
os: ['ubuntu-24.04']
python:
- version: '${{needs.setup.outputs.min_python}}'
tox-env: 'nightly'
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defaults:
jobs:
build_conda:
name: Conda build
runs-on: 'ubuntu-22.04'
runs-on: 'ubuntu-24.04'

steps:
- uses: actions/checkout@v4
Expand All @@ -35,7 +35,7 @@ jobs:

build_wheels:
name: Wheels
runs-on: 'ubuntu-22.04'
runs-on: 'ubuntu-24.04'

steps:
- uses: actions/checkout@v4
Expand All @@ -61,7 +61,7 @@ jobs:
upload_pypi:
name: Deploy PyPI
needs: [build_wheels, build_conda]
runs-on: 'ubuntu-22.04'
runs-on: 'ubuntu-24.04'
environment: release
permissions:
id-token: write
Expand All @@ -73,7 +73,7 @@ jobs:
upload_conda:
name: Deploy Conda
needs: [build_wheels, build_conda]
runs-on: 'ubuntu-22.04'
runs-on: 'ubuntu-24.04'
if: github.event_name == 'release' && github.event.action == 'published'

steps:
Expand All @@ -97,7 +97,7 @@ jobs:
assets:
name: Upload docs
needs: docs
runs-on: 'ubuntu-22.04'
runs-on: 'ubuntu-24.04'
permissions:
contents: write # This is needed so that the action can upload the asset
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
os-variant:
default: 'ubuntu-22.04'
default: 'ubuntu-24.04'
type: string
python-version:
type: string
Expand All @@ -23,7 +23,7 @@ on:
workflow_call:
inputs:
os-variant:
default: 'ubuntu-22.04'
default: 'ubuntu-24.04'
type: string
python-version:
type: string
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/unpinned.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
setup:
name: Setup variables
runs-on: 'ubuntu-22.04'
runs-on: 'ubuntu-24.04'
outputs:
min_python: ${{ steps.vars.outputs.min_python }}
release_tag: ${{ steps.release.outputs.release_tag }}
Expand All @@ -18,17 +18,17 @@ jobs:
fetch-depth: 0 # history required so we can determine latest release tag
- name: Get last release tag from git
id: release
run: echo "release_tag=$(git describe --tags --abbrev=0 --match '[0-9]*.[0-9]*.[0-9]*')" >> $GITHUB_OUTPUT
run: echo "release_tag=$(git describe --tags --abbrev=0 --match '[0-9]*.[0-9]*.[0-9]*')" >> "$GITHUB_OUTPUT"
- name: Get Python version for other CI jobs
id: vars
run: echo "min_python=$(cat .github/workflows/python-version-ci)" >> $GITHUB_OUTPUT
run: echo "min_python=$(cat .github/workflows/python-version-ci)" >> "$GITHUB_OUTPUT"

tests:
name: Tests
needs: setup
strategy:
matrix:
os: ['ubuntu-22.04']
os: ['ubuntu-24.04']
python:
- version: '${{needs.setup.outputs.min_python}}'
tox-env: 'unpinned'
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ dist
html
.tox
*.egg-info
uv.lock # we lock dependencies with pip-compile, not uv

*.sw?

# Environments
venv
.venv

# Caches
.clangd/
Expand Down Expand Up @@ -39,3 +41,6 @@ docs/generated/
*.cif
*.rcif
*.ort
*.zip
*.sqw
*.nxspe
16 changes: 12 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-illegal-windows-names
- id: check-json
exclude: asv.conf.json
- id: check-merge-conflict
Expand All @@ -14,22 +16,22 @@ repos:
args: [ --markdown-linebreak-ext=md ]
exclude: '\.svg'
- repo: https://github.com/kynan/nbstripout
rev: 0.6.0
rev: 0.7.1
hooks:
- id: nbstripout
types: [ "jupyter" ]
args: [ "--drop-empty-cells",
"--extra-keys 'metadata.language_info.version cell.metadata.jp-MarkdownHeadingCollapsed cell.metadata.pycharm'" ]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.3
rev: v0.6.9
hooks:
- id: ruff
args: [ --fix ]
types_or: [ python, pyi, jupyter ]
- id: ruff-format
types_or: [ python, pyi ]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies:
Expand All @@ -44,3 +46,9 @@ repos:
- id: rst-directive-colons
- id: rst-inline-touching-normal
- id: text-unicode-replacement-char
- repo: https://github.com/rhysd/actionlint
rev: v1.7.3
hooks:
- id: actionlint
# Disable because of false-positive SC2046
args: ["-shellcheck="]
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10
5 changes: 4 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2024 Scipp contributors (https://github.com/scipp)

import doctest
import os
import sys
Expand Down Expand Up @@ -203,7 +206,7 @@

html_title = "ESSreduce"
html_logo = "_static/logo.svg"
html_favicon = "_static/favicon.ico"
html_favicon = "_static/favicon.svg"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand Down
11 changes: 10 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering",
"Typing :: Typed",
]
Expand Down Expand Up @@ -83,7 +84,7 @@ ignore = [
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"COM812", "COM819", "D206", "D300", "E111", "E114", "E117", "ISC001", "ISC002", "Q000", "Q001", "Q002", "Q003", "W191",
]
fixable = ["I001", "B010"]
fixable = ["B010", "I001", "PT001"]
isort.known-first-party = ["ess.reduce"]
pydocstyle.convention = "numpy"

Expand Down Expand Up @@ -115,3 +116,11 @@ enable_error_code = [
"truthy-bool",
]
warn_unreachable = true

[tool.codespell]
ignore-words-list = [
# Codespell wants "socioeconomic" which seems to be the standard spelling.
# But we use the word in our code of conduct which is the contributor covenant.
# Let's not modify it if we don't have to.
"socio-economic",
]
4 changes: 3 additions & 1 deletion requirements/make_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ def as_nightly(repo: str) -> str:


nightly = tuple(args.nightly.split(",") if args.nightly else [])
nightly_dependencies = [dep for dep in dependencies if not dep.startswith(nightly)]
nightly_dependencies = [
dep for dep in dependencies + test_dependencies if not dep.startswith(nightly)
]
nightly_dependencies += [as_nightly(arg) for arg in nightly]

write_dependencies("nightly", nightly_dependencies)
1 change: 0 additions & 1 deletion requirements/nightly.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
-r basetest.in
# --- END OF CUSTOM SECTION ---
# The following was generated by 'tox -e deps', DO NOT EDIT MANUALLY!
scippnexus @ git+https://github.com/scipp/scippnexus@main
Expand Down
2 changes: 1 addition & 1 deletion src/ess/reduce/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from . import nexus, uncertainty

try:
__version__ = importlib.metadata.version(__package__ or __name__)
__version__ = importlib.metadata.version("essreduce")
except importlib.metadata.PackageNotFoundError:
__version__ = "0.0.0"

Expand Down
1 change: 0 additions & 1 deletion src/ess/reduce/widgets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class EssWidget(Protocol):
All widgets should have a `value` property that returns the value of the widget.
It can be composed from multiple widgets.
```
"""

@property
Expand Down
Loading

0 comments on commit 10de586

Please sign in to comment.