From ea20f3b0705b59777d95a4e7a145ac9813b169e0 Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Wed, 19 Apr 2023 09:24:12 +0200 Subject: [PATCH 1/4] Remove travis Signed-off-by: Cristian Le --- .travis.yml | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 324732d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -sudo: false -language: python -python: - - "2.7" - - "3.4" - - "3.5" - - "3.6" - - "pypy" - - "pypy3" -matrix: - # pypy3 (as of 2.4.0) has a wacky arity issue in its source loader. Allow it - # to fail until we can test on, and require, PyPy3.3+. See invoke#358. - allow_failures: - - python: pypy3 - # Disabled per https://github.com/travis-ci/travis-ci/issues/1696 - # fast_finish: true -install: - - pip install -r dev-requirements.txt -script: - # Run tests w/ coverage first, so it uses the local-installed copy. - # (If we do this after the below installation tests, coverage will think - # nothing got covered!) - - inv coverage --report=xml - # TODO: tighten up these install test tasks so they can be one-shotted - - inv travis.test-installation --package=patchwork --sanity="inv sanity" - - inv travis.test-packaging --package=patchwork --sanity="inv sanity" - - inv docs --nitpick - - flake8 -# TODO: after_success -> codecov, once coverage sucks less XD From 4462c01af4206664cb543ea9f48d0c85df06c4e1 Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Wed, 19 Apr 2023 10:14:30 +0200 Subject: [PATCH 2/4] Add simple gitignore Signed-off-by: Cristian Le --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index b7e1ca4..a51ee18 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ docs/_build .cache .coverage +/venv +/build +/.idea +*.egg-info From 6399af1c28ad8c8712bab3dfe0e4209591fb7f4f Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Wed, 19 Apr 2023 09:25:05 +0200 Subject: [PATCH 3/4] Add basic pre-commit Signed-off-by: Cristian Le --- .pre-commit-config.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..68d1d2a --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,11 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.3.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.21.0 + hooks: + - id: check-github-workflows From 9b235c33229681419fd2efc3ec9e030a0f683df0 Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Wed, 19 Apr 2023 09:29:19 +0200 Subject: [PATCH 4/4] Add basic GitHub Action Signed-off-by: Cristian Le --- .github/workflows/tests.yaml | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/tests.yaml diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..994ee47 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,42 @@ +name: test +run-name: Run tests + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + pre-commit: + name: Check pre-commit + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + - uses: pre-commit/action@v3.0.0 + + pytest: + name: Run pytests + runs-on: ${{ matrix.os }} + needs: [ pre-commit ] + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] + include: + - os: ubuntu-20.04 + python-version: "3.6" + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install pytest + run: pip install pytest invocations mock pytest-relaxed + - name: Setup patchwork + run: pip install -e . + - name: Test with pytest + run: pytest