Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow codecov to correctly find file paths
Browse files Browse the repository at this point in the history
abravalheri committed Jan 25, 2022
1 parent e266be8 commit 4b5baaa
Showing 5 changed files with 81 additions and 21 deletions.
5 changes: 4 additions & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
@@ -2,4 +2,7 @@ comment: false
coverage:
status:
project:
threshold: 0.5%
default:
threshold: 0.5%
fixes:
- "src/::" # reduce root e.g., "src/setuptools/" => "setuptools/"
26 changes: 25 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
[run]
source_pkgs =
setuptools
pkg_resources
omit =
# leading `*/` for pytest-dev/pytest-cov#456
*/.tox/*
*/_vendor/*
*/_distutils/*
*/tests/*
*/test_*/*
*/pip-run-*/*
*/pip-build*/*
*/pip-req-build*/*
*/pip-standalone*/*
/tmp/easy_install*/*
/tmp/tmp*/setup.py

[paths]
setuptools =
setuptools/
*/site-packages/setuptools/
*/pip-install-*/setuptools_*/setuptools/
*/tmp*/setuptools
pkg_resources =
pkg_resources/
*/site-packages/pkg_resources/
*/pip-install-*/setuptools_*/pkg_resources/
*/tmp*/pkg_resources

[report]
show_missing = True
25 changes: 25 additions & 0 deletions .coveragerc.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[run]
source_pkgs =
setuptools
pkg_resources
omit =
# leading `*/` for pytest-dev/pytest-cov#456
*/_vendor/*
*/_distutils/*
*/tests/*
*/test_*

[paths]
setuptools =
src/setuptools/
*/site-packages/setuptools/
*/pip-install-*/setuptools_*/setuptools/
*/tmp*/setuptools
pkg_resources =
src/pkg_resources/
*/site-packages/pkg_resources/
*/pip-install-*/setuptools_*/pkg_resources/
*/tmp*/pkg_resources

[report]
show_missing = True
45 changes: 26 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -65,8 +65,7 @@ jobs:
run: |
python -m pip install tox
- name: Run tests
run: |
python -m tox
run: python -m tox -- --cov-report xml --cov-report term

test:
needs: prepare
@@ -103,14 +102,15 @@ jobs:
- name: Isolate tests to avoid PYTHONPATH interference
run: |
# Avoid problems with import paths, see #2318, #3015:
# `mkdir` `git rm` and `git mv` are OS-independent commands
git mv setuptools/tests test_setuptools
git mv pkg_resources/tests test_pkg_resources
# Prevent local directories to take precedence over installed packages:
git rm -rf _distutils_hack
git rm -rf setuptools
git rm -rf pkg_resources
# `git rm` and `git mv` are OS-independent commands
- name: Retrieve pre-built distribution archive
mkdir src
git mv _distutils_hack src
git mv setuptools src
git mv pkg_resources src
- name: Retrieve pre-built distribution files
uses: actions/download-artifact@v2
with:
name: python-distribution-files
@@ -127,9 +127,8 @@ jobs:
run: >-
python -m tox
--installpkg '${{ needs.prepare.outputs.wheel-distribution }}'
-- --cov-report xml
-- --cov-report xml --cov-report term --cov-config .coveragerc.ci
- name: Publish coverage
if: false # disabled for #2727
uses: codecov/codecov-action@v1
with:
flags: >- # Mark which lines are covered by which envs
@@ -168,14 +167,15 @@ jobs:
shell: C:\cygwin\bin\env.exe CYGWIN_NOWINPATH=1 CHERE_INVOKING=1 C:\cygwin\bin\bash.exe -leo pipefail -o igncr {0}
run: |
# Avoid problems with import paths, see #2318, #3015:
# `mkdir` `git rm` and `git mv` are OS-independent commands
git mv setuptools/tests test_setuptools
git mv pkg_resources/tests test_pkg_resources
# Prevent local directories to take precedence over installed packages:
git rm -rf _distutils_hack
git rm -rf setuptools
git rm -rf pkg_resources
# `git rm` and `git mv` are OS-independent commands
- name: Retrieve pre-built distribution archive
mkdir src
git mv _distutils_hack src
git mv setuptools src
git mv pkg_resources src
- name: Retrieve pre-built distribution files
uses: actions/download-artifact@v2
with:
name: python-distribution-files
@@ -185,7 +185,13 @@ jobs:
run: >-
python -m tox
--installpkg '${{ needs.prepare.outputs.wheel-distribution }}'
-- --cov-report xml
-- --cov-report xml --cov-report term --cov-config .coveragerc.ci
- name: Publish coverage
uses: codecov/codecov-action@v1
with:
flags: >- # Mark which lines are covered by which envs
cygwin
${{ matrix.python }}
integration-test:
strategy:
@@ -224,13 +230,14 @@ jobs:
- name: Isolate tests to avoid PYTHONPATH interference
run: |
# Avoid problems with import paths, see #2318, #3015:
# `mkdir` `git rm` and `git mv` are OS-independent commands
git mv setuptools/tests test_setuptools
git mv pkg_resources/tests test_pkg_resources
# Prevent local directories to take precedence over installed packages:
git rm -rf _distutils_hack
git rm -rf setuptools
git rm -rf pkg_resources
# `git rm` and `git mv` are OS-independent commands
mkdir src
git mv _distutils_hack src
git mv setuptools src
git mv pkg_resources src
- name: Retrieve pre-built distribution files
uses: actions/download-artifact@v2
with:
1 change: 1 addition & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@ def pytest_configure(config):


collect_ignore = [
'src',
'tests/manual_test.py',
'setuptools/_distutils',
'_distutils_hack',

0 comments on commit 4b5baaa

Please sign in to comment.