From 7725d652dadef61703c2f2903b27ff545ab0b679 Mon Sep 17 00:00:00 2001 From: Richard Holmboe Date: Fri, 25 Aug 2023 13:36:33 +0200 Subject: [PATCH 1/6] Added tox to github actions --- .editorconfig | 12 ++++++++++++ .github/workflows/tox.yml | 39 +++++++++++++++++++++++++++++++++++++++ setup.py | 11 +++-------- tox.ini | 23 ++++++++++++++++------- 4 files changed, 70 insertions(+), 15 deletions(-) create mode 100644 .editorconfig create mode 100644 .github/workflows/tox.yml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..bb53136 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml new file mode 100644 index 0000000..cdf2b34 --- /dev/null +++ b/.github/workflows/tox.yml @@ -0,0 +1,39 @@ +name: Tests + +on: + pull_request: + push: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + +jobs: + test: + name: >- + ${{ matrix.os }} v${{ matrix.python-version }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ["3.9", "3.10", "3.11"] + + steps: + - name: Check out repository code + uses: actions/checkout@v3 + + - name: Setup Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python3 -m pip install --upgrade pip wheel setuptools + python3 -m pip install '.[test]' + + - name: Test with tox + run: tox run --quiet diff --git a/setup.py b/setup.py index aa491ba..4816b9b 100644 --- a/setup.py +++ b/setup.py @@ -22,13 +22,8 @@ "phabricator", "pyyaml", ] -tests_require = [ - "coverage", - "flake8", - "pytest", - "tox", -] -docs_require = ["docs"] +tests_require = ["coverage", "flake8", "pytest", "tox", "tox-gh-actions"] +docs_require = ["mkdocs"] download_url = f"https://github.com/dynamist/phabfive/tarball/v{phabfive.__version__}" setup( @@ -54,7 +49,7 @@ "phabfive = phabfive.cli:cli_entrypoint", ], }, - python_requires=">=3.9.*", + python_requires=">=3.9", classifiers=[ # "Development Status :: 1 - Planning", # "Development Status :: 2 - Pre-Alpha", diff --git a/tox.ini b/tox.ini index 1155e2f..b3a2d4e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,13 +1,20 @@ [tox] -envlist = flake8, py{38,39,310}, coverage, mkdocs +minversion = 3.4.0 +envlist = py{39,310,311},flake8,coverage,mkdocs +basepython = + py39: python3.9 + py310: python3.10 + py311: python3.11 [testenv] +setenv = + PYTHONPATH = {toxinidir} extras = test sitepackages = False -commands = pytest -v {posargs} +commands = + pytest --basetemp={envtmpdir} [testenv:flake8] -basepython = python3.8 extras = test deps = flake8-assertive @@ -17,10 +24,10 @@ deps = #flake8-docstrings #flake8-import-order flake8-rst-docstrings -commands = flake8 +commands = + flake8 --exit-zero phabfive/ tests/ [testenv:mkdocs] -basepython = python3.8 extras = docs commands = mkdocs build -s @@ -34,6 +41,8 @@ commands = [report] show_missing = True -[travis] +[gh-actions] python = - 3.8: py38, flake8, coverage \ No newline at end of file + 3.9: py39 + 3.10: py310,flake8 + 3.11: py311 From c146a739d2224d64347588738a2f55c04d66cc74 Mon Sep 17 00:00:00 2001 From: Richard Holmboe Date: Fri, 25 Aug 2023 13:50:51 +0200 Subject: [PATCH 2/6] added windows-latest to experimental list --- .editorconfig | 5 ++++- .github/workflows/tox.yml | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.editorconfig b/.editorconfig index bb53136..ce873b1 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,4 +9,7 @@ indent_size = 4 end_of_line = lf charset = utf-8 trim_trailing_whitespace = true -insert_final_newline = true \ No newline at end of file +insert_final_newline = true + +[*.yml] +indent_size = 2 diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index cdf2b34..63dd64e 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -18,8 +18,11 @@ jobs: strategy: fail-fast: true matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest] python-version: ["3.9", "3.10", "3.11"] + include: + - os: windows-latest + experimental: true steps: - name: Check out repository code From c91930b0bb4ed2e75218d54176a7f432a0221b41 Mon Sep 17 00:00:00 2001 From: Richard Holmboe Date: Fri, 25 Aug 2023 13:52:03 +0200 Subject: [PATCH 3/6] missing python-version for windows --- .github/workflows/tox.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 63dd64e..58413ca 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -22,6 +22,7 @@ jobs: python-version: ["3.9", "3.10", "3.11"] include: - os: windows-latest + python-version: ["3.9", "3.10", "3.11"] experimental: true steps: From dfb519e58e6c5647020c7f4fb74ea4f4655b2c60 Mon Sep 17 00:00:00 2001 From: Richard Holmboe Date: Fri, 25 Aug 2023 13:53:11 +0200 Subject: [PATCH 4/6] now that implementation didn't work... --- .github/workflows/tox.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 58413ca..225119f 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -22,7 +22,13 @@ jobs: python-version: ["3.9", "3.10", "3.11"] include: - os: windows-latest - python-version: ["3.9", "3.10", "3.11"] + python-version: "3.9" + experimental: true + - os: windows-latest + python-version: "3.10" + experimental: true + - os: windows-latest + python-version: "3.11" experimental: true steps: From 6f3de5dffccb388a92304cd5b73fb39b35739fea Mon Sep 17 00:00:00 2001 From: Richard Holmboe Date: Fri, 25 Aug 2023 13:59:14 +0200 Subject: [PATCH 5/6] this might solve matrix stuff --- .github/workflows/tox.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 225119f..67f918a 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -15,6 +15,7 @@ jobs: name: >- ${{ matrix.os }} v${{ matrix.python-version }} runs-on: ${{ matrix.os }} + continue-on-error: ${{ matrix.experimental || 'false' }} strategy: fail-fast: true matrix: From f5153f7490d62f3e9e78d0adaabe5381ca8a1815 Mon Sep 17 00:00:00 2001 From: Richard Holmboe Date: Fri, 25 Aug 2023 14:00:35 +0200 Subject: [PATCH 6/6] removed windows, since it clearly doesn't work... --- .github/workflows/tox.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 67f918a..344ab4d 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -15,22 +15,11 @@ jobs: name: >- ${{ matrix.os }} v${{ matrix.python-version }} runs-on: ${{ matrix.os }} - continue-on-error: ${{ matrix.experimental || 'false' }} strategy: fail-fast: true matrix: os: [ubuntu-latest, macos-latest] python-version: ["3.9", "3.10", "3.11"] - include: - - os: windows-latest - python-version: "3.9" - experimental: true - - os: windows-latest - python-version: "3.10" - experimental: true - - os: windows-latest - python-version: "3.11" - experimental: true steps: - name: Check out repository code