Skip to content

Commit

Permalink
Merge pull request #80 from scipp/update
Browse files Browse the repository at this point in the history
Update copier and deps
  • Loading branch information
SimonHeybrock authored Aug 26, 2024
2 parents 232d7db + d61cfd9 commit 4f3f73d
Show file tree
Hide file tree
Showing 34 changed files with 151 additions and 63 deletions.
4 changes: 2 additions & 2 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: afbe5c7
_commit: bd9d844
_src_path: gh:scipp/copier_template
description: Common data reduction tools for the ESS facility
max_python: '3.12'
min_python: '3.10'
namespace_package: ess
nightly_deps: ''
nightly_deps: scippnexus,scipp,sciline,cyclebane
orgname: scipp
prettyname: ESSreduce
projectname: essreduce
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
os-variant: ${{ matrix.os }}
python-version: ${{ matrix.python.version }}
tox-env: ${{ matrix.python.tox-env }}
secrets: inherit

docs:
needs: tests
Expand All @@ -54,3 +55,4 @@ jobs:
publish: false
linkcheck: ${{ contains(matrix.variant.os, 'ubuntu') && github.ref == 'refs/heads/main' }}
branch: ${{ github.head_ref == '' && github.ref_name || github.head_ref }}
secrets: inherit
6 changes: 5 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ jobs:
docs:
name: Build documentation
runs-on: 'ubuntu-22.04'
env:
ESS_PROTECTED_FILESTORE_USERNAME: ${{ secrets.ESS_PROTECTED_FILESTORE_USERNAME }}
ESS_PROTECTED_FILESTORE_PASSWORD: ${{ secrets.ESS_PROTECTED_FILESTORE_PASSWORD }}

steps:
- run: sudo apt install --yes graphviz pandoc
- uses: actions/checkout@v4
Expand All @@ -65,7 +69,7 @@ jobs:
name: docs_html
path: html/

- uses: JamesIves/github-pages-deploy-action@v4.6.0
- uses: JamesIves/github-pages-deploy-action@v4.6.3
if: ${{ inputs.publish }}
with:
branch: gh-pages
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/nightly_at_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ jobs:
os-variant: ${{ matrix.os }}
python-version: ${{ matrix.python.version }}
tox-env: ${{ matrix.python.tox-env }}
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/nightly_at_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ jobs:
python-version: ${{ matrix.python.version }}
tox-env: ${{ matrix.python.tox-env }}
checkout_ref: ${{ needs.setup.outputs.release_tag }}
secrets: inherit
18 changes: 18 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,26 @@ on:
type: string

jobs:
package-test:
runs-on: ${{ inputs.os-variant }}

steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.checkout_ref }}
- uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- run: python -m pip install --upgrade pip
- run: python -m pip install .
- run: python tests/package_test.py
name: Run package tests

test:
runs-on: ${{ inputs.os-variant }}
env:
ESS_PROTECTED_FILESTORE_USERNAME: ${{ secrets.ESS_PROTECTED_FILESTORE_USERNAME }}
ESS_PROTECTED_FILESTORE_PASSWORD: ${{ secrets.ESS_PROTECTED_FILESTORE_PASSWORD }}

steps:
- uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/unpinned.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ jobs:
python-version: ${{ matrix.python.version }}
tox-env: ${{ matrix.python.tox-env }}
checkout_ref: ${{ needs.setup.outputs.release_tag }}
secrets: inherit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ __pycache__/
.pytest_cache
.mypy_cache
docs/generated/
.ruff_cache

# Editor settings
.idea/
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repos:
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.1
rev: v0.4.3
hooks:
- id: ruff
args: [ --fix ]
Expand Down
12 changes: 10 additions & 2 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ source:

{% set pyproject = load_file_data('pyproject.toml') %}
{% set dependencies = pyproject.get('project', {}).get('dependencies', {}) %}
{% set test_dependencies = pyproject.get('project', {}).get('optional-dependencies', {}).get('test', {}) %}


requirements:
Expand All @@ -18,16 +19,23 @@ requirements:
run:
- python>=3.10

{# Conda does not allow spaces between package name and version, so remove them #}
{% for package in dependencies %}
- {% if package == "graphviz" %}python-graphviz{% else %}{{ package }}{% endif %}
- {% if package == "graphviz" %}python-graphviz{% else %}{{ package|replace(" ", "") }}{% endif %}
{% endfor %}


test:
imports:
- ess.reduce
requires:
- pytest

{# Conda does not allow spaces between package name and version, so remove them #}
{% for package in test_dependencies %}
- {% if package == "graphviz" %}python-graphviz{% else %}{{ package|replace(" ", "") }}{% endif %}
{% endfor %}


source_files:
- pyproject.toml
- tests/
Expand Down
2 changes: 1 addition & 1 deletion docs/_templates/doc_version.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<!-- This will display the version of the docs -->
Current {{ project }} version: {{ version }} (<a href="https://github.com/{{orgname}}/{{ project|lower }}/releases">older versions</a>).
Current ESSreduce version: {{ version }} (<a href="https://github.com/scipp/essreduce/releases">older versions</a>).
20 changes: 16 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# -*- coding: utf-8 -*-

import doctest
import os
import sys
from importlib.metadata import PackageNotFoundError
from importlib.metadata import version as get_version

from sphinx.util import logging

sys.path.insert(0, os.path.abspath('.'))

logger = logging.getLogger(__name__)

# General information about the project.
project = 'ESSreduce'
copyright = '2024 Scipp contributors'
Expand Down Expand Up @@ -34,6 +37,8 @@
import sciline.sphinxext.domain_types # noqa: F401

extensions.append('sciline.sphinxext.domain_types')
# See https://github.com/tox-dev/sphinx-autodoc-typehints/issues/457
suppress_warnings = ["config.cache"]
except ModuleNotFoundError:
pass

Expand Down Expand Up @@ -111,8 +116,15 @@
# built documents.
#

release = get_version("essreduce")
version = ".".join(release.split('.')[:3]) # CalVer
try:
release = get_version("essreduce")
version = ".".join(release.split('.')[:3]) # CalVer
except PackageNotFoundError:
logger.info(
"Warning: determining version from package metadata failed, falling back to "
"a dummy version number."
)
release = version = "0.0.0-dev"

warning_is_error = True

Expand Down
11 changes: 9 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ dependencies = [

dynamic = ["version"]

[project.optional-dependencies]
test = [
"ipywidgets",
"pooch",
"pytest",
]

[project.scripts]
grow-nexus = "ess.reduce.scripts.grow_nexus:main"

Expand Down Expand Up @@ -70,14 +77,14 @@ extend-exclude = [

[tool.ruff.lint]
# See https://docs.astral.sh/ruff/rules/
select = ["B", "C4", "DTZ", "E", "F", "G", "I", "PERF", "PGH", "PT", "PYI", "RUF", "S", "T20", "W"]
select = ["B", "C4", "DTZ", "E", "F", "G", "I", "PERF", "PGH", "PT", "PYI", "RUF", "S", "T20", "UP", "W"]
ignore = [
# Conflict with ruff format, see
# 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"]
isort.known-first-party = ["essreduce"]
isort.known-first-party = ["ess.reduce"]
pydocstyle.convention = "numpy"

[tool.ruff.lint.per-file-ignores]
Expand Down
6 changes: 3 additions & 3 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ h5py==3.11.0
# via scippnexus
networkx==3.3
# via cyclebane
numpy==2.0.1
numpy==2.1.0
# via
# h5py
# scipp
Expand All @@ -20,13 +20,13 @@ python-dateutil==2.9.0.post0
# via scippnexus
sciline==24.6.2
# via -r base.in
scipp==24.6.0
scipp==24.8.0
# via
# -r base.in
# scippnexus
scippnexus==24.8.1
# via -r base.in
scipy==1.14.0
scipy==1.14.1
# via scippnexus
six==1.16.0
# via python-dateutil
9 changes: 7 additions & 2 deletions requirements/basetest.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# Dependencies that are only used by tests.
# Do not make an environment from this file, use test.txt instead!
# Add more dependencies in the ``test`` list
# under ``[project.optional-dependencies]`` section, in ``pyproject.toml``

# Anything above "--- END OF CUSTOM SECTION ---"
# will not be touched by ``make_base.py``
# --- END OF CUSTOM SECTION ---
# The following was generated by 'tox -e deps', DO NOT EDIT MANUALLY!
ipywidgets
pooch
pytest
numpy
ipywidgets
12 changes: 5 additions & 7 deletions requirements/basetest.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SHA1:5532a168d5d263d81330479c8860b4b7b399de9b
# SHA1:d69d994ed83cc9e89ad349f490a0f8f41d18d8bf
#
# This file is autogenerated by pip-compile-multi
# To update, run:
Expand All @@ -21,22 +21,20 @@ exceptiongroup==1.2.2
# pytest
executing==2.0.1
# via stack-data
idna==3.7
idna==3.8
# via requests
iniconfig==2.0.0
# via pytest
ipython==8.26.0
# via ipywidgets
ipywidgets==8.1.3
ipywidgets==8.1.5
# via -r basetest.in
jedi==0.19.1
# via ipython
jupyterlab-widgets==3.0.11
jupyterlab-widgets==3.0.13
# via ipywidgets
matplotlib-inline==0.1.7
# via ipython
numpy==2.0.1
# via -r basetest.in
packaging==24.1
# via
# pooch
Expand Down Expand Up @@ -81,5 +79,5 @@ urllib3==2.2.2
# via requests
wcwidth==0.2.13
# via prompt-toolkit
widgetsnbextension==4.0.11
widgetsnbextension==4.0.13
# via ipywidgets
4 changes: 2 additions & 2 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# pip-compile-multi
#
cachetools==5.4.0
cachetools==5.5.0
# via tox
certifi==2024.7.4
# via requests
Expand All @@ -25,7 +25,7 @@ gitdb==4.0.11
# via gitpython
gitpython==3.1.43
# via -r ci.in
idna==3.7
idna==3.8
# via requests
packaging==24.1
# via
Expand Down
2 changes: 1 addition & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ terminado==0.18.1
# jupyter-server-terminals
toposort==1.10
# via pip-compile-multi
types-python-dateutil==2.9.0.20240316
types-python-dateutil==2.9.0.20240821
# via arrow
uri-template==1.3.0
# via jsonschema
Expand Down
10 changes: 5 additions & 5 deletions requirements/docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fastjsonschema==2.20.0
# via nbformat
graphviz==0.20.3
# via -r docs.in
idna==3.7
idna==3.8
# via requests
imagesize==1.4.1
# via sphinx
Expand All @@ -65,7 +65,7 @@ ipython==8.26.0
# -r docs.in
# ipykernel
# ipywidgets
ipywidgets==8.1.3
ipywidgets==8.1.5
# via -r docs.in
jedi==0.19.1
# via ipython
Expand All @@ -92,7 +92,7 @@ jupyter-core==5.7.2
# nbformat
jupyterlab-pygments==0.3.0
# via nbconvert
jupyterlab-widgets==3.0.11
jupyterlab-widgets==3.0.13
# via ipywidgets
markdown-it-py==3.0.0
# via
Expand Down Expand Up @@ -160,7 +160,7 @@ pygments==2.18.0
# sphinx
pyyaml==6.0.2
# via myst-parser
pyzmq==26.1.0
pyzmq==26.2.0
# via
# ipykernel
# jupyter-client
Expand Down Expand Up @@ -240,5 +240,5 @@ webencodings==0.5.1
# via
# bleach
# tinycss2
widgetsnbextension==4.0.11
widgetsnbextension==4.0.13
# via ipywidgets
Loading

0 comments on commit 4f3f73d

Please sign in to comment.