From 3e6d6a62cba16d6d0c6396d4992a1d42df50bc9c Mon Sep 17 00:00:00 2001 From: rly Date: Tue, 17 Dec 2024 18:24:34 -0800 Subject: [PATCH] Update docs, change optional deps group --- .github/PULL_REQUEST_TEMPLATE/release.md | 10 ++++------ .github/workflows/HDMF_dev.yaml | 3 +-- .github/workflows/check_external_links.yml | 3 +-- .github/workflows/run_coverage.yml | 23 +++++++++++----------- .readthedocs.yaml | 2 +- docs/source/installation.rst | 16 +++++++-------- pyproject.toml | 14 ++++++++++--- tox.ini | 8 ++++---- 8 files changed, 42 insertions(+), 37 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE/release.md b/.github/PULL_REQUEST_TEMPLATE/release.md index 0073225e..ad8663af 100644 --- a/.github/PULL_REQUEST_TEMPLATE/release.md +++ b/.github/PULL_REQUEST_TEMPLATE/release.md @@ -2,10 +2,8 @@ Prepare for release of HDMF-Zarr [version] ### Before merging: - [ ] Make sure all PRs to be included in this release have been merged to `dev`. -- [ ] Major and minor releases: Update package versions in `requirements.txt`, `requirements-dev.txt`, - `requirements-doc.txt`, and `requirements-opt.txt` to the latest versions, - and update dependency ranges in `pyproject.toml` and minimums in `requirements-min.txt` as needed. - Run `pip install pur && pur -r -d [requirements file]` to see which packages can be updated. +- [ ] Major and minor releases: Update dependency ranges in `pyproject.toml` and minimums in + `requirements-min.txt` as needed. - [ ] Check legal file dates and information in `Legal.txt`, `license.txt`, `README.rst`, `docs/source/conf.py`, and any other locations as needed - [ ] Update `pyproject.toml` as needed @@ -27,5 +25,5 @@ Prepare for release of HDMF-Zarr [version] 4. Either monitor [conda-forge/hdmf_zarr-feedstock](https://github.com/conda-forge/hdmf_zarr-feedstock) for the regro-cf-autotick-bot bot to create a PR updating the version of HDMF to the latest PyPI release, usually within 24 hours of release, or manually create a PR updating `recipe/meta.yaml` with the latest version number - and SHA256 retrieved from PyPI > HDMF-Zarr > Download Files > View hashes for the `.tar.gz` file. Re-render and update - dependencies as needed. + and SHA256 retrieved from PyPI > HDMF-Zarr > Download Files > View hashes for the `.tar.gz` file. Re-render and + update the dependencies as needed. diff --git a/.github/workflows/HDMF_dev.yaml b/.github/workflows/HDMF_dev.yaml index bbc39c5c..4500b792 100644 --- a/.github/workflows/HDMF_dev.yaml +++ b/.github/workflows/HDMF_dev.yaml @@ -19,8 +19,7 @@ jobs: - name: Install HDMF_Zarr Requirements run: | - python -m pip install -r requirements-dev.txt -r requirements.txt - pip install . + python -m pip install ".[test]" - name: Clone and Install HDMF Dev Branch run: | diff --git a/.github/workflows/check_external_links.yml b/.github/workflows/check_external_links.yml index 18c85d73..1d2e2b65 100644 --- a/.github/workflows/check_external_links.yml +++ b/.github/workflows/check_external_links.yml @@ -23,8 +23,7 @@ jobs: - name: Install Sphinx dependencies and package run: | python -m pip install --upgrade pip - python -m pip install -r requirements-doc.txt -r requirements.txt -r requirements-opt.txt - python -m pip install . + python -m pip install ".[test,docs,full]" - name: Check Sphinx external links run: sphinx-build -W -b linkcheck ./docs/source ./test_build diff --git a/.github/workflows/run_coverage.yml b/.github/workflows/run_coverage.yml index 21a87cbf..20011920 100644 --- a/.github/workflows/run_coverage.yml +++ b/.github/workflows/run_coverage.yml @@ -41,29 +41,30 @@ jobs: with: python-version: ${{ env.PYTHON }} - - name: Install dependencies + - name: Upgrade pip run: | python -m pip install --upgrade pip - python -m pip install -r requirements-dev.txt -r requirements.txt - - - name: Install optional dependencies - if: ${{ matrix.opt_req }} - run: python -m pip install -r requirements-opt.txt - name: Install package + if: ! ${{ matrix.opt_req }} run: | - python -m pip install . - python -m pip list + python -m pip install ".[test]" + + - name: Install package with optional dependencies + if: ${{ matrix.opt_req }} + run: python -m pip install ".[test,full]" - name: Run tests and generate coverage report run: | # coverage is configured in pyproject.toml - pytest --cov --cov-report=xml --cov-report=term # codecov uploader requires xml format + # codecov uploader requires xml format + python -m pip list + pytest --cov --cov-report=xml --cov-report=term - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 with: fail_ci_if_error: true - file: ./coverage.xml + files: ./coverage.xml env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.readthedocs.yaml b/.readthedocs.yaml index b69025a1..a200e362 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -24,7 +24,7 @@ formats: all # Optionally set the version of Python and requirements required to build your docs python: install: - - path: .[docs,tqdm,fsspec,s3fs] # path to the package relative to the root + - path: .[docs,full] # path to the package relative to the root # Optionally include all submodules submodules: diff --git a/docs/source/installation.rst b/docs/source/installation.rst index fc55f947..e203f2d7 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -24,14 +24,15 @@ For Developers Install hdmf-zarr from GitHub ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The following illustrates how to install both ``hdmf`` and ``hdfm_zarr`` from GitHub -in a Conda environment. Normally we don't need to install ``hdmf`` directly, but until -``hdmf 3.4.0`` is released we need to use the ``dev`` version of ``hdmf``. +The following illustrates how to install both ``hdmf`` and ``hdmf_zarr`` from GitHub +in a Conda environment, with all of the optional, testing, and documentation dependencies +for hdmf-zarr. Normally, we don't need to install ``hdmf`` directly, but it is +often useful to use the ``dev`` branch of the ``hdmf`` GitHub repository. .. code-block:: - conda create --name hdmf-zarr-test python=3.9 - conda activate hdmf-zarr-test + conda create --name hdmf-zarr-dev python=3.13 + conda activate hdmf-zarr-dev git clone --recurse-submodules https://github.com/hdmf-dev/hdmf.git cd hdmf @@ -41,12 +42,11 @@ in a Conda environment. Normally we don't need to install ``hdmf`` directly, but git clone https://github.com/hdmf-dev/hdmf-zarr.git cd hdmf-zarr - pip install -r requirements.txt -r requirements-dev.txt -r requirements-doc.txt - pip install -e . + pip install -e ".[all]" .. note:: - Depending on versions, it is possible that when installing ``hdmf-zarr`` that pip will + Depending on versions, it is possible that when installing ``hdmf-zarr``, that ``pip`` will install HDMF directly from PyPI instead of using the development version of HDMF that is already installed. In that case call ``pip uninstall hdmf`` and go to the ``hdmf`` directory and run ``pip install -e .`` again diff --git a/pyproject.toml b/pyproject.toml index 3a4cc742..25adfcce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,9 +38,12 @@ dependencies = [ dynamic = ["version"] [project.optional-dependencies] -tqdm = ["tqdm>=4.41.0"] -fsspec = ["fsspec"] -s3fs = ["s3fs"] +# all optional dependencies +full = [ + "tqdm>=4.41.0", + "fsspec", + "s3fs", +] # development dependencies test = [ @@ -54,6 +57,7 @@ test = [ "tox", ] +# documentation dependencies docs = [ "matplotlib", "sphinx>=4", # improved support for docutils>=0.17 @@ -62,6 +66,10 @@ docs = [ "sphinx-copybutton", ] +# all possible dependencies +all = ["hdmf-zarr[full,test,docs]"] + + [project.urls] "Homepage" = "https://github.com/hdmf-dev/hdmf-zarr" "Bug Tracker" = "https://github.com/hdmf-dev/hdmf-zarr/issues" diff --git a/tox.ini b/tox.ini index 55cd63ce..22e02a64 100644 --- a/tox.ini +++ b/tox.ini @@ -37,14 +37,14 @@ commands = {[testenv]commands} # Test with python 3.13 and all optional dependencies [testenv:py313-optional] -extras = {[testenv]extras}, tqdm, fsspec, s3fs +extras = {[testenv]extras}, full commands = {[testenv]commands} # Test with python 3.13 and all optional dependencies, using pre-release versions [testenv:py313-prerelease] install_command = python -m pip install -U --pre {opts} {packages} -extras = {[testenv]extras}, tqdm, fsspec, s3fs +extras = {[testenv]extras}, full commands = {[testenv]commands} # Test with python 3.9 and minimum dependencies @@ -87,14 +87,14 @@ commands = {[testenv:gallery]commands} # Test with python 3.13 and all optional dependencies [testenv:gallery-py313-optional] -extras = {[testenv:gallery]extras}, tqdm, fsspec, s3fs +extras = {[testenv:gallery]extras}, full commands = {[testenv:gallery]commands} # Test with python 3.13 and all optional dependencies, using pre-release versions [testenv:gallery-py313-prerelease] install_command = python -m pip install -U --pre {opts} {packages} -extras = {[testenv:gallery]extras}, tqdm, fsspec, s3fs +extras = {[testenv:gallery]extras}, full commands = {[testenv:gallery]commands} # Test with python 3.9 and minimum dependencies