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

Drop Python 3.9 support #159

Merged
merged 6 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
4 changes: 2 additions & 2 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: bba4103
_commit: e3856ac
_src_path: gh:scipp/copier_template
description: Build scientific pipelines for your data
max_python: '3.12'
min_python: '3.9'
min_python: '3.10'
namespace_package: ''
nightly_deps: ''
orgname: scipp
Expand Down
16 changes: 7 additions & 9 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,15 +21,16 @@ 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'
- run: python -m pip install --upgrade pip
- run: python -m pip install -r requirements/ci.txt
- run: tox -e static
- uses: stefanzweifel/git-auto-commit-action@v5
- uses: pre-commit/action@v3.0.1
with:
extra_args: --all-files
- uses: pre-commit-ci/lite-action@v1.0.2
if: always()
with:
commit_message: Apply automatic formatting
msg: Apply automatic formatting

tests:
name: Tests
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.5.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
2 changes: 1 addition & 1 deletion .github/workflows/python-version-ci
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.9
3.10
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/gh-action-pypi-publish@v1.8.10
- uses: actions/download-artifact@v4
- uses: pypa/gh-action-pypi-publish@v1.8.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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ docs/generated/
*.raw
*.cif
*.rcif
*.ort
12 changes: 11 additions & 1 deletion conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +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.9
- python>=3.10

{% for package in dependencies %}
- {% 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>).
31 changes: 25 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
import doctest
import os
import sys

import sciline
from importlib.metadata import version as get_version

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

Expand All @@ -23,13 +22,22 @@
'sphinx.ext.intersphinx',
'sphinx.ext.mathjax',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
'sphinx_autodoc_typehints',
'sphinx_copybutton',
'sphinx_design',
'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 All @@ -54,6 +62,7 @@
intersphinx_mapping = {
'python': ('https://docs.python.org/3', None),
'numpy': ('https://numpy.org/doc/stable/', None),
'scipp': ('https://scipp.github.io/', None),
}

# autodocs includes everything, even irrelevant API internals. autosummary
Expand All @@ -73,6 +82,18 @@
typehints_defaults = 'comma'
typehints_use_rtype = False


sciline_domain_types_prefix = 'sciline'
sciline_domain_types_aliases = {
'scipp._scipp.core.DataArray': 'scipp.DataArray',
'scipp._scipp.core.Dataset': 'scipp.Dataset',
'scipp._scipp.core.DType': 'scipp.DType',
'scipp._scipp.core.Unit': 'scipp.Unit',
'scipp._scipp.core.Variable': 'scipp.Variable',
'scipp.core.data_group.DataGroup': 'scipp.DataGroup',
}


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

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

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

warning_is_error = True

Expand Down
2 changes: 1 addition & 1 deletion docs/developer/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Alternatively, if you want a different workflow, take a look at ``tox.ini`` or `
Run the tests using

```sh
tox -e py39
tox -e py310
```

(or just `tox` if you want to run all environments).
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
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@ classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering",
"Typing :: Typed",
]
requires-python = ">=3.9"
requires-python = ">=3.10"

# IMPORTANT:
# Run 'tox -e deps' after making changes here. This will update requirement files.
Expand All @@ -47,6 +46,7 @@ minversion = "7.0"
addopts = """
--strict-config
--strict-markers
--import-mode=importlib
-ra
-v
"""
Expand Down
7 changes: 2 additions & 5 deletions requirements/base.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Temporary until questionary (dep of copier) updates
# See https://github.com/tmbo/questionary/blob/2df265534f3eb77aafcf70902e53e80beb1793e0/pyproject.toml#L36C43-L36C110
prompt-toolkit==3.0.36
# Temporary pinned until prompt-tookit conflict is resolved.
ipython==8.9.0
# 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!

Loading