From 127ed646b8d616ce70715d31a9239b08936b53a7 Mon Sep 17 00:00:00 2001 From: willGraham01 <1willgraham@gmail.com> Date: Tue, 6 Feb 2024 13:51:36 +0000 Subject: [PATCH 1/3] Update CI workflows with manifest --- .github/workflows/test_and_deploy.yml | 11 ++++++-- MANIFEST.in | 8 ++++++ pyproject.toml | 39 +++++++++++++++++---------- tox.ini | 15 ----------- 4 files changed, 42 insertions(+), 31 deletions(-) create mode 100644 MANIFEST.in delete mode 100644 tox.ini diff --git a/.github/workflows/test_and_deploy.yml b/.github/workflows/test_and_deploy.yml index 368e839..09b211b 100644 --- a/.github/workflows/test_and_deploy.yml +++ b/.github/workflows/test_and_deploy.yml @@ -3,13 +3,20 @@ name: tests on: [push, pull_request] jobs: - lint: + linting: + name: Check Linting runs-on: ubuntu-latest steps: - uses: neuroinformatics-unit/actions/lint@v2 + manifest: + name: Check Manifest + runs-on: ubuntu-latest + steps: + - uses: neuroinformatics-unit/actions/check_manifest@v2 + test: - needs: lint + needs: [linting, manifest] name: ${{ matrix.os }} py${{ matrix.python-version }} runs-on: ${{ matrix.os }} strategy: diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..18039b7 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,8 @@ +exclude .pre-commit-config.yaml + +include LICENSE +include README.md + +graft imio *.py + +prune tests diff --git a/pyproject.toml b/pyproject.toml index c400c3e..85b28b9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "imio" description = "Loading and saving of image data." readme = "README.md" authors = [ - {name = "Charly Rousseau, Adam Tyson", email = "code@adamltyson.com"}, + { name = "Charly Rousseau, Adam Tyson", email = "code@adamltyson.com" }, ] classifiers = [ "Development Status :: 3 - Alpha", @@ -35,19 +35,10 @@ dynamic = ['version'] Homepage = "https://github.com/brainglobe/imio" [project.optional-dependencies] -dev = [ - "black", - "pre-commit", - "pytest", - "pytest-cov", -] +dev = ["black", "pre-commit", "pytest", "pytest-cov"] [build-system] -requires = [ - "setuptools>=45", - "wheel", - "setuptools_scm[toml]>=6.2", -] +requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.2"] build-backend = "setuptools.build_meta" [tool.setuptools] @@ -72,7 +63,7 @@ filterwarnings = [ "ignore:`np.uint0` is a deprecated alias for `np.uintp`", "ignore:`np.void0` is a deprecated alias for `np.void`", "ignore:`np.bytes0` is a deprecated alias for `np.bytes_`", - "ignore:`np.str0` is a deprecated alias for `np.str_`" + "ignore:`np.str0` is a deprecated alias for `np.str_`", ] [tool.black] @@ -82,6 +73,26 @@ line-length = 79 [tool.ruff] line-length = 79 -exclude = ["__init__.py","build",".eggs"] +exclude = ["__init__.py", "build", ".eggs"] select = ["I", "E", "F"] fix = true + +[tool.tox] +legacy_tox_ini = """ +[tox] +envlist = py{38,39,310,311} + +[gh-actions] +python = + 3.8: py38 + 3.9: py39 + 3.10: py310 + 3.11: py311 + +[testenv] +extras = + dev +commands = + pytest -v --color=yes --cov=imio --cov-report=xml + +""" diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 978bb51..0000000 --- a/tox.ini +++ /dev/null @@ -1,15 +0,0 @@ -[tox] -envlist = py{38,39,310,311} - -[gh-actions] -python = - 3.8: py38 - 3.9: py39 - 3.10: py310 - 3.11: py311 - -[testenv] -extras = - dev -commands = - pytest -v --color=yes --cov=imio --cov-report=xml From 7182b5e8372ab1a3e62c8cfdb5e5eb4bcc75337d Mon Sep 17 00:00:00 2001 From: willGraham01 <1willgraham@gmail.com> Date: Tue, 6 Feb 2024 13:52:16 +0000 Subject: [PATCH 2/3] Allow workflow to be dispatchable --- .github/workflows/test_and_deploy.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_and_deploy.yml b/.github/workflows/test_and_deploy.yml index 09b211b..0649eb1 100644 --- a/.github/workflows/test_and_deploy.yml +++ b/.github/workflows/test_and_deploy.yml @@ -1,6 +1,13 @@ name: tests -on: [push, pull_request] +on: + push: + branches: + - "main" + tags: + - "v**" + pull_request: + workflow_dispatch: jobs: linting: From 64149110898951cf9caddf27bc3560b64a6bdb2a Mon Sep 17 00:00:00 2001 From: willGraham01 <1willgraham@gmail.com> Date: Tue, 6 Feb 2024 13:53:01 +0000 Subject: [PATCH 3/3] Add pyarrow dependency to prevent future pandas failures --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 85b28b9..0826dc5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,7 @@ dependencies = [ "nibabel >= 2.1.0", "numpy", "psutil", + "pyarrow", "pynrrd", "scikit-image", "tifffile",