Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: Run copier update, tox -e deps #2

Merged
merged 2 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: 6770edb
_commit: afbe5c7
_src_path: gh:scipp/copier_template
description: 'Spectroscopy data reduction for the European Spallation Source '
max_python: '3.12'
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)

name: CI

on:
Expand All @@ -24,13 +21,13 @@ jobs:
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
- uses: actions/setup-python@v4
- 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/[email protected].1
- uses: pre-commit-ci/[email protected].2
if: always()
with:
msg: Apply automatic formatting
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)

name: Docs

on:
Expand Down Expand Up @@ -47,11 +44,12 @@ jobs:
runs-on: 'ubuntu-22.04'
steps:
- run: sudo apt install --yes graphviz pandoc
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ inputs.branch == '' && github.ref_name || inputs.branch }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: 0 # history required so cmake can determine version
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version-file: '.github/workflows/python-version-ci'
- run: python -m pip install --upgrade pip
Expand All @@ -62,12 +60,12 @@ jobs:
if: ${{ inputs.version == '' }}
- run: tox -e linkcheck
if: ${{ inputs.linkcheck }}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: docs_html
path: html/

- uses: JamesIves/github-pages-deploy-action@v4.4.3
- uses: JamesIves/github-pages-deploy-action@v4.6.0
if: ${{ inputs.publish }}
with:
branch: gh-pages
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/nightly_at_main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)

name: Nightly test at main branch

on:
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/nightly_at_release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)

name: Nightly tests at latest release

on:
Expand Down
21 changes: 9 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)

name: Release

on:
Expand All @@ -18,7 +15,7 @@ jobs:
runs-on: 'ubuntu-22.04'

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0 # history required so setuptools_scm can determine version
Expand All @@ -31,7 +28,7 @@ jobs:
boa
- run: conda mambabuild --channel conda-forge --channel scipp --no-anaconda-upload --override-channels --output-folder conda/package conda

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: conda-package-noarch
path: conda/package/noarch/*.tar.bz2
Expand All @@ -41,11 +38,11 @@ jobs:
runs-on: 'ubuntu-22.04'

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # history required so setuptools_scm can determine version

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version-file: '.github/workflows/python-version-ci'

Expand All @@ -56,7 +53,7 @@ jobs:
run: python -m build

- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
Expand All @@ -70,8 +67,8 @@ jobs:
id-token: write
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v3
- uses: pypa/[email protected].10
- uses: actions/download-artifact@v4
- uses: pypa/[email protected].14

upload_conda:
name: Deploy Conda
Expand All @@ -80,7 +77,7 @@ jobs:
if: github.event_name == 'release' && github.event.action == 'published'

steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
- uses: mamba-org/setup-micromamba@v1
with:
environment-name: upload-env
Expand All @@ -104,7 +101,7 @@ jobs:
permissions:
contents: write # This is needed so that the action can upload the asset
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
- name: Zip documentation
run: |
mv docs_html documentation-${{ github.ref_name }}
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)

name: Test

on:
Expand Down Expand Up @@ -48,16 +45,16 @@ jobs:
runs-on: ${{ inputs.os-variant }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ inputs.checkout_ref }}
- uses: actions/setup-python@v3
- uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- run: python -m pip install --upgrade pip
- run: python -m pip install -r ${{ inputs.pip-recipe }}
- run: tox -e ${{ inputs.tox-env }}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: ${{ inputs.coverage-report }}
with:
name: CoverageReport
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/unpinned.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)

name: Unpinned tests at latest release

on:
Expand Down
29 changes: 8 additions & 21 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,21 @@ repos:
- id: trailing-whitespace
args: [ --markdown-linebreak-ext=md ]
exclude: '\.svg'
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.11.0
hooks:
- id: black
- repo: https://github.com/kynan/nbstripout
rev: 0.6.0
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/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8
types: ["python"]
additional_dependencies: ["flake8-bugbear==23.9.16"]
- repo: https://github.com/pycqa/bandit
rev: 1.7.5
hooks:
- id: bandit
additional_dependencies: ["bandit[toml]"]
args: ["-c", "pyproject.toml"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.1
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
hooks:
Expand Down
14 changes: 10 additions & 4 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,22 @@ package:
source:
path: ..


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


requirements:
build:
- setuptools
- setuptools_scm
run:
- python>=3.10
- sciline>=24.02
- scipp>=24.01
- scippneutron>=24.01
- scippnexus>=23.12

{% for package in dependencies %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dependencies above (apart from python310) need to be removed, as this would now be duplicating them all.

- {% if package == "graphviz" %}python-graphviz{% else %}{{ package }}{% endif %}
{% endfor %}


test:
imports:
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/scipp/{{ project|lower }}/releases">older versions</a>).
Current {{ project }} version: {{ version }} (<a href="https://github.com/{{orgname}}/{{ project|lower }}/releases">older versions</a>).
19 changes: 10 additions & 9 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
import doctest
import os
import sys

from ess import spectroscopy
from importlib.metadata import version as get_version

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

# General information about the project.
project = u'ESSspectroscopy'
copyright = u'2024 Scipp contributors'
author = u'Scipp contributors'
project = 'ESSspectroscopy'
copyright = '2024 Scipp contributors'
author = 'Scipp contributors'

html_show_sourcelink = True

Expand All @@ -30,13 +29,15 @@
'nbsphinx',
'myst_parser',
]

try:
import sciline.sphinxext.domain_types # noqa: F401

extensions.append('sciline.sphinxext.domain_types')
except ModuleNotFoundError:
pass


myst_enable_extensions = [
"amsmath",
"colon_fence",
Expand Down Expand Up @@ -81,6 +82,7 @@
typehints_defaults = 'comma'
typehints_use_rtype = False


sciline_domain_types_prefix = 'ess.spectroscopy'
sciline_domain_types_aliases = {
'scipp._scipp.core.DataArray': 'scipp.DataArray',
Expand All @@ -91,6 +93,7 @@
'scipp.core.data_group.DataGroup': 'scipp.DataGroup',
}


# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

Expand All @@ -108,10 +111,8 @@
# built documents.
#

# The short X.Y version.
version = spectroscopy.__version__
# The full version, including alpha/beta/rc tags.
release = spectroscopy.__version__
release = get_version("essspectroscopy")
version = ".".join(release.split('.')[:3]) # CalVer

warning_is_error = True

Expand Down
2 changes: 1 addition & 1 deletion docs/developer/coding-conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Code formatting

There are no explicit code formatting conventions since we use `black` to enforce a format.
There are no explicit code formatting conventions since we use `ruff` to enforce a format.

## Docstring format

Expand Down
2 changes: 1 addition & 1 deletion docs/developer/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Developer documentation
# Development

```{include} ../../CONTRIBUTING.md
```
Expand Down
Loading