diff --git a/.copier-answers.yml b/.copier-answers.yml index 09abe54..5689fe2 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,10 +1,12 @@ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY -_commit: 0c002dc +_commit: d9ab46a _src_path: gh:scipp/copier_template description: Reflectometry data reduction for the European Spallation Source -github_linux_image: ubuntu-20.04 -max_python: '3.11' -min_python: '3.10' +max_python: '3.12' +min_python: '3.8' +namespace_package: '' +nightly_deps: plopp,sciline,scippneutron,scippnexus,scipp orgname: scipp projectname: essreflectometry +related_projects: Scipp,ScippNexus,ScippNeutron,Sciline,Plopp year: 2023 diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 4a4bf11..c8076bb 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,13 +1,9 @@ version: 2 updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" - ignore: - # Optional: Official actions have moving tags like v1; - # if you use those, you don't need updates. - - dependency-name: "actions/*" + # Note: We are not listing package-ecosystem: "github-actions". This causes + # noise in all template instances. Instead dependabot.yml in scipp/copier_template + # triggers updates of github-actions in the *template*. We then use `copier update` + # in template instances. - package-ecosystem: "pip" directory: "/requirements" schedule: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 42ddaa0..0d294d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,11 +14,19 @@ jobs: formatting: name: Formatting and static analysis runs-on: 'ubuntu-20.04' + outputs: + min_python: ${{ steps.vars.outputs.min_python }} + min_tox_env: ${{ steps.vars.outputs.min_tox_env }} steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 + - 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 + echo "min_tox_env=py$(cat .github/workflows/python-version-ci | sed 's/\.//g')" >> $GITHUB_OUTPUT + - uses: actions/setup-python@v4 with: - python-version: '3.8' + 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 @@ -33,9 +41,8 @@ jobs: matrix: os: ['ubuntu-20.04'] python: - - version: '3.8' - tox-env: 'py38' - + - version: '${{needs.formatting.outputs.min_python}}' + tox-env: '${{needs.formatting.outputs.min_tox_env}}' uses: ./.github/workflows/test.yml with: os-variant: ${{ matrix.os }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 9c66ac7..9dd22f1 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,7 +1,6 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2023 Scipp contributors (https://github.com/scipp) - name: Docs on: @@ -42,21 +41,17 @@ jobs: name: Build documentation runs-on: 'ubuntu-20.04' steps: - - run: sudo apt install --yes graphviz pandoc - uses: actions/checkout@v3 with: ref: ${{ inputs.branch == '' && github.ref_name || inputs.branch }} fetch-depth: 0 # history required so cmake can determine version - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v4 with: - - python-version: '3.8' + 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 --skip-pkg-install -e docs -- essreflectometry==${VERSION} - + - run: tox -e releasedocs -- ${VERSION} if: ${{ inputs.version != '' }} - run: tox -e docs if: ${{ inputs.version == '' }} @@ -72,4 +67,3 @@ jobs: folder: html single-commit: true ssh-key: ${{ secrets.GH_PAGES_DEPLOY_KEY }} - diff --git a/.github/workflows/nightly_at_main.yml b/.github/workflows/nightly_at_main.yml new file mode 100644 index 0000000..67d31d8 --- /dev/null +++ b/.github/workflows/nightly_at_main.yml @@ -0,0 +1,36 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2023 Scipp contributors (https://github.com/scipp) + +name: Nightly test at main branch + +on: + workflow_dispatch: + schedule: + - cron: '30 23 * * *' + +jobs: + setup: + name: Setup variables + runs-on: 'ubuntu-20.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 + + tests: + name: Tests + needs: setup + strategy: + matrix: + os: ['ubuntu-20.04'] + python: + - version: '${{needs.setup.outputs.min_python}}' + tox-env: 'nightly' + uses: ./.github/workflows/test.yml + with: + os-variant: ${{ matrix.os }} + python-version: ${{ matrix.python.version }} + tox-env: ${{ matrix.python.tox-env }} diff --git a/.github/workflows/nightly_at_release.yml b/.github/workflows/nightly_at_release.yml new file mode 100644 index 0000000..b424c66 --- /dev/null +++ b/.github/workflows/nightly_at_release.yml @@ -0,0 +1,43 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2023 Scipp contributors (https://github.com/scipp) + +name: Nightly tests at latest release + +on: + workflow_dispatch: + schedule: + - cron: '0 23 * * *' + +jobs: + setup: + name: Setup variables + runs-on: 'ubuntu-20.04' + outputs: + min_python: ${{ steps.vars.outputs.min_python }} + release_tag: ${{ steps.release.outputs.release_tag }} + steps: + - uses: actions/checkout@v4 + with: + 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 + - name: Get Python version for other CI jobs + id: vars + run: echo "min_python=$(cat .github/workflows/python-version-ci)" >> $GITHUB_OUTPUT + + tests: + name: Tests + needs: setup + strategy: + matrix: + os: ['ubuntu-20.04'] + python: + - version: '${{needs.setup.outputs.min_python}}' + tox-env: 'nightly' + uses: ./.github/workflows/test.yml + with: + os-variant: ${{ matrix.os }} + python-version: ${{ matrix.python.version }} + tox-env: ${{ matrix.python.tox-env }} + checkout_ref: ${{ needs.setup.outputs.release_tag }} diff --git a/.github/workflows/python-version-ci b/.github/workflows/python-version-ci new file mode 100644 index 0000000..cc1923a --- /dev/null +++ b/.github/workflows/python-version-ci @@ -0,0 +1 @@ +3.8 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3280899..223dd5a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,21 +21,20 @@ jobs: - uses: actions/checkout@v3 with: submodules: true - fetch-depth: 0 # history required so cmake can determine version + fetch-depth: 0 # history required so setuptools_scm can determine version - uses: mamba-org/setup-micromamba@v1 with: environment-name: build-env create-args: >- - python=3.8 conda-build boa - - run: conda mambabuild --channel conda-forge --channel scipp --python=3.8 --no-anaconda-upload --override-channels --output-folder conda/package conda + - run: conda mambabuild --channel conda-forge --channel scipp --no-anaconda-upload --override-channels --output-folder conda/package conda - uses: actions/upload-artifact@v3 with: name: conda-package-noarch - path: conda/package/*/essreflectometry*.tar.bz2 + path: conda/package/noarch/*.tar.bz2 build_wheels: name: Wheels @@ -46,9 +45,9 @@ jobs: with: fetch-depth: 0 # history required so setuptools_scm can determine version - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v4 with: - python-version: '3.8' + python-version-file: '.github/workflows/python-version-ci' - run: python -m pip install --upgrade pip - run: python -m pip install -r requirements/wheels.txt @@ -85,11 +84,11 @@ jobs: - uses: mamba-org/setup-micromamba@v1 with: environment-name: upload-env + # frozen python due to breaking removal of 'imp' in 3.12 create-args: >- - python=3.8 anaconda-client - - - run: anaconda --token ${{ secrets.ANACONDATOKEN }} upload --user scipp --label main $(ls conda-package-*/*/*.tar.bz2) + python=3.11 + - run: anaconda --token ${{ secrets.ANACONDATOKEN }} upload --user scipp --label main $(ls conda-package-noarch/*.tar.bz2) docs: needs: [upload_conda, upload_pypi] @@ -98,14 +97,12 @@ jobs: publish: ${{ github.event_name == 'release' && github.event.action == 'published' }} secrets: inherit - assets: name: Upload docs needs: docs runs-on: 'ubuntu-20.04' permissions: contents: write # This is needed so that the action can upload the asset - steps: - uses: actions/download-artifact@v3 - name: Zip documentation @@ -117,4 +114,3 @@ jobs: with: file: ./documentation-${{ github.ref_name }}.zip overwrite: false - diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ee40602..8ce71be 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,6 @@ on: default: 'ubuntu-20.04' type: string python-version: - default: '3.8' type: string tox-env: default: 'test' @@ -21,13 +20,15 @@ on: coverage-report: default: false type: boolean + checkout_ref: + default: '' + type: string workflow_call: inputs: os-variant: default: 'ubuntu-20.04' type: string python-version: - default: '3.8' type: string tox-env: default: 'test' @@ -38,6 +39,9 @@ on: coverage-report: default: false type: boolean + checkout_ref: + default: '' + type: string jobs: test: @@ -45,6 +49,8 @@ jobs: steps: - uses: actions/checkout@v3 + with: + ref: ${{ inputs.checkout_ref }} - uses: actions/setup-python@v3 with: python-version: ${{ inputs.python-version }} @@ -56,4 +62,3 @@ jobs: with: name: CoverageReport path: coverage_html/ - diff --git a/docs/about/index.md b/docs/about/index.md index 059a149..161c35d 100644 --- a/docs/about/index.md +++ b/docs/about/index.md @@ -8,6 +8,14 @@ Essreflectometry is an open source project by the [European Spallation Source ER Essreflectometry is available as open source under the [BSD-3 license](https://opensource.org/licenses/BSD-3-Clause). +## Citing Essreflectometry + +Please cite the following: + +[![DOI](https://zenodo.org/badge/FIXME.svg)](https://zenodo.org/doi/10.5281/zenodo.FIXME) + +To cite a specific version of Essreflectometry, select the desired version on Zenodo to get the corresponding DOI. + ## Older versions of the documentation Older versions of the documentation pages can be found under the assets of each [release](https://github.com/scipp/essreflectometry/releases). diff --git a/docs/conf.py b/docs/conf.py index 46b586a..6bfc0cc 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -122,6 +122,7 @@ "primary_sidebar_end": ["edit-this-page", "sourcelink"], "secondary_sidebar_items": [], "show_nav_level": 1, + # Adjust this to ensure external links are moved to "Move" menu "header_links_before_dropdown": 4, "pygment_light_style": "github-light-high-contrast", "pygment_dark_style": "github-dark-high-contrast", @@ -129,7 +130,13 @@ "image_light": "_static/logo.svg", "image_dark": "_static/logo-dark.svg", }, - "external_links": [], + "external_links": [ + {"name": "Plopp", "url": "https://scipp.github.io/plopp"}, + {"name": "Sciline", "url": "https://scipp.github.io/sciline"}, + {"name": "Scipp", "url": "https://scipp.github.io"}, + {"name": "ScippNeutron", "url": "https://scipp.github.io/scippneutron"}, + {"name": "ScippNexus", "url": "https://scipp.github.io/scippnexus"}, + ], "icon_links": [ { "name": "GitHub", diff --git a/docs/developer/getting-started.md b/docs/developer/getting-started.md index 70b797c..88e1036 100644 --- a/docs/developer/getting-started.md +++ b/docs/developer/getting-started.md @@ -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 py310 +tox -e py38 ``` (or just `tox` if you want to run all environments). diff --git a/pyproject.toml b/pyproject.toml index 27c49bf..73eefb7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [build-system] requires = [ - "setuptools>=67", - "setuptools_scm[toml]>=7.0", + "setuptools>=68", + "setuptools_scm[toml]>=8.0", ] build-backend = "setuptools.build_meta" @@ -22,10 +22,15 @@ classifiers = [ "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.8" + +# IMPORTANT: +# Run 'tox -e deps' after making changes here. This will update requirement files. +# Make sure to list one dependency per line. dependencies = [ "dask", "graphviz", @@ -36,6 +41,7 @@ dependencies = [ "scipp>=23.8.0", "scippneutron>=23.9.0", ] + dynamic = ["version"] [project.urls] diff --git a/requirements/base.in b/requirements/base.in index e69de29..03077f5 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -0,0 +1,9 @@ +# Generated by 'tox -e deps', DO NOT EDIT MANUALLY!' +dask +graphviz +plopp +pythreejs +orsopy +sciline>=23.9.1 +scipp>=23.8.0 +scippneutron>=23.9.0 \ No newline at end of file diff --git a/requirements/base.txt b/requirements/base.txt index c24fd27..4f77ca1 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,8 +1,176 @@ -# SHA1:da39a3ee5e6b4b0d3255bfef95601890afd80709 +# SHA1:1c8f560626b4a08121d239f240439127b1844782 # # This file is autogenerated by pip-compile-multi # To update, run: # # pip-compile-multi # - +asttokens==2.4.0 + # via stack-data +backcall==0.2.0 + # via ipython +certifi==2023.7.22 + # via requests +charset-normalizer==3.3.1 + # via requests +click==8.1.7 + # via dask +cloudpickle==3.0.0 + # via dask +comm==0.1.4 + # via ipywidgets +confuse==2.0.1 + # via scipp +contourpy==1.1.1 + # via matplotlib +cycler==0.12.1 + # via matplotlib +dask==2023.5.0 + # via -r base.in +decorator==5.1.1 + # via ipython +executing==2.0.0 + # via stack-data +fonttools==4.43.1 + # via matplotlib +fsspec==2023.10.0 + # via dask +graphlib-backport==1.0.3 + # via + # sciline + # scipp +graphviz==0.20.1 + # via -r base.in +h5py==3.10.0 + # via + # scippneutron + # scippnexus +idna==3.4 + # via requests +importlib-metadata==6.8.0 + # via dask +importlib-resources==6.1.0 + # via matplotlib +ipydatawidgets==4.3.5 + # via pythreejs +ipython==8.12.3 + # via ipywidgets +ipywidgets==8.1.1 + # via + # ipydatawidgets + # pythreejs +jedi==0.19.1 + # via ipython +jupyterlab-widgets==3.0.9 + # via ipywidgets +kiwisolver==1.4.5 + # via matplotlib +locket==1.0.0 + # via partd +matplotlib==3.7.3 + # via plopp +matplotlib-inline==0.1.6 + # via ipython +numpy==1.24.4 + # via + # contourpy + # h5py + # ipydatawidgets + # matplotlib + # pythreejs + # scipp + # scippneutron + # scipy +orsopy==1.1.0 + # via -r base.in +packaging==23.2 + # via + # dask + # matplotlib + # pooch +parso==0.8.3 + # via jedi +partd==1.4.1 + # via dask +pexpect==4.8.0 + # via ipython +pickleshare==0.7.5 + # via ipython +pillow==10.1.0 + # via matplotlib +platformdirs==3.11.0 + # via pooch +plopp==23.10.1 + # via -r base.in +pooch==1.8.0 + # via scippneutron +prompt-toolkit==3.0.39 + # via ipython +ptyprocess==0.7.0 + # via pexpect +pure-eval==0.2.2 + # via stack-data +pygments==2.16.1 + # via ipython +pyparsing==3.1.1 + # via matplotlib +python-dateutil==2.8.2 + # via + # matplotlib + # scippnexus +pythreejs==2.4.2 + # via -r base.in +pyyaml==6.0.1 + # via + # confuse + # dask + # orsopy +requests==2.31.0 + # via pooch +sciline==23.9.1 + # via -r base.in +scipp==23.8.0 + # via + # -r base.in + # scippneutron + # scippnexus +scippneutron==23.9.0 + # via -r base.in +scippnexus==23.8.0 + # via scippneutron +scipy==1.10.1 + # via + # scippneutron + # scippnexus +six==1.16.0 + # via + # asttokens + # python-dateutil +stack-data==0.6.3 + # via ipython +toolz==0.12.0 + # via + # dask + # partd +traitlets==5.12.0 + # via + # comm + # ipython + # ipywidgets + # matplotlib-inline + # pythreejs + # traittypes +traittypes==0.2.1 + # via ipydatawidgets +typing-extensions==4.8.0 + # via ipython +urllib3==2.0.7 + # via requests +wcwidth==0.2.8 + # via prompt-toolkit +widgetsnbextension==4.0.9 + # via ipywidgets +zipp==3.17.0 + # via + # importlib-metadata + # importlib-resources diff --git a/requirements/ci.txt b/requirements/ci.txt index 5d62dbc..0efd86c 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -5,13 +5,13 @@ # # pip-compile-multi # -cachetools==5.3.1 +cachetools==5.3.2 # via tox certifi==2023.7.22 # via requests chardet==5.2.0 # via tox -charset-normalizer==3.3.0 +charset-normalizer==3.3.1 # via requests colorama==0.4.6 # via tox @@ -21,9 +21,9 @@ filelock==3.12.4 # via # tox # virtualenv -gitdb==4.0.10 +gitdb==4.0.11 # via gitpython -gitpython==3.1.37 +gitpython==3.1.40 # via -r ci.in idna==3.4 # via requests @@ -50,7 +50,7 @@ tomli==2.0.1 # tox tox==4.11.3 # via -r ci.in -urllib3==2.0.6 +urllib3==2.0.7 # via requests -virtualenv==20.24.5 +virtualenv==20.24.6 # via tox diff --git a/requirements/dev.txt b/requirements/dev.txt index 43c573b..5acbba4 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -24,10 +24,6 @@ async-lru==2.0.4 # via jupyterlab cffi==1.16.0 # via argon2-cffi-bindings -click==8.1.7 - # via - # pip-compile-multi - # pip-tools fqdn==1.5.1 # via jsonschema isoduration==20.11.0 @@ -41,11 +37,11 @@ jsonschema[format-nongpl]==4.19.1 # jupyter-events # jupyterlab-server # nbformat -jupyter-events==0.7.0 +jupyter-events==0.8.0 # via jupyter-server jupyter-lsp==2.2.0 # via jupyterlab -jupyter-server==2.7.3 +jupyter-server==2.9.0 # via # jupyter-lsp # jupyterlab @@ -53,7 +49,7 @@ jupyter-server==2.7.3 # notebook-shim jupyter-server-terminals==0.4.4 # via jupyter-server -jupyterlab==4.0.6 +jupyterlab==4.0.7 # via -r dev.in jupyterlab-server==2.25.0 # via jupyterlab diff --git a/requirements/docs.txt b/requirements/docs.txt index 44b2968..8bb53c6 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -12,36 +12,24 @@ alabaster==0.7.13 # via sphinx annotated-types==0.6.0 # via pydantic -asttokens==2.4.0 - # via stack-data attrs==23.1.0 # via # jsonschema # referencing autodoc-pydantic==2.0.1 # via -r docs.in -babel==2.13.0 +babel==2.13.1 # via # pydata-sphinx-theme # sphinx -backcall==0.2.0 - # via ipython beautifulsoup4==4.12.2 # via # nbconvert # pydata-sphinx-theme bleach==6.1.0 # via nbconvert -certifi==2023.7.22 - # via requests -charset-normalizer==3.3.0 - # via requests -comm==0.1.4 - # via ipykernel debugpy==1.8.0 # via ipykernel -decorator==5.1.1 - # via ipython defusedxml==0.7.1 # via nbconvert docutils==0.20.1 @@ -50,32 +38,12 @@ docutils==0.20.1 # nbsphinx # pydata-sphinx-theme # sphinx -executing==2.0.0 - # via stack-data fastjsonschema==2.18.1 # via nbformat -idna==3.4 - # via requests imagesize==1.4.1 # via sphinx -importlib-metadata==6.8.0 - # via - # autodoc-pydantic - # jupyter-client - # nbconvert - # sphinx -importlib-resources==6.1.0 - # via - # jsonschema - # jsonschema-specifications -ipykernel==6.25.2 +ipykernel==6.26.0 # via -r docs.in -ipython==8.12.3 - # via - # -r docs.in - # ipykernel -jedi==0.19.1 - # via ipython jinja2==3.1.2 # via # myst-parser @@ -86,11 +54,11 @@ jsonschema==4.19.1 # via nbformat jsonschema-specifications==2023.7.1 # via jsonschema -jupyter-client==8.3.1 +jupyter-client==8.5.0 # via # ipykernel # nbclient -jupyter-core==5.3.2 +jupyter-core==5.4.0 # via # ipykernel # jupyter-client @@ -107,10 +75,6 @@ markupsafe==2.1.3 # via # jinja2 # nbconvert -matplotlib-inline==0.1.6 - # via - # ipykernel - # ipython mdit-py-plugins==0.4.0 # via myst-parser mdurl==0.1.2 @@ -132,32 +96,12 @@ nbsphinx==0.9.3 # via -r docs.in nest-asyncio==1.5.8 # via ipykernel -packaging==23.2 - # via - # ipykernel - # nbconvert - # pydata-sphinx-theme - # sphinx pandocfilters==1.5.0 # via nbconvert -parso==0.8.3 - # via jedi -pexpect==4.8.0 - # via ipython -pickleshare==0.7.5 - # via ipython pkgutil-resolve-name==1.3.10 # via jsonschema -platformdirs==3.11.0 - # via jupyter-core -prompt-toolkit==3.0.39 - # via ipython -psutil==5.9.5 +psutil==5.9.6 # via ipykernel -ptyprocess==0.7.0 - # via pexpect -pure-eval==0.2.2 - # via stack-data pydantic==2.4.2 # via # autodoc-pydantic @@ -166,23 +110,12 @@ pydantic-core==2.10.1 # via pydantic pydantic-settings==2.0.3 # via autodoc-pydantic -pydata-sphinx-theme==0.14.1 +pydata-sphinx-theme==0.14.2 # via -r docs.in -pygments==2.16.1 - # via - # accessible-pygments - # ipython - # nbconvert - # pydata-sphinx-theme - # sphinx -python-dateutil==2.8.2 - # via jupyter-client python-dotenv==1.0.0 # via pydantic-settings pytz==2023.3.post1 # via babel -pyyaml==6.0.1 - # via myst-parser pyzmq==25.1.1 # via # ipykernel @@ -191,17 +124,10 @@ referencing==0.30.2 # via # jsonschema # jsonschema-specifications -requests==2.31.0 - # via sphinx -rpds-py==0.10.4 +rpds-py==0.10.6 # via # jsonschema # referencing -six==1.16.0 - # via - # asttokens - # bleach - # python-dateutil snowballstemmer==2.2.0 # via sphinx soupsieve==2.5 @@ -234,42 +160,13 @@ sphinxcontrib-qthelp==1.0.3 # via sphinx sphinxcontrib-serializinghtml==1.1.5 # via sphinx -stack-data==0.6.3 - # via ipython tinycss2==1.2.1 # via nbconvert tornado==6.3.3 # via # ipykernel # jupyter-client -traitlets==5.11.2 - # via - # comm - # ipykernel - # ipython - # jupyter-client - # jupyter-core - # matplotlib-inline - # nbclient - # nbconvert - # nbformat - # nbsphinx -typing-extensions==4.8.0 - # via - # annotated-types - # ipython - # pydantic - # pydantic-core - # pydata-sphinx-theme -urllib3==2.0.6 - # via requests -wcwidth==0.2.8 - # via prompt-toolkit webencodings==0.5.1 # via # bleach # tinycss2 -zipp==3.17.0 - # via - # importlib-metadata - # importlib-resources diff --git a/requirements/make_base.py b/requirements/make_base.py new file mode 100644 index 0000000..27a23c2 --- /dev/null +++ b/requirements/make_base.py @@ -0,0 +1,48 @@ +import sys +from argparse import ArgumentParser + +import tomli + +parser = ArgumentParser() +parser.add_argument( + "--nightly", + default="", + help="List of dependencies to install from main branch for nightly tests, " + "separated by commas.", +) +args = parser.parse_args() + +header = "# Generated by 'tox -e deps', DO NOT EDIT MANUALLY!'\n" + +with open("../pyproject.toml", "rb") as toml_file: + pyproject = tomli.load(toml_file) + dependencies = pyproject["project"].get("dependencies") + if not dependencies: + raise RuntimeError("No dependencies found in pyproject.toml") + dependencies = [dep.strip().strip('"') for dep in dependencies] + +with open("base.in", "w") as f: + f.write(header) + f.write("\n".join(dependencies)) + + +def as_nightly(repo: str) -> str: + if "/" in repo: + org, repo = repo.split("/") + else: + org = "scipp" + if repo == "scipp": + version = f"cp{sys.version_info.major}{sys.version_info.minor}" + base = "https://github.com/scipp/scipp/releases/download/nightly/scipp-nightly" + suffix = "manylinux_2_17_x86_64.manylinux2014_x86_64.whl" + return "-".join([base, version, version, suffix]) + return f"{repo} @ git+https://github.com/{org}/{repo}@main" + + +nightly = args.nightly.split(",") if args.nightly else [] +dependencies = [dep for dep in dependencies if not dep.startswith(tuple(nightly))] +dependencies += [as_nightly(arg) for arg in nightly] + +with open("nightly.in", "w") as f: + f.write(header) + f.write("\n".join(dependencies)) diff --git a/requirements/mypy.txt b/requirements/mypy.txt index e01bb3a..4f4b58a 100644 --- a/requirements/mypy.txt +++ b/requirements/mypy.txt @@ -6,9 +6,7 @@ # pip-compile-multi # -r test.txt -mypy==1.5.1 +mypy==1.6.1 # via -r mypy.in mypy-extensions==1.0.0 # via mypy -typing-extensions==4.8.0 - # via mypy diff --git a/requirements/nightly.in b/requirements/nightly.in new file mode 100644 index 0000000..d68d35b --- /dev/null +++ b/requirements/nightly.in @@ -0,0 +1,10 @@ +# Generated by 'tox -e deps', DO NOT EDIT MANUALLY!' +dask +graphviz +pythreejs +orsopy +plopp @ git+https://github.com/scipp/plopp@main +sciline @ git+https://github.com/scipp/sciline@main +scippneutron @ git+https://github.com/scipp/scippneutron@main +scippnexus @ git+https://github.com/scipp/scippnexus@main +https://github.com/scipp/scipp/releases/download/nightly/scipp-nightly-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl \ No newline at end of file diff --git a/requirements/nightly.txt b/requirements/nightly.txt new file mode 100644 index 0000000..89faab1 --- /dev/null +++ b/requirements/nightly.txt @@ -0,0 +1,175 @@ +# SHA1:f2143c680cfed321ce4ddf45566561733e74c9d8 +# +# This file is autogenerated by pip-compile-multi +# To update, run: +# +# pip-compile-multi +# +asttokens==2.4.0 + # via stack-data +backcall==0.2.0 + # via ipython +certifi==2023.7.22 + # via requests +charset-normalizer==3.3.1 + # via requests +click==8.1.7 + # via dask +cloudpickle==3.0.0 + # via dask +comm==0.1.4 + # via ipywidgets +contourpy==1.1.1 + # via matplotlib +cycler==0.12.1 + # via matplotlib +dask==2023.5.0 + # via -r nightly.in +decorator==5.1.1 + # via ipython +executing==2.0.0 + # via stack-data +fonttools==4.43.1 + # via matplotlib +fsspec==2023.10.0 + # via dask +graphlib-backport==1.0.3 + # via + # sciline + # scipp +graphviz==0.20.1 + # via -r nightly.in +h5py==3.10.0 + # via + # scippneutron + # scippnexus +idna==3.4 + # via requests +importlib-metadata==6.8.0 + # via dask +importlib-resources==6.1.0 + # via matplotlib +ipydatawidgets==4.3.5 + # via pythreejs +ipython==8.12.3 + # via ipywidgets +ipywidgets==8.1.1 + # via + # ipydatawidgets + # pythreejs +jedi==0.19.1 + # via ipython +jupyterlab-widgets==3.0.9 + # via ipywidgets +kiwisolver==1.4.5 + # via matplotlib +locket==1.0.0 + # via partd +matplotlib==3.7.3 + # via plopp +matplotlib-inline==0.1.6 + # via ipython +numpy==1.24.4 + # via + # contourpy + # h5py + # ipydatawidgets + # matplotlib + # pythreejs + # scipp + # scippneutron + # scipy +orsopy==1.1.0 + # via -r nightly.in +packaging==23.2 + # via + # dask + # matplotlib + # pooch +parso==0.8.3 + # via jedi +partd==1.4.1 + # via dask +pexpect==4.8.0 + # via ipython +pickleshare==0.7.5 + # via ipython +pillow==10.1.0 + # via matplotlib +platformdirs==3.11.0 + # via pooch +plopp @ git+https://github.com/scipp/plopp@main + # via -r nightly.in +pooch==1.8.0 + # via scippneutron +prompt-toolkit==3.0.39 + # via ipython +ptyprocess==0.7.0 + # via pexpect +pure-eval==0.2.2 + # via stack-data +pygments==2.16.1 + # via ipython +pyparsing==3.1.1 + # via matplotlib +python-dateutil==2.8.2 + # via + # matplotlib + # scippnexus +pythreejs==2.4.2 + # via -r nightly.in +pyyaml==6.0.1 + # via + # dask + # orsopy +requests==2.31.0 + # via pooch +sciline @ git+https://github.com/scipp/sciline@main + # via -r nightly.in +scipp @ https://github.com/scipp/scipp/releases/download/nightly/scipp-nightly-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl + # via + # -r nightly.in + # scippneutron + # scippnexus +scippneutron @ git+https://github.com/scipp/scippneutron@main + # via -r nightly.in +scippnexus @ git+https://github.com/scipp/scippnexus@main + # via + # -r nightly.in + # scippneutron +scipy==1.10.1 + # via + # scippneutron + # scippnexus +six==1.16.0 + # via + # asttokens + # python-dateutil +stack-data==0.6.3 + # via ipython +toolz==0.12.0 + # via + # dask + # partd +traitlets==5.12.0 + # via + # comm + # ipython + # ipywidgets + # matplotlib-inline + # pythreejs + # traittypes +traittypes==0.2.1 + # via ipydatawidgets +typing-extensions==4.8.0 + # via ipython +urllib3==2.0.7 + # via requests +wcwidth==0.2.8 + # via prompt-toolkit +widgetsnbextension==4.0.9 + # via ipywidgets +zipp==3.17.0 + # via + # importlib-metadata + # importlib-resources diff --git a/requirements/static.txt b/requirements/static.txt index cfb05f0..11418f2 100644 --- a/requirements/static.txt +++ b/requirements/static.txt @@ -17,11 +17,11 @@ nodeenv==1.8.0 # via pre-commit platformdirs==3.11.0 # via virtualenv -pre-commit==3.4.0 +pre-commit==3.5.0 # via -r static.in pyyaml==6.0.1 # via pre-commit -virtualenv==20.24.5 +virtualenv==20.24.6 # via pre-commit # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/test.txt b/requirements/test.txt index fbbe0d0..0139655 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -10,11 +10,9 @@ exceptiongroup==1.1.3 # via pytest iniconfig==2.0.0 # via pytest -packaging==23.2 - # via pytest pluggy==1.3.0 # via pytest -pytest==7.4.2 +pytest==7.4.3 # via -r test.in tomli==2.0.1 # via pytest diff --git a/setup.cfg b/setup.cfg index de13363..1ba190c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,15 +1,3 @@ -[options] -package_dir = - = src -packages = find: -include_package_data = True - -[options.packages.find] -where = src - -[options.package_data] -essreflectometry = py.typed - [flake8] # See https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#line-length max-line-length = 88 diff --git a/src/essreflectometry/__init__.py b/src/essreflectometry/__init__.py index 12c1916..6d115cc 100644 --- a/src/essreflectometry/__init__.py +++ b/src/essreflectometry/__init__.py @@ -8,3 +8,5 @@ __version__ = importlib.metadata.version(__package__ or __name__) except importlib.metadata.PackageNotFoundError: __version__ = "0.0.0" + +del importlib diff --git a/tox.ini b/tox.ini index 0573b76..2d5cdb1 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py310 +envlist = py38 isolated_build = true [testenv] @@ -8,20 +8,29 @@ setenv = JUPYTER_PLATFORM_DIRS = 1 commands = pytest +[testenv:nightly] +deps = + -r requirements/nightly.txt + pytest +commands = pytest + [testenv:docs] description = invoke sphinx-build to build the HTML docs -deps = - {posargs:} - -r requirements/docs.txt +deps = -r requirements/docs.txt allowlist_externals=find -setenv = - {[testenv]setenv} - # Search directory for confuse for custom config enabling plopp plotting - SCIPPDIR={toxinidir}{/}docs{/}buildconfig commands = python -m sphinx -j2 -v -b html -d {toxworkdir}/docs_doctrees docs html python -m sphinx -j2 -v -b doctest -d {toxworkdir}/docs_doctrees docs html find html -type f -name "*.ipynb" -not -path "html/_sources/*" -delete +[testenv:releasedocs] +description = invoke sphinx-build to build the HTML docs from a released version +skip_install = true +deps = + essreflectometry=={posargs} + {[testenv:docs]deps} +allowlist_externals={[testenv:docs]allowlist_externals} +commands = {[testenv:docs]commands} + [testenv:linkcheck] description = Run Sphinx linkcheck deps = -r requirements/docs.txt @@ -44,7 +53,10 @@ commands = python -m mypy . [testenv:deps] description = Update dependencies by running pip-compile-multi -deps = pip-compile-multi +deps = + pip-compile-multi + tomli skip_install = true changedir = requirements -commands = pip-compile-multi -d . +commands = python ./make_base.py --nightly plopp,sciline,scippneutron,scippnexus,scipp + pip-compile-multi -d .