Skip to content

Commit

Permalink
Fix Github worklfow/tox (#51)
Browse files Browse the repository at this point in the history
* first/tox

* Update setup.py

* tox

* Update requirements-dev.txt

* Update requirements-dev.txt

* Update requirements-dev.txt

* Update requirements-dev.txt

* Update requirements-dev.txt

* Update nwb.py

* Update requirements-min.txt

* Update requirements-min.txt

* Update requirements-min.txt

* Update nwb.py

* Update requirements-min.txt

* Update requirements-min.txt

* Update tox.ini

* Update tox.ini

* Update run_coverage.yml

* Update run_coverage.yml

* Update run_coverage.yml

* workflows up to date with hdmf

* Update requirements-min.txt

* Update setup.py

* Update run_coverage.yml

* Update setup.py

* Update setup.py

* Update black.yml

Co-authored-by: Ryan Ly <[email protected]>
  • Loading branch information
mavaylon1 and rly authored Dec 20, 2022
1 parent 48ab39f commit 439df57
Show file tree
Hide file tree
Showing 11 changed files with 99 additions and 83 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.3
- uses: actions/checkout@v3.2.0
- uses: actions/setup-python@v4
- uses: pre-commit/action@v3.0.0
with:
extra_args: black
6 changes: 3 additions & 3 deletions .github/workflows/check_external_links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
check-external-links:
runs-on: ubuntu-latest
steps:
- name: Cancel any previous incomplete runs
uses: styfle/cancel-workflow-action@0.9.1
- name: Cancel non-latest runs
uses: styfle/cancel-workflow-action@0.11.0
with:
all_but_latest: true
access_token: ${{ github.token }}
Expand All @@ -20,7 +20,7 @@ jobs:
submodules: 'recursive'

- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: '3.10'

Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/deploy_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fetch-depth: 0 # tags are required for versioneer to determine the version

- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: '3.10'

Expand All @@ -25,22 +25,27 @@ jobs:
python -m pip install --upgrade pip
python -m pip install tox
python -m pip list
- name: Run tox tests
run: |
tox -e py310-upgraded
- name: Build wheel and source distribution
run: |
tox -e build-py310-upgraded
ls -1 dist
- name: Test installation from a wheel
run: |
tox -e wheelinstall --recreate --installpkg dist/*-none-any.whl
- name: Upload wheel and source distributions to PyPI
run: |
python -m pip install twine
ls -1 dist
# twine upload --repository testpypi -u ${{ secrets.BOT_PYPI_USER }} -p ${{ secrets.BOT_PYPI_PASSWORD }} --skip-existing dist/*
# twine upload --repository-url https://test.pypi.org/legacy/ -u ${{ secrets.BOT_PYPI_USER }} -p ${{ secrets.BOT_PYPI_PASSWORD }} --skip-existing dist/*
twine upload -u ${{ secrets.BOT_PYPI_USER }} -p ${{ secrets.BOT_PYPI_PASSWORD }} --skip-existing dist/*
- name: Publish wheel and source distributions as a GitHub release
run: |
python -m pip install "githubrelease>=1.5.9"
Expand Down
50 changes: 28 additions & 22 deletions .github/workflows/run_all_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,36 +23,40 @@ jobs:
matrix:
include:
- { name: linux-python3.7-minimum , test-tox-env: py37-minimum , build-tox-env: build-py37-minimum , python-ver: "3.7" , os: ubuntu-latest }
- { name: linux-python3.7 , test-tox-env: py37 , build-tox-env: build-py37 , python-ver: "3.7" , os: ubuntu-latest }
- { name: linux-python3.8 , test-tox-env: py38 , build-tox-env: build-py38 , python-ver: "3.8" , os: ubuntu-latest }
- { name: linux-python3.9 , test-tox-env: py39 , build-tox-env: build-py39 , python-ver: "3.9" , os: ubuntu-latest }
- { name: linux-python3.10 , test-tox-env: py310 , build-tox-env: build-py310 , python-ver: "3.10", os: ubuntu-latest }
- { name: linux-python3.10-optional , test-tox-env: py310-optional , build-tox-env: build-py310-optional , python-ver: "3.10", os: ubuntu-latest }
- { name: linux-python3.10-upgraded , test-tox-env: py310-upgraded , build-tox-env: build-py310-upgraded , python-ver: "3.10", os: ubuntu-latest }
- { name: linux-python3.10-prerelease , test-tox-env: py310-prerelease, build-tox-env: build-py310-prerelease, python-ver: "3.10", os: ubuntu-latest }
- { name: windows-python3.7-minimum , test-tox-env: py37-minimum , build-tox-env: build-py37-minimum , python-ver: "3.7" , os: windows-latest }
- { name: windows-python3.7 , test-tox-env: py37 , build-tox-env: build-py37 , python-ver: "3.7" , os: windows-latest }
- { name: windows-python3.8 , test-tox-env: py38 , build-tox-env: build-py38 , python-ver: "3.8" , os: windows-latest }
- { name: windows-python3.9 , test-tox-env: py39 , build-tox-env: build-py39 , python-ver: "3.9" , os: windows-latest }
- { name: windows-python3.10 , test-tox-env: py310 , build-tox-env: build-py310 , python-ver: "3.10", os: windows-latest }
- { name: windows-python3.10-optional , test-tox-env: py310-optional , build-tox-env: build-py310-optional , python-ver: "3.10", os: windows-latest }
- { name: windows-python3.10-upgraded , test-tox-env: py310-upgraded , build-tox-env: build-py310-upgraded , python-ver: "3.10", os: windows-latest }
- { name: windows-python3.10-prerelease, test-tox-env: py310-prerelease, build-tox-env: build-py310-prerelease, python-ver: "3.10", os: windows-latest }
- { name: macos-python3.7-minimum , test-tox-env: py37-minimum , build-tox-env: build-py37-minimum , python-ver: "3.7" , os: macos-latest }
- { name: macos-python3.7 , test-tox-env: py37 , build-tox-env: build-py37 , python-ver: "3.7" , os: macos-latest }
- { name: macos-python3.8 , test-tox-env: py38 , build-tox-env: build-py38 , python-ver: "3.8" , os: macos-latest }
- { name: macos-python3.9 , test-tox-env: py39 , build-tox-env: build-py39 , python-ver: "3.9" , os: macos-latest }
- { name: macos-python3.10 , test-tox-env: py310 , build-tox-env: build-py310 , python-ver: "3.10", os: macos-latest }
- { name: macos-python3.10-optional , test-tox-env: py310-optional , build-tox-env: build-py310-optional , python-ver: "3.10", os: macos-latest }
- { name: macos-python3.10-upgraded , test-tox-env: py310-upgraded , build-tox-env: build-py310-upgraded , python-ver: "3.10", os: macos-latest }
- { name: macos-python3.10-prerelease , test-tox-env: py310-prerelease, build-tox-env: build-py310-prerelease, python-ver: "3.10", os: macos-latest }
steps:
- name: Cancel non-latest runs
uses: styfle/[email protected]
with:
all_but_latest: true
access_token: ${{ github.token }}

- uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0 # tags are required for versioneer to determine the version

- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-ver }}

Expand Down Expand Up @@ -91,17 +95,19 @@ jobs:
- { name: macos-gallery-python3.10-upgraded , test-tox-env: gallery-py310-upgraded , python-ver: "3.10", os: macos-latest }
- { name: macos-gallery-python3.10-prerelease , test-tox-env: gallery-py310-prerelease, python-ver: "3.10", os: macos-latest }
steps:
- name: Cancel any previous incomplete runs
uses: styfle/cancel-workflow-action@0.9.1
- name: Cancel non-latest runs
uses: styfle/cancel-workflow-action@0.11.0
with:
all_but_latest: true
access_token: ${{ github.token }}

- uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0 # tags are required for versioneer to determine the version

- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-ver }}

Expand All @@ -123,38 +129,38 @@ jobs:
fail-fast: false
matrix:
include:
- { name: linux-python3.7-minimum , test-tox-env: py37-minimum , build-tox-env: build-py37-minimum , python-ver: "3.7" , os: ubuntu-latest }
- { name: linux-python3.7 , test-tox-env: py37 , build-tox-env: build-py37 , python-ver: "3.7" , os: ubuntu-latest }
- { name: linux-python3.8 , test-tox-env: py38 , build-tox-env: build-py38 , python-ver: "3.8" , os: ubuntu-latest }
- { name: linux-python3.9 , test-tox-env: py39 , build-tox-env: build-py39 , python-ver: "3.9" , os: ubuntu-latest }
- { name: linux-python3.10 , test-tox-env: py310 , build-tox-env: build-py310 , python-ver: "3.10", os: ubuntu-latest }
- { name: linux-python3.10-optional , test-tox-env: py310-optional , build-tox-env: build-py310-optional , python-ver: "3.10", os: ubuntu-latest }
- { name: linux-python3.10-upgraded , test-tox-env: py310-upgraded , build-tox-env: build-py310-upgraded , python-ver: "3.10", os: ubuntu-latest }
- { name: linux-python3.10-prerelease, test-tox-env: py310-prerelease, build-tox-env: build-py310-prerelease, python-ver: "3.10", os: ubuntu-latest }
- { name: conda-linux-python3.7-minimum , test-tox-env: py37-minimum , build-tox-env: build-py37-minimum , python-ver: "3.7" , os: ubuntu-latest }
- { name: conda-linux-python3.8 , test-tox-env: py38 , build-tox-env: build-py38 , python-ver: "3.8" , os: ubuntu-latest }
- { name: conda-linux-python3.9 , test-tox-env: py39 , build-tox-env: build-py39 , python-ver: "3.9" , os: ubuntu-latest }
- { name: conda-linux-python3.10 , test-tox-env: py310 , build-tox-env: build-py310 , python-ver: "3.10", os: ubuntu-latest }
- { name: conda-linux-python3.10-optional , test-tox-env: py310-optional , build-tox-env: build-py310-optional , python-ver: "3.10", os: ubuntu-latest }
- { name: conda-linux-python3.10-upgraded , test-tox-env: py310-upgraded , build-tox-env: build-py310-upgraded , python-ver: "3.10", os: ubuntu-latest }
- { name: conda-linux-python3.10-prerelease, test-tox-env: py310-prerelease, build-tox-env: build-py310-prerelease, python-ver: "3.10", os: ubuntu-latest }
steps:
- name: Cancel any previous incomplete runs
uses: styfle/cancel-workflow-action@0.9.1
- name: Cancel non-latest runs
uses: styfle/cancel-workflow-action@0.11.0
with:
all_but_latest: true
access_token: ${{ github.token }}

- uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0 # tags are required for versioneer to determine the version

- name: Set up Conda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
auto-activate-base: true
activate-environment: ""
activate-environment: true
python-version: ${{ matrix.python-ver }}

- name: Install build dependencies
run: |
conda update -n base -c defaults conda
conda config --set always_yes yes --set changeps1 no
conda config --add channels conda-forge
conda install python=${{ matrix.python-ver }}
conda install tox
conda info
conda install -c conda-forge tox
conda list
- name: Run tox tests
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/run_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
OS: ${{ matrix.os }}
PYTHON: '3.10'
steps:
- name: Cancel any previous incomplete runs
uses: styfle/cancel-workflow-action@0.9.1
- name: Cancel non-latest runs
uses: styfle/cancel-workflow-action@0.11.0
with:
all_but_latest: true
access_token: ${{ github.token }}
Expand All @@ -41,7 +41,7 @@ jobs:
submodules: 'recursive'

- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: '3.10'

Expand All @@ -56,7 +56,7 @@ jobs:
python -m pip list
- name: Run tests and generate coverage report
run: |
python -m coverage run test.py -u
pytest --cov
python -m coverage xml # codecov uploader requires xml format
python -m coverage report -m
- name: Upload coverage to Codecov
Expand Down
39 changes: 20 additions & 19 deletions .github/workflows/run_flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,26 @@ jobs:
run-flake8:
runs-on: ubuntu-latest
steps:
- name: Cancel any previous incomplete runs
uses: styfle/cancel-workflow-action@0.9.1
with:
all_but_latest: true
access_token: ${{ github.token }}
- name: Cancel non-latest runs
uses: styfle/cancel-workflow-action@0.11.0
with:
all_but_latest: true
access_token: ${{ github.token }}

- uses: actions/checkout@v3
with:
submodules: 'recursive'
- uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0 # tags are required for versioneer to determine the version

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install flake8
run: |
python -m pip install --upgrade pip
python -m pip install flake8
python -m pip list
- name: Run flake8
run: flake8
- name: Install flake8
run: |
python -m pip install --upgrade pip
python -m pip install flake8
python -m pip list
- name: Run flake8
run: flake8
28 changes: 15 additions & 13 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
matrix:
include:
- { name: linux-python3.7-minimum , test-tox-env: py37-minimum , build-tox-env: build-py37-minimum , python-ver: "3.7" , os: ubuntu-latest }
- { name: linux-python3.7 , test-tox-env: py37 , build-tox-env: build-py37 , python-ver: "3.7" , os: ubuntu-latest }
- { name: linux-python3.10 , test-tox-env: py310 , build-tox-env: build-py310 , python-ver: "3.10", os: ubuntu-latest }
# NOTE config below with "upload-wheels: true" specifies that wheels should be uploaded as an artifact
- { name: linux-python3.10-upgraded , test-tox-env: py310-upgraded , build-tox-env: build-py310-upgraded , python-ver: "3.10", os: ubuntu-latest , upload-wheels: true }
Expand All @@ -29,8 +28,8 @@ jobs:
- { name: macos-python3.7-minimum , test-tox-env: py37-minimum , build-tox-env: build-py37-minimum , python-ver: "3.7" , os: macos-latest }
- { name: macos-python3.10-upgraded , test-tox-env: py310-upgraded , build-tox-env: build-py310-upgraded , python-ver: "3.10", os: macos-latest }
steps:
- name: Cancel any previous incomplete runs
uses: styfle/cancel-workflow-action@0.9.1
- name: Cancel non-latest runs
uses: styfle/cancel-workflow-action@0.11.0
with:
all_but_latest: true
access_token: ${{ github.token }}
Expand All @@ -41,7 +40,7 @@ jobs:
fetch-depth: 0 # tags are required for versioneer to determine the version

- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-ver }}

Expand Down Expand Up @@ -82,17 +81,18 @@ jobs:
- { name: windows-gallery-python3.7-minimum , test-tox-env: gallery-py37-minimum , python-ver: "3.7" , os: windows-latest }
- { name: windows-gallery-python3.10-upgraded, test-tox-env: gallery-py310-upgraded, python-ver: "3.10", os: windows-latest }
steps:
- name: Cancel any previous incomplete runs
uses: styfle/cancel-workflow-action@0.9.1
- name: Cancel non-latest runs
uses: styfle/cancel-workflow-action@0.11.0
with:
all_but_latest: true
access_token: ${{ github.token }}

- uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-ver }}

Expand All @@ -117,9 +117,10 @@ jobs:
- { name: conda-linux-python3.7-minimum , test-tox-env: py37-minimum , build-tox-env: build-py37-minimum , python-ver: "3.7" , os: ubuntu-latest }
- { name: conda-linux-python3.10-upgraded , test-tox-env: py310-upgraded , build-tox-env: build-py310-upgraded , python-ver: "3.10", os: ubuntu-latest }
steps:
- name: Cancel any previous incomplete runs
uses: styfle/cancel-workflow-action@0.9.1
- name: Cancel non-latest runs
uses: styfle/cancel-workflow-action@0.11.0
with:
all_but_latest: true
access_token: ${{ github.token }}

- uses: actions/checkout@v3
Expand Down Expand Up @@ -157,9 +158,10 @@ jobs:
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
steps:
- name: Cancel any previous incomplete runs
uses: styfle/cancel-workflow-action@0.9.1
- name: Cancel non-latest runs
uses: styfle/cancel-workflow-action@0.11.0
with:
all_but_latest: true
access_token: ${{ github.token }}

- name: Checkout repo with submodules
Expand All @@ -168,7 +170,7 @@ jobs:
submodules: 'recursive'

- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: '3.10'

Expand All @@ -182,7 +184,7 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install scikit-ci-addons
ci_addons publish_github_release hdmf-dev/hdmf \
ci_addons publish_github_release hdmf-dev/hdmf-zarr \
--prerelease-packages "dist/*" \
--prerelease-sha $GITHUB_SHA \
--prerelease-packages-clear-pattern "*" \
Expand Down
13 changes: 6 additions & 7 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# pinned dependencies to reproduce an entire development environment to use HDMF, run HDMF tests, check code style,
# compute coverage, and create test environments
codecov==2.1.12
coverage==6.2
flake8==4.0.1
flake8-debugger==4.0.0
flake8-print==4.0.0
importlib-metadata==4.2.0
pytest==6.2.5
coverage==6.4.2
flake8==5.0.4
flake8-debugger==4.1.2
flake8-print==5.0.0
pytest==7.1.2
pytest-cov==3.0.0
python-dateutil==2.8.2
tox==3.24.5
tox==3.25.1
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
'hdmf>=3.4.0',
'zarr>=2.11.0',
'numcodecs>=0.9.1',
'pynwb>=2.0.0'
'pynwb>=2.0.0',
'setuptools',
'numpy>=1.23; python_version >"3.7"'
]

print(reqs)
Expand Down
1 change: 0 additions & 1 deletion src/hdmf_zarr/nwb.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from hdmf.backends.io import HDMFIO
from hdmf.build import (BuildManager,
TypeMap)

try:
from pynwb import get_manager, get_type_map

Expand Down
Loading

0 comments on commit 439df57

Please sign in to comment.