From 9379d405f2665d64967ce994298f0994be67f616 Mon Sep 17 00:00:00 2001 From: Stefan Appelhoff Date: Mon, 18 Nov 2024 23:31:37 +0100 Subject: [PATCH] intersphinx_registry, tomlsort, bump py min --- .github/workflows/python_build.yml | 3 - .github/workflows/python_publish.yml | 2 +- .github/workflows/python_tests.yml | 25 +++++---- .pre-commit-config.yaml | 6 ++ .readthedocs.yaml | 4 +- LICENSE | 2 +- README.rst | 2 +- docs/authors.rst | 10 ++++ docs/changelog.rst | 13 +---- docs/conf.py | 18 ++++-- docs/index.rst | 3 +- pyproject.toml | 84 +++++++++++++++------------- 12 files changed, 96 insertions(+), 76 deletions(-) create mode 100644 docs/authors.rst diff --git a/.github/workflows/python_build.yml b/.github/workflows/python_build.yml index aec027a..65d7d34 100644 --- a/.github/workflows/python_build.yml +++ b/.github/workflows/python_build.yml @@ -9,9 +9,6 @@ on: branches: [main] pull_request: branches: [main] - create: - branches: [main] - tags: ['**'] schedule: - cron: "0 4 1 * *" diff --git a/.github/workflows/python_publish.yml b/.github/workflows/python_publish.yml index f9064ed..bc056b1 100644 --- a/.github/workflows/python_publish.yml +++ b/.github/workflows/python_publish.yml @@ -17,7 +17,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: "3.12" - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/python_tests.yml b/.github/workflows/python_tests.yml index f3c4c01..bfc67a1 100644 --- a/.github/workflows/python_tests.yml +++ b/.github/workflows/python_tests.yml @@ -9,9 +9,6 @@ on: branches: [main] pull_request: branches: [main] - create: - branches: [main] - tags: ['**'] schedule: - cron: "0 4 1 * *" @@ -21,8 +18,16 @@ jobs: strategy: fail-fast: false matrix: - platform: [ubuntu-22.04, ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.10", "3.11", "3.12"] + platform: [ubuntu-latest, macos-latest, windows-latest] + python-version: ["3.10", "3.12"] + mne-version: [mne-stable] + + include: + # special test runs running only on single CI systems to save resources + # Test development versions + - platform: ubuntu-latest + python-version: "3.12" + mne-version: mne-main env: TZ: Europe/Berlin @@ -44,9 +49,9 @@ jobs: python -m pip install -e .[dev] - name: install MNE-Python main - if: "matrix.platform == 'ubuntu-22.04'" + if: matrix.mne-version == 'mne-main' run: | - pip install -U git+https://github.com/mne-tools/mne-python + pip install -U https://github.com/mne-tools/mne-python/archive/refs/heads/main.zip - name: Display versions and environment information run: | @@ -57,10 +62,9 @@ jobs: mne sys_info - name: Check formatting - if: ${{ matrix.platform == 'ubuntu-22.04' && matrix.python-version == '3.11' }} run: | make check-manifest - pre-commit run --all-files || ( git status --short ; git diff ; exit 1 ) + pre-commit run --all-files - name: Test with pytest run: | @@ -71,14 +75,13 @@ jobs: make build-doc - name: Upload artifacts - if: ${{ matrix.platform == 'ubuntu-22.04' && matrix.python-version == '3.11' }} + if: ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.12' }} uses: actions/upload-artifact@v4 with: name: docs-artifact path: docs/_build/html - name: Upload coverage report - if: ${{ matrix.platform == 'ubuntu-22.04' && matrix.python-version == '3.11' }} uses: codecov/codecov-action@v5 with: files: ./coverage.xml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 75fde44..d6443a6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,3 +18,9 @@ repos: - id: ruff args: [ --fix ] - id: ruff-format + +- repo: https://github.com/pappasam/toml-sort + rev: v0.23.1 + hooks: + - id: toml-sort-fix + files: pyproject.toml diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 839e9da..4b35493 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -4,9 +4,9 @@ version: 2 build: - os: ubuntu-22.04 + os: ubuntu-lts-latest tools: - python: "3.11" + python: "3.12" sphinx: configuration: docs/conf.py diff --git a/LICENSE b/LICENSE index 8f4d961..c6eabc5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2018-2023, pybv developers +Copyright (c) 2018, pybv developers All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/README.rst b/README.rst index c31af80..79f156f 100644 --- a/README.rst +++ b/README.rst @@ -77,7 +77,7 @@ as hosted by Brain Products. Installation ============ -``pybv`` runs on Python version 3.8 or higher. +``pybv`` runs on Python version 3.9 or higher. ``pybv``'s only dependency is ``numpy``. However, we currently recommend that you install MNE-Python for reading BrainVision data. diff --git a/docs/authors.rst b/docs/authors.rst new file mode 100644 index 0000000..5fc924e --- /dev/null +++ b/docs/authors.rst @@ -0,0 +1,10 @@ +.. _Adam Li: https://adam2392.github.io/ +.. _Aniket Pradhan: http://home.iiitd.edu.in/~aniket17133/ +.. _Chris Holdgraf: https://bids.berkeley.edu/people/chris-holdgraf +.. _Clemens Brunner: https://cbrnr.github.io/ +.. _Felix Klotzsche: https://github.com/eioe +.. _Phillip Alday: https://palday.bitbucket.io/ +.. _Pierre Cutellic: https://github.com/compmonks +.. _Richard Höchenberger: https://hoechenberger.net/ +.. _Stefan Appelhoff: http://stefanappelhoff.com/ +.. _Tristan Stenner: https://github.com/tstenner diff --git a/docs/changelog.rst b/docs/changelog.rst index d1160c0..e939efb 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -17,17 +17,6 @@ People who contributed to this software across releases (in **alphabetical order - `Stefan Appelhoff`_ - `Tristan Stenner`_ -.. _Chris Holdgraf: https://bids.berkeley.edu/people/chris-holdgraf -.. _Stefan Appelhoff: http://stefanappelhoff.com/ -.. _Tristan Stenner: https://github.com/tstenner -.. _Phillip Alday: https://palday.bitbucket.io/ -.. _Clemens Brunner: https://cbrnr.github.io/ -.. _Richard Höchenberger: https://hoechenberger.net/ -.. _Adam Li: https://adam2392.github.io/ -.. _Aniket Pradhan: http://home.iiitd.edu.in/~aniket17133/ -.. _Pierre Cutellic: https://github.com/compmonks -.. _Felix Klotzsche: https://github.com/eioe - .. _changelog: ========= @@ -186,3 +175,5 @@ Changelog ~~~~~~~~~ - Initial import from `philistine `_ package by `Phillip Alday`_ and removing dependency on MNE-Python, by `Chris Holdgraf`_, and `Stefan Appelhoff`_ + +.. include:: authors.rst diff --git a/docs/conf.py b/docs/conf.py index d3db897..f0f6bb7 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -6,6 +6,8 @@ import sys from datetime import date +from intersphinx_registry import get_intersphinx_mapping + import pybv curdir = os.path.dirname(__file__) @@ -45,7 +47,8 @@ # General information about the project. project = "pybv" -copyright = f"2018-{date.today().year}, pybv developers" # noqa:A001 +today = date.today().isoformat() +copyright = f"2018, pybv developers. Last updated on {today}" # noqa: A001 author = "pybv developers" version = pybv.__version__ release = version @@ -78,9 +81,12 @@ } # When functions from other packages are mentioned, link to them -intersphinx_mapping = { - "python": ("https://docs.python.org/3", None), - "mne": ("https://mne.tools/dev/", None), - "numpy": ("https://numpy.org/devdocs", None), -} +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = get_intersphinx_mapping( + packages={ + "python", + "mne", + "numpy", + } +) intersphinx_timeout = 10 diff --git a/docs/index.rst b/docs/index.rst index 531a650..10e6ce9 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -4,4 +4,5 @@ :hidden: :glob: - * + api.rst + changelog.rst diff --git a/pyproject.toml b/pyproject.toml index 4d6e83a..5f83cef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,67 +1,73 @@ [build-system] -requires = ["setuptools"] build-backend = "setuptools.build_meta" +requires = ["setuptools"] [project] -name = "pybv" authors = [ - {name = "pybv developers"}, + {name = "pybv developers"}, ] -maintainers = [ - {name = "Stefan Appelhoff", email = "stefan.appelhoff@mailbox.org"}, +classifiers = [ + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "License :: OSI Approved", + "Operating System :: MacOS", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX :: Linux", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python", + "Topic :: Scientific/Engineering", + "Topic :: Scientific/Engineering", + "Topic :: Software Development", ] -description = "pybv – a lightweight I/O utility for the BrainVision data format" -keywords = ["Brain Products", "BrainVision", "vhdr", "vmrk", "eeg"] -readme = "README.rst" -license = {file = "LICENSE"} -requires-python = ">=3.8" dependencies = [ - "numpy >= 1.18.1", + "numpy >= 1.18.1", ] +description = "pybv - a lightweight I/O utility for the BrainVision data format" dynamic = ["version"] -classifiers = [ - "Topic :: Scientific/Engineering", - "Intended Audience :: Science/Research", - "Intended Audience :: Developers", - "License :: OSI Approved", - "Topic :: Software Development", - "Topic :: Scientific/Engineering", - "Operating System :: Microsoft :: Windows", - "Operating System :: POSIX :: Linux", - "Operating System :: MacOS", - "Programming Language :: Python", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", +keywords = ["Brain Products", "BrainVision", "eeg", "vhdr", "vmrk"] +license = {file = "LICENSE"} +maintainers = [ + {email = "stefan.appelhoff@mailbox.org", name = "Stefan Appelhoff"}, ] +name = "pybv" +readme = "README.rst" +requires-python = ">=3.9" [project.optional-dependencies] dev = [ - "check-manifest", - "mne", - "numpydoc", - "pre-commit", - "pytest", - "pytest-cov", - "pytest-sugar", - "ruff", - "sphinx", - "sphinx-copybutton", + "check-manifest", + "intersphinx_registry", + "mne", + "numpydoc", + "pre-commit", + "pytest", + "pytest-cov", + "pytest-sugar", + "ruff", + "sphinx", + "sphinx-copybutton", ] [project.urls] Documentation = "https://pybv.readthedocs.io" -Repository = "https://github.com/bids-standard/pybv" Issues = "https://github.com/bids-standard/pybv/issues" +Repository = "https://github.com/bids-standard/pybv" [tool.ruff.lint] -select = ["A", "B006", "D", "E", "F", "I", "W", "UP"] ignore = ["D203", "D213"] +select = ["A", "B006", "D", "E", "F", "I", "UP", "W"] [tool.setuptools.dynamic] version = {attr = "pybv.__version__"} [tool.setuptools.packages.find] exclude = ["docs", "specification"] + +[tool.tomlsort] +all = true +ignore_case = true +spaces_before_inline_comment = 2 +trailing_comma_inline_array = true