From ae19fada3c66c7aa60bf05d7f3802b2c6e82f3fa Mon Sep 17 00:00:00 2001 From: Will Graham <32364977+willGraham01@users.noreply.github.com> Date: Tue, 6 Feb 2024 14:15:11 +0000 Subject: [PATCH] Add manifest to ci (#118) * Add manifest to CI * Standardise tox.ini into pyproject --- .github/workflows/test_and_deploy.yml | 15 +++++-- MANIFEST.in | 8 ++++ pyproject.toml | 65 ++++++++++++++++----------- tox.ini | 14 ------ 4 files changed, 59 insertions(+), 43 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 7831c08..774413f 100644 --- a/.github/workflows/test_and_deploy.yml +++ b/.github/workflows/test_and_deploy.yml @@ -2,17 +2,26 @@ name: tests on: push: - branches: [ main ] + branches: + - "main" pull_request: + workflow_dispatch: 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..c65627f --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,8 @@ +exclude .pre-commit-config.yaml + +include LICENSE +include README.md + +graft bg_atlasgen *.py + +prune tests diff --git a/pyproject.toml b/pyproject.toml index 20d9259..68221d2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,9 +2,9 @@ name = "bg-atlasgen" description = "Scripts generation atlases and utilities for BrainGlobe" readme = "README.md" -license = {file = "LICENSE"} +license = { file = "LICENSE" } authors = [ - {name = "Luigi Petrucco, Federico Claudi, Adam Tyson", email = "code@adamltyson.com"}, + { name = "Luigi Petrucco, Federico Claudi, Adam Tyson", email = "code@adamltyson.com" }, ] classifiers = [ "Development Status :: 3 - Alpha", @@ -41,29 +41,23 @@ dynamic = ["version"] Homepage = "https://github.com/brainglobe/bg-atlasgen" [project.optional-dependencies] -allenmouse = [ - "allensdk", -] +allenmouse = ["allensdk"] dev = [ - "pytest", - "pytest-cov", - "pytest-mock", - "coverage", - "tox", - "black", - "mypy", - "pre-commit", - "ruff", - "setuptools_scm", + "pytest", + "pytest-cov", + "pytest-mock", + "coverage", + "tox", + "black", + "mypy", + "pre-commit", + "ruff", + "setuptools_scm", ] [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] @@ -82,17 +76,36 @@ line-length = 79 [tool.check-manifest] ignore = [ - "*.yaml", - "tox.ini", - "tests/*", - "tests/test_unit/*", - "tests/test_integration/*", + "*.yaml", + "tox.ini", + "tests/*", + "tests/test_unit/*", + "tests/test_integration/*", ] [tool.ruff] line-length = 79 -exclude = ["__init__.py","build",".eggs"] +exclude = ["__init__.py", "build", ".eggs"] select = ["I", "E", "F"] # E501 Line too long ignore = ["E501"] fix = true + +[tool.tox] +legacy_tox_ini = """ +[tox] +envlist = py{39,310,311} + +[gh-actions] +python = + 3.9: py39 + 3.10: py310 + 3.11: py311 + +[testenv] +extras = + dev +commands = + pytest -v --color=yes --cov=bg_atlasgen --cov-report=xml + +""" diff --git a/tox.ini b/tox.ini deleted file mode 100644 index a53937f..0000000 --- a/tox.ini +++ /dev/null @@ -1,14 +0,0 @@ -[tox] -envlist = py{39,310,311} - -[gh-actions] -python = - 3.9: py39 - 3.10: py310 - 3.11: py311 - -[testenv] -extras = - dev -commands = - pytest -v --color=yes --cov=bg_atlasgen --cov-report=xml