From 5ebb875fdd6658f97ec403cf761d607f9fe11e18 Mon Sep 17 00:00:00 2001 From: James Penn Date: Thu, 14 Apr 2022 11:16:07 +0000 Subject: [PATCH 1/7] Added tox for running tests in multiple python versions --- ci/requirements/dev.yml | 8 ++++++++ pyproject.toml | 2 +- tox.ini | 25 +++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 ci/requirements/dev.yml create mode 100644 tox.ini diff --git a/ci/requirements/dev.yml b/ci/requirements/dev.yml new file mode 100644 index 0000000..4b269c7 --- /dev/null +++ b/ci/requirements/dev.yml @@ -0,0 +1,8 @@ +name: tephi-docs +channels: + - conda-forge +dependencies: + - matplotlib + - numpy + - scipy + - scooby \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 5f9860d..ab4c40f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.black] line-length = 79 -target-version = ['py36', 'py37', 'py38'] +target-version = ['py37', 'py38', 'py39', 'py310'] include = '\.pyi?$' exclude = ''' diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..e09a1b5 --- /dev/null +++ b/tox.ini @@ -0,0 +1,25 @@ +[tox] +requires = + tox-conda + tox-run-command +minversion = 3.15 +envlist=py37,py38,py39,py310 + +[testenv] +description = invoke pytest to run automated tests +deps = + pytest + pytest-cov + filelock + requests + imagehash +conda_env = ci/requirements/dev.yml +commands = + pytest --cov tephi --cov-report term-missing {posargs} + +[testenv:lint] +skip_install = true +deps = + black +commands = \ + black --config=./pyproject.toml . From 3a2f90b0335a21ecd9cf8c9b7cfc303d777c379f Mon Sep 17 00:00:00 2001 From: James Penn Date: Thu, 14 Apr 2022 11:26:11 +0000 Subject: [PATCH 2/7] Added github test workflow --- .github/workflows/test.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..c500744 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,27 @@ +name: Test tephi + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - uses: actions/cache@v2 + with: + key: tox + path: | + .tox + + - name: Install tox + run: pip3 install --user tox + + - name: Run tox + run: tox \ No newline at end of file From 48f384e69241f9186df05b9ac40cc44dc992e79a Mon Sep 17 00:00:00 2001 From: James Penn Date: Thu, 14 Apr 2022 12:34:14 +0100 Subject: [PATCH 3/7] Update dev.yml --- ci/requirements/dev.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/requirements/dev.yml b/ci/requirements/dev.yml index 4b269c7..9d2ba1c 100644 --- a/ci/requirements/dev.yml +++ b/ci/requirements/dev.yml @@ -1,8 +1,8 @@ -name: tephi-docs +name: tephi-dev channels: - conda-forge dependencies: - matplotlib - numpy - scipy - - scooby \ No newline at end of file + - scooby From 0bca541c17359126970fc5e3ed716141f042b718 Mon Sep 17 00:00:00 2001 From: James Penn Date: Thu, 14 Apr 2022 14:16:00 +0100 Subject: [PATCH 4/7] Fix bugs in workflow --- .github/workflows/test.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c500744..0cfddd6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,9 +2,9 @@ name: Test tephi on: push: - branches: [ main ] + branches: [ master ] pull_request: - branches: [ main ] + branches: [ master ] jobs: build: @@ -12,13 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - - uses: actions/cache@v2 - with: - key: tox - path: | - .tox + - uses: actions/checkout@v3 - name: Install tox run: pip3 install --user tox From 40f7a32db1ef3979836a0a9e43e752a5d719c1f4 Mon Sep 17 00:00:00 2001 From: James Penn Date: Thu, 14 Apr 2022 14:16:42 +0100 Subject: [PATCH 5/7] Slightly less bad cache key --- .github/workflows/test.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0cfddd6..754cf09 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,6 +14,12 @@ jobs: steps: - uses: actions/checkout@v3 + - uses: actions/cache@v3 + with: + key: tox-${{ hashFiles('ci/requirements/dev.yml') }}-${{ hashFiles('tox.ini') }} + path: | + .tox + - name: Install tox run: pip3 install --user tox From ee37aad455301c8262ca146e8841530647387398 Mon Sep 17 00:00:00 2001 From: James Penn Date: Thu, 14 Apr 2022 14:21:38 +0100 Subject: [PATCH 6/7] Use pipx --- .github/workflows/test.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 754cf09..e7ee471 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,8 +20,5 @@ jobs: path: | .tox - - name: Install tox - run: pip3 install --user tox - - name: Run tox - run: tox \ No newline at end of file + run: pipx run tox \ No newline at end of file From 8713b15aaa011c37ea9eb573fb09e21160886ce0 Mon Sep 17 00:00:00 2001 From: James Penn Date: Thu, 14 Apr 2022 15:59:41 +0100 Subject: [PATCH 7/7] Removed tox lint section --- tox.ini | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tox.ini b/tox.ini index e09a1b5..36ede16 100644 --- a/tox.ini +++ b/tox.ini @@ -17,9 +17,3 @@ conda_env = ci/requirements/dev.yml commands = pytest --cov tephi --cov-report term-missing {posargs} -[testenv:lint] -skip_install = true -deps = - black -commands = \ - black --config=./pyproject.toml .