From 6d88248d61c48ed2b90d01c7dc4a28246b84dd20 Mon Sep 17 00:00:00 2001 From: Adam Weeden Date: Fri, 20 Aug 2021 13:56:15 -0400 Subject: [PATCH 01/21] Convert to new pip project --- .github/workflows/pytest.yml | 40 +++++++++++++++++++ .gitignore | 3 +- README.md | 20 +++++----- coverage_lcov/__init__.py | 5 +++ .../__main__.py | 0 {coveragepy_lcov => coverage_lcov}/cli.py | 0 .../converter.py | 2 +- coveragepy_lcov/__init__.py | 1 - pyproject.toml | 10 ++--- tests/test_coverage_lcov.py | 5 +++ tests/test_coveragepy_lcov.py | 5 --- 11 files changed, 69 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/pytest.yml create mode 100644 coverage_lcov/__init__.py rename {coveragepy_lcov => coverage_lcov}/__main__.py (100%) rename {coveragepy_lcov => coverage_lcov}/cli.py (100%) rename {coveragepy_lcov => coverage_lcov}/converter.py (98%) delete mode 100644 coveragepy_lcov/__init__.py create mode 100644 tests/test_coverage_lcov.py delete mode 100644 tests/test_coveragepy_lcov.py diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml new file mode 100644 index 0000000..3898cc2 --- /dev/null +++ b/.github/workflows/pytest.yml @@ -0,0 +1,40 @@ +# This workflow will run tests on PRs + +name: PyTest On PR + +on: + pull_request: + branches: + - master + +jobs: + test: + strategy: + matrix: + python-version: + - 3.6 + - 3.7 + - 3.8 + - 3.9 + platform: + - ubuntu-latest + - macos-latest + - windows-latest + name: Install dependencies and test + runs-on: "${{ matrix.platform }}" + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "${{ matrix.python-version }}" + - name: Install poetry + run: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python - + - name: Install dependencies + run: poetry install + - name: Sanity check poetry config + run: poetry check + - name: Run poetry build + run: poetry build + - name: Run tests + run: pytest diff --git a/.gitignore b/.gitignore index b78dc98..1b6362f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ __pycache__ .DS_Store .venv +venv .python-version -/dist/* +dist .coverage lcov.info diff --git a/README.md b/README.md index fcda535..faaae8b 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,40 @@ -# coveragepy-lcov +# coverage-lcov -`coveragepy-lcov` is a simple CLI for converting `.coverage` files generated by [Coverage.py](https://github.com/nedbat/coveragepy) to the `LCOV` format. +`coverage-lcov` is a simple CLI for converting `.coverage` files generated by [Coverage.py](https://github.com/nedbat/coveragepy) to the `LCOV` format. ## Credits -This tools is based on code from [Coverage.py](https://github.com/nedbat/coveragepy/blob/master/coverage/report.py). +- This tools is based on code from [Coverage.py](https://github.com/nedbat/coveragepy/blob/master/coverage/report.py) +- This tool is forked from [coveragepy-lcov](https://github.com/chaychoong/coveragepy-lcov) by [Chay Choong](https://github.com/chaychoong) to add support for older python versions. ## Installation Using pip: ```bash -pip install coveragepy-lcov +pip install coverage-lcov ``` ## Usage ```bash # If the .coverage file is in your current working directory -coveragepy-lcov +coverage-lcov # Point to a different .coverage file path -coveragepy-lcov --data_file_path example/.coverage +coverage-lcov --data_file_path example/.coverage # Write the output to a different file path -coveragepy-lcov --output_file_path build/lcov.info +coverage-lcov --output_file_path build/lcov.info # Use relative paths in the LCOV output -coveragepy-lcov --relative_path +coverage-lcov --relative_path ``` ## Options ```text -Usage: coveragepy-lcov [OPTIONS] +Usage: coverage-lcov [OPTIONS] Options: --data_file_path TEXT Path to .coverage file @@ -48,3 +49,4 @@ Options: - [LCOV format](http://ltp.sourceforge.net/coverage/lcov/geninfo.1.php) - https://github.com/nedbat/coveragepy/issues/587 +- https://github.com/chaychoong/coveragepy-lcov diff --git a/coverage_lcov/__init__.py b/coverage_lcov/__init__.py new file mode 100644 index 0000000..ddee119 --- /dev/null +++ b/coverage_lcov/__init__.py @@ -0,0 +1,5 @@ +import os + +import toml + +__version__ = toml.load(os.path.join(os.path.dirname(__file__), "..", "pyproject.toml"))["tool"]["poetry"]["version"] diff --git a/coveragepy_lcov/__main__.py b/coverage_lcov/__main__.py similarity index 100% rename from coveragepy_lcov/__main__.py rename to coverage_lcov/__main__.py diff --git a/coveragepy_lcov/cli.py b/coverage_lcov/cli.py similarity index 100% rename from coveragepy_lcov/cli.py rename to coverage_lcov/cli.py diff --git a/coveragepy_lcov/converter.py b/coverage_lcov/converter.py similarity index 98% rename from coveragepy_lcov/converter.py rename to coverage_lcov/converter.py index 377f50d..bb68e38 100644 --- a/coveragepy_lcov/converter.py +++ b/coverage_lcov/converter.py @@ -5,7 +5,7 @@ from coverage.files import FnmatchMatcher, prep_patterns from coverage.misc import CoverageException, NoSource, NotPython -log = logging.getLogger("coveragepy_lcov.converter") +log = logging.getLogger("coverage_lcov.converter") class Converter: diff --git a/coveragepy_lcov/__init__.py b/coveragepy_lcov/__init__.py deleted file mode 100644 index 485f44a..0000000 --- a/coveragepy_lcov/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = "0.1.1" diff --git a/pyproject.toml b/pyproject.toml index c3c1ca3..cb7c2c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,14 +1,14 @@ [tool.poetry] -name = "coveragepy-lcov" -version = "0.1.1" +name = "coverage-lcov" +version = "0.2.0" description = "A simple .coverage to LCOV converter" -authors = ["Chay Choong "] -repository = "https://github.com/chaychoong/coveragepy-lcov" +authors = ["Adam Weeden ", "Chay Choong "] +repository = "https://github.com/TheCleric/coverage-lcov" readme = "README.md" keywords = ["coverage"] [tool.poetry.scripts] -coveragepy-lcov = "coveragepy_lcov.cli:main" +coverage-lcov = "coverage_lcov.cli:main" [tool.poetry.dependencies] python = "^3.6.3" diff --git a/tests/test_coverage_lcov.py b/tests/test_coverage_lcov.py new file mode 100644 index 0000000..b827ea7 --- /dev/null +++ b/tests/test_coverage_lcov.py @@ -0,0 +1,5 @@ +from coverage_lcov import __version__ + + +def test_version(): + assert __version__ == "0.2.0" diff --git a/tests/test_coveragepy_lcov.py b/tests/test_coveragepy_lcov.py deleted file mode 100644 index b41bd85..0000000 --- a/tests/test_coveragepy_lcov.py +++ /dev/null @@ -1,5 +0,0 @@ -from coveragepy_lcov import __version__ - - -def test_version(): - assert __version__ == "0.1.1" From 2e41eea9c5ab7c0b6e5fbffea66388bb35f7705d Mon Sep 17 00:00:00 2001 From: Adam Weeden Date: Fri, 20 Aug 2021 14:02:42 -0400 Subject: [PATCH 02/21] Update path so poetry is found --- .github/workflows/pytest.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 3898cc2..e252159 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -28,13 +28,21 @@ jobs: uses: actions/setup-python@v2 with: python-version: "${{ matrix.python-version }}" + - name: Install poetry run: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python - + + - name: Update PATH + run: echo "$HOME/.local/bin" >> $GITHUB_PATH + - name: Install dependencies run: poetry install + - name: Sanity check poetry config run: poetry check + - name: Run poetry build run: poetry build + - name: Run tests run: pytest From c501889fbbc16eddc7c537251f5453a943739018 Mon Sep 17 00:00:00 2001 From: Adam Weeden Date: Fri, 20 Aug 2021 14:05:25 -0400 Subject: [PATCH 03/21] Let's try this another way --- .github/workflows/pytest.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index e252159..ee29f31 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -30,10 +30,7 @@ jobs: python-version: "${{ matrix.python-version }}" - name: Install poetry - run: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python - - - - name: Update PATH - run: echo "$HOME/.local/bin" >> $GITHUB_PATH + run: pip install poetry - name: Install dependencies run: poetry install @@ -43,6 +40,6 @@ jobs: - name: Run poetry build run: poetry build - + - name: Run tests run: pytest From 9e3877f2e3346d8f9f18d51b0603a647bcdc7eaf Mon Sep 17 00:00:00 2001 From: Adam Weeden Date: Fri, 20 Aug 2021 16:26:49 -0400 Subject: [PATCH 04/21] Trying a few things... --- .github/workflows/pytest.yml | 20 ++++++++------------ .github/workflows/release.yml | 9 ++++----- pyproject.toml | 1 + 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index ee29f31..90ff516 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -13,13 +13,13 @@ jobs: matrix: python-version: - 3.6 - - 3.7 - - 3.8 - - 3.9 + # - 3.7 + # - 3.8 + # - 3.9 platform: - ubuntu-latest - - macos-latest - - windows-latest + # - macos-latest + # - windows-latest name: Install dependencies and test runs-on: "${{ matrix.platform }}" steps: @@ -28,12 +28,8 @@ jobs: uses: actions/setup-python@v2 with: python-version: "${{ matrix.python-version }}" - - - name: Install poetry - run: pip install poetry - - - name: Install dependencies - run: poetry install + + - uses: Gr1N/setup-poetry@v7 - name: Sanity check poetry config run: poetry check @@ -42,4 +38,4 @@ jobs: run: poetry build - name: Run tests - run: pytest + run: poetry run test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8d9a4e2..72e9a68 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,11 +22,7 @@ jobs: with: python-version: "3.6" - - name: Install Poetry - run: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python - - - - name: Update PATH - run: echo "$HOME/.local/bin" >> $GITHUB_PATH + - uses: Gr1N/setup-poetry@v7 - name: Build project for distribution run: poetry build @@ -45,6 +41,9 @@ jobs: draft: false prerelease: steps.check-version.outputs.prerelease == 'true' + - name: Run tests + run: poetry run test + - name: Publish to PyPI env: POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} diff --git a/pyproject.toml b/pyproject.toml index cb7c2c8..e021c1b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,6 +9,7 @@ keywords = ["coverage"] [tool.poetry.scripts] coverage-lcov = "coverage_lcov.cli:main" +test = "pytest:main" [tool.poetry.dependencies] python = "^3.6.3" From 0b9600437941cb15531a9eca2ad05ad95c72cb4d Mon Sep 17 00:00:00 2001 From: Adam Weeden Date: Fri, 20 Aug 2021 23:26:36 -0400 Subject: [PATCH 05/21] Pytest as dep? --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e021c1b..98b92fd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,9 +15,9 @@ test = "pytest:main" python = "^3.6.3" coverage = "^5.5" click = "^7.1.2" +pytest = "^5.2" [tool.poetry.dev-dependencies] -pytest = "^5.2" black = "^21.5b0" isort = "^5.8.0" From 710b6a7d9cccc7d5221368e0511dc912de041774 Mon Sep 17 00:00:00 2001 From: Adam Weeden Date: Fri, 20 Aug 2021 23:28:39 -0400 Subject: [PATCH 06/21] Add pytest in workflow? --- .github/workflows/pytest.yml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 90ff516..9dda93d 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -38,4 +38,4 @@ jobs: run: poetry build - name: Run tests - run: poetry run test + run: poetry install pytest && poetry run test diff --git a/pyproject.toml b/pyproject.toml index 98b92fd..e021c1b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,9 +15,9 @@ test = "pytest:main" python = "^3.6.3" coverage = "^5.5" click = "^7.1.2" -pytest = "^5.2" [tool.poetry.dev-dependencies] +pytest = "^5.2" black = "^21.5b0" isort = "^5.8.0" From 7861c80eeabd4328443e923716c249be4f4b6083 Mon Sep 17 00:00:00 2001 From: Adam Weeden Date: Sun, 22 Aug 2021 11:37:50 -0400 Subject: [PATCH 07/21] Add some examples from poetry's build --- .github/workflows/pytest.yml | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 9dda93d..715165f 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -29,7 +29,25 @@ jobs: with: python-version: "${{ matrix.python-version }}" - - uses: Gr1N/setup-poetry@v7 + - name: Bootstrap poetry + shell: bash + run: | + curl -sL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py \ + | python - + + - name: Update PATH + if: ${{ matrix.os != 'Windows' }} + shell: bash + run: echo "$HOME/.local/bin" >> $GITHUB_PATH + + - name: Update Path for Windows + if: ${{ matrix.os == 'Windows' }} + shell: bash + run: echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH + + - name: Configure poetry + shell: bash + run: poetry config virtualenvs.in-project true - name: Sanity check poetry config run: poetry check @@ -37,5 +55,10 @@ jobs: - name: Run poetry build run: poetry build - - name: Run tests - run: poetry install pytest && poetry run test + - name: Install dependencies + shell: bash + run: poetry install + + - name: Run pytest + shell: bash + run: poetry run python -m pytest -p no:sugar -q tests/ From af85e1b617972e8248d9c5a618ca2ea82f5dfc90 Mon Sep 17 00:00:00 2001 From: Adam Weeden Date: Sun, 22 Aug 2021 11:41:17 -0400 Subject: [PATCH 08/21] Enable matrix and add correct testing to release.yml --- .github/workflows/pytest.yml | 14 ++++++++------ .github/workflows/release.yml | 22 +++++++++++++++++++--- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 715165f..75ccac0 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -13,13 +13,13 @@ jobs: matrix: python-version: - 3.6 - # - 3.7 - # - 3.8 - # - 3.9 + - 3.7 + - 3.8 + - 3.9 platform: - ubuntu-latest - # - macos-latest - # - windows-latest + - macos-latest + - windows-latest name: Install dependencies and test runs-on: "${{ matrix.platform }}" steps: @@ -50,9 +50,11 @@ jobs: run: poetry config virtualenvs.in-project true - name: Sanity check poetry config + shell: bash run: poetry check - - name: Run poetry build + - name: Run poetry bui + shell: bash run: poetry build - name: Install dependencies diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 72e9a68..f5862cd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,14 +21,24 @@ jobs: uses: actions/setup-python@v2 with: python-version: "3.6" + + - name: Bootstrap poetry + shell: bash + run: | + curl -sL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py \ + | python - - - uses: Gr1N/setup-poetry@v7 + - name: Update PATH + shell: bash + run: echo "$HOME/.local/bin" >> $GITHUB_PATH - name: Build project for distribution + shell: bash run: poetry build - name: Check Version id: check-version + shell: bash run: | [[ "$(poetry version --short)" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] \ || echo ::set-output name=prerelease::true @@ -41,10 +51,16 @@ jobs: draft: false prerelease: steps.check-version.outputs.prerelease == 'true' - - name: Run tests - run: poetry run test + - name: Install dependencies + shell: bash + run: poetry install + + - name: Run pytest + shell: bash + run: poetry run python -m pytest -p no:sugar -q tests/ - name: Publish to PyPI env: POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} + shell: bash run: poetry publish From 80834ec82e7c3043a21bb7a5cede430c63db0f62 Mon Sep 17 00:00:00 2001 From: Adam Weeden Date: Sun, 22 Aug 2021 11:46:51 -0400 Subject: [PATCH 09/21] Try this slightly differently for Windows? --- .github/workflows/pytest.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 75ccac0..3d1fecc 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -32,8 +32,7 @@ jobs: - name: Bootstrap poetry shell: bash run: | - curl -sL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py \ - | python - + curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python - - name: Update PATH if: ${{ matrix.os != 'Windows' }} From 6df51e38bdcf1c4fae27a07081b6c0b565196146 Mon Sep 17 00:00:00 2001 From: Adam Weeden Date: Sun, 22 Aug 2021 11:48:37 -0400 Subject: [PATCH 10/21] Disable windows builds for now --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 3d1fecc..3a0f8a3 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -19,7 +19,7 @@ jobs: platform: - ubuntu-latest - macos-latest - - windows-latest + # - windows-latest name: Install dependencies and test runs-on: "${{ matrix.platform }}" steps: From e196cbff5bf995105afd61c9f2cdb571a3aacea8 Mon Sep 17 00:00:00 2001 From: Adam Weeden Date: Sun, 22 Aug 2021 11:55:52 -0400 Subject: [PATCH 11/21] Maybe get window working? --- .github/workflows/pytest.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 3a0f8a3..54bc3f1 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -19,7 +19,12 @@ jobs: platform: - ubuntu-latest - macos-latest - # - windows-latest + - windows-latest + # shell: + # - bash + # include: + # - platform: windows-latest + # shell: pwsh name: Install dependencies and test runs-on: "${{ matrix.platform }}" steps: @@ -30,17 +35,24 @@ jobs: python-version: "${{ matrix.python-version }}" - name: Bootstrap poetry + if: ${{ matrix.platform != 'windows-latest' }} shell: bash run: | curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python - + - name: Bootstrap poetry for Windows + if: ${{ matrix.platform == 'windows-latest' }} + shell: pwsh + run: | + (Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py -UseBasicParsing).Content | python - + - name: Update PATH - if: ${{ matrix.os != 'Windows' }} + if: ${{ matrix.platform != 'windows-latest' }} shell: bash run: echo "$HOME/.local/bin" >> $GITHUB_PATH - name: Update Path for Windows - if: ${{ matrix.os == 'Windows' }} + if: ${{ matrix.os == 'windows-latest' }} shell: bash run: echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH From 5e0ba4cfd342859efaca89ffd7455f0f115b4b91 Mon Sep 17 00:00:00 2001 From: Adam Weeden Date: Sun, 22 Aug 2021 12:00:52 -0400 Subject: [PATCH 12/21] Windows tweaks --- .github/workflows/pytest.yml | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 54bc3f1..2b81ca2 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -20,11 +20,10 @@ jobs: - ubuntu-latest - macos-latest - windows-latest - # shell: - # - bash - # include: - # - platform: windows-latest - # shell: pwsh + prefix: [''] + include: + - platform: windows-latest + prefix: $APPDATA\Python\Scripts\ name: Install dependencies and test runs-on: "${{ matrix.platform }}" steps: @@ -35,43 +34,36 @@ jobs: python-version: "${{ matrix.python-version }}" - name: Bootstrap poetry - if: ${{ matrix.platform != 'windows-latest' }} shell: bash run: | curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python - - - name: Bootstrap poetry for Windows - if: ${{ matrix.platform == 'windows-latest' }} - shell: pwsh - run: | - (Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py -UseBasicParsing).Content | python - - - name: Update PATH - if: ${{ matrix.platform != 'windows-latest' }} + if: ${{ matrix.platorm != 'windows-latest' }} shell: bash run: echo "$HOME/.local/bin" >> $GITHUB_PATH - name: Update Path for Windows - if: ${{ matrix.os == 'windows-latest' }} + if: ${{ matrix.platfor == 'windows-latest' }} shell: bash run: echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH - name: Configure poetry shell: bash - run: poetry config virtualenvs.in-project true + run: ${{ matrix.prefix }}poetry config virtualenvs.in-project true - name: Sanity check poetry config shell: bash - run: poetry check + run: ${{ matrix.prefix }}poetry check - name: Run poetry bui shell: bash - run: poetry build + run: ${{ matrix.prefix }}poetry build - name: Install dependencies shell: bash - run: poetry install + run: ${{ matrix.prefix }}poetry install - name: Run pytest shell: bash - run: poetry run python -m pytest -p no:sugar -q tests/ + run: ${{ matrix.prefix }}poetry run python -m pytest -p no:sugar -q tests/ From a4ee98e55a14fd1077c3339e88f520b735499fb2 Mon Sep 17 00:00:00 2001 From: Adam Weeden Date: Sun, 22 Aug 2021 12:02:37 -0400 Subject: [PATCH 13/21] Fi name and prefix path --- .github/workflows/pytest.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 2b81ca2..17c8de4 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -9,6 +9,7 @@ on: jobs: test: + name: ${{ matrix.platform }} / ${{ matrix.python-version }} strategy: matrix: python-version: @@ -23,7 +24,7 @@ jobs: prefix: [''] include: - platform: windows-latest - prefix: $APPDATA\Python\Scripts\ + prefix: $APPDATA\\Python\\Scripts\\ name: Install dependencies and test runs-on: "${{ matrix.platform }}" steps: From bb5255424a728333586841b6a3ee06d1856b528a Mon Sep 17 00:00:00 2001 From: Adam Weeden Date: Sun, 22 Aug 2021 12:04:05 -0400 Subject: [PATCH 14/21] Fi double name --- .github/workflows/pytest.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 17c8de4..50846c3 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -25,7 +25,6 @@ jobs: include: - platform: windows-latest prefix: $APPDATA\\Python\\Scripts\\ - name: Install dependencies and test runs-on: "${{ matrix.platform }}" steps: - uses: actions/checkout@v2 From 7801a9f61de770d738d0c67052a8d10b752cb01a Mon Sep 17 00:00:00 2001 From: Adam Weeden Date: Sun, 22 Aug 2021 12:06:34 -0400 Subject: [PATCH 15/21] Remove bogus include, define new path? --- .github/workflows/pytest.yml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 50846c3..e86696e 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -21,10 +21,6 @@ jobs: - ubuntu-latest - macos-latest - windows-latest - prefix: [''] - include: - - platform: windows-latest - prefix: $APPDATA\\Python\\Scripts\\ runs-on: "${{ matrix.platform }}" steps: - uses: actions/checkout@v2 @@ -41,29 +37,29 @@ jobs: - name: Update PATH if: ${{ matrix.platorm != 'windows-latest' }} shell: bash - run: echo "$HOME/.local/bin" >> $GITHUB_PATH + run: echo "$HOME/.local/bin" >> $POETRY_PATH - name: Update Path for Windows if: ${{ matrix.platfor == 'windows-latest' }} shell: bash - run: echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH + run: echo "$APPDATA\Python\Scripts" >> $POETRY_PATH - name: Configure poetry shell: bash - run: ${{ matrix.prefix }}poetry config virtualenvs.in-project true + run: ${{ POETRY_PATH }}poetry config virtualenvs.in-project true - name: Sanity check poetry config shell: bash - run: ${{ matrix.prefix }}poetry check + run: ${{ POETRY_PATH }}poetry check - name: Run poetry bui shell: bash - run: ${{ matrix.prefix }}poetry build + run: ${{ POETRY_PATH }}poetry build - name: Install dependencies shell: bash - run: ${{ matrix.prefix }}poetry install + run: ${{ POETRY_PATH }}poetry install - name: Run pytest shell: bash - run: ${{ matrix.prefix }}poetry run python -m pytest -p no:sugar -q tests/ + run: ${{ POETRY_PATH }}poetry run python -m pytest -p no:sugar -q tests/ From 60ce9a6874039f694a14c29f4f6816bbfd86f865 Mon Sep 17 00:00:00 2001 From: Adam Weeden Date: Sun, 22 Aug 2021 12:09:18 -0400 Subject: [PATCH 16/21] Setup POETRY_PATH var --- .github/workflows/pytest.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index e86696e..1979b77 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -10,6 +10,8 @@ on: jobs: test: name: ${{ matrix.platform }} / ${{ matrix.python-version }} + env: + POETRY_PATH: '' strategy: matrix: python-version: From de9016b112949700bdf20eff6aedd4b05a37568f Mon Sep 17 00:00:00 2001 From: Adam Weeden Date: Sun, 22 Aug 2021 12:13:33 -0400 Subject: [PATCH 17/21] Maybe this works? --- .github/workflows/pytest.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 1979b77..d703e31 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -39,12 +39,14 @@ jobs: - name: Update PATH if: ${{ matrix.platorm != 'windows-latest' }} shell: bash - run: echo "$HOME/.local/bin" >> $POETRY_PATH + run: echo "::set-env name=POETRY_PATH::$HOME/.local/bin" + # run: echo "$HOME/.local/bin" >> $POETRY_PATH - name: Update Path for Windows if: ${{ matrix.platfor == 'windows-latest' }} shell: bash - run: echo "$APPDATA\Python\Scripts" >> $POETRY_PATH + run: echo "::set-env name=POETRY_PATH::$APPDATA\\Python\\Scripts" + # run: echo "$APPDATA\Python\Scripts" >> $POETRY_PATH - name: Configure poetry shell: bash From 91baecdb819c69e48b8f61788f96fba740fb411f Mon Sep 17 00:00:00 2001 From: Adam Weeden Date: Sun, 22 Aug 2021 12:15:51 -0400 Subject: [PATCH 18/21] Let's just see what we have --- .github/workflows/pytest.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index d703e31..20e0834 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -10,8 +10,6 @@ on: jobs: test: name: ${{ matrix.platform }} / ${{ matrix.python-version }} - env: - POETRY_PATH: '' strategy: matrix: python-version: @@ -39,14 +37,16 @@ jobs: - name: Update PATH if: ${{ matrix.platorm != 'windows-latest' }} shell: bash - run: echo "::set-env name=POETRY_PATH::$HOME/.local/bin" - # run: echo "$HOME/.local/bin" >> $POETRY_PATH + run: echo "$HOME/.local/bin" >> $GITHUB_PATH - name: Update Path for Windows if: ${{ matrix.platfor == 'windows-latest' }} shell: bash - run: echo "::set-env name=POETRY_PATH::$APPDATA\\Python\\Scripts" - # run: echo "$APPDATA\Python\Scripts" >> $POETRY_PATH + run: echo "$APPDATA\\Python\\Scripts" >> $GITHUB_PATH + + - name: Echo path + shell: bash + run: echo $GITHUB_PATH - name: Configure poetry shell: bash From 51142f8952b5d76cbf9fbf67604c44a354bcc760 Mon Sep 17 00:00:00 2001 From: Adam Weeden Date: Sun, 22 Aug 2021 12:16:28 -0400 Subject: [PATCH 19/21] Remove ${{ POETRY_PATH }} --- .github/workflows/pytest.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 20e0834..e4d6ce2 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -50,20 +50,20 @@ jobs: - name: Configure poetry shell: bash - run: ${{ POETRY_PATH }}poetry config virtualenvs.in-project true + run: poetry config virtualenvs.in-project true - name: Sanity check poetry config shell: bash - run: ${{ POETRY_PATH }}poetry check + run: poetry check - name: Run poetry bui shell: bash - run: ${{ POETRY_PATH }}poetry build + run: poetry build - name: Install dependencies shell: bash - run: ${{ POETRY_PATH }}poetry install + run: poetry install - name: Run pytest shell: bash - run: ${{ POETRY_PATH }}poetry run python -m pytest -p no:sugar -q tests/ + run: poetry run python -m pytest -p no:sugar -q tests/ From 5c59f82f35a73e979074231a9e3e9a77405178aa Mon Sep 17 00:00:00 2001 From: Adam Weeden Date: Sun, 22 Aug 2021 12:17:46 -0400 Subject: [PATCH 20/21] Could I just be this dumb? --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index e4d6ce2..08caa0b 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -40,7 +40,7 @@ jobs: run: echo "$HOME/.local/bin" >> $GITHUB_PATH - name: Update Path for Windows - if: ${{ matrix.platfor == 'windows-latest' }} + if: ${{ matrix.platform == 'windows-latest' }} shell: bash run: echo "$APPDATA\\Python\\Scripts" >> $GITHUB_PATH From 87183b355db0dba91a07db8831d61f275b4c716c Mon Sep 17 00:00:00 2001 From: Adam Weeden Date: Sun, 22 Aug 2021 12:22:17 -0400 Subject: [PATCH 21/21] Remove debug echo --- .github/workflows/pytest.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 08caa0b..5a785c2 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -44,10 +44,6 @@ jobs: shell: bash run: echo "$APPDATA\\Python\\Scripts" >> $GITHUB_PATH - - name: Echo path - shell: bash - run: echo $GITHUB_PATH - - name: Configure poetry shell: bash run: poetry config virtualenvs.in-project true