Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exclude eggsupport.py from coverage #184

Closed
wants to merge 3 commits into from
Closed

Conversation

d-maurer
Copy link
Contributor

This PR excludes eggsupport.py from the coverage analysis:
the eggsupport.py functionality is available only for older setuptools versions and the GH testrunnter uses a newer one. As a consequence, eggsupport.py is no longer covered by the test suite and the coverage check fails.

…to `.coveragerc`"

This reverts commit f4d3cbc.

The `coveralls` part fails on GH for unknown reasons with the `.coveragerc` file.
Leave the `coverage omit` in `tox.ini` and let later find out who to get it there
through the generation process.
@d-maurer
Copy link
Contributor Author

Help needed:
The PR wants to exclude eggsupport.py from the coverage analysis. There are several possibilities: tox.ini, .coveragerc, setup.cfg, pyproject.toml.

It started with a tox.ini modification (successful) but tox.ini is generated by meta. I failed to see how to adjust the configuration for this generation to get the wanted tox.ini change because the corrent tox.ini seems not to have been generated by the current meta configuration: the coverage report call in tox.ini has parameters not present in the template's tox.ini.j2.

Using .coveragerc succeeded locally but failed on GH with a not understood problem relating to coveralls.

I switched back to the tox.ini approach. This will be lost when tox.ini is regenerated. I hope someone can give me a hint how to get the change into the generation configuration.

@perrinjerome
Copy link
Contributor

I don't know this well, but I'll try to help anyway.

The examples from https://zopemeta.readthedocs.io/en/latest/narr.html#options show that we can have some local additional config specific for a package. According to this, it would be a patch like this:

diff --git a/.meta.toml b/.meta.toml
index 2c2ebc9..8f90dc5 100644
--- a/.meta.toml
+++ b/.meta.toml
@@ -15,6 +15,12 @@ with-macos = false
 [coverage]
 fail-under = 84
 
+[coverage-run]
+additional-config = [
+    "omit =",
+    "    eggsupport.py",
+    ]
+
 [manifest]
 additional-rules = [
     "include *.md",

if I run with the same version of meta (

commit-id = "08a3cc69"
) it generates

diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 03cea90..a8cc240 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -39,7 +39,7 @@ jobs:
         - ["3.10",  "py310-subunit"]
         - ["3.11",  "py311-subunit"]
         - ["3.12",  "py312-subunit"]
-        - ["3.13.0-alpha - 3.13.0",  "py313-subunit"] 
+        - ["3.13.0-alpha - 3.13.0",  "py313-subunit"]
         - ["pypy-3.9", "pypy3-subunit"]
         exclude:
           - { os: ["windows", "windows-latest"], config: ["3.9",   "release-check"] }
diff --git a/tox.ini b/tox.ini
index 441ad7e..5754728 100644
--- a/tox.ini
+++ b/tox.ini
@@ -85,13 +85,15 @@ deps =
     coverage
 commands =
     mkdir -p {toxinidir}/parts/htmlcov
-    coverage run --omit eggsupport.py -m zope.testrunner --test-path=src {posargs:-vc}
+    coverage run -m zope.testrunner --test-path=src {posargs:-vc}
     coverage html --ignore-errors
     coverage report --ignore-errors --show-missing --fail-under=84
 
 [coverage:run]
 branch = True
 source = zope.testrunner
+omit =
+    eggsupport.py
 
 [coverage:report]
 precision = 2

but if I run with the current latest version it generates lots of changes, it seems @icemac is already handling these changes in #183

@d-maurer
Copy link
Contributor Author

d-maurer commented Oct 14, 2024 via email

@icemac
Copy link
Member

icemac commented Oct 15, 2024

For how old setuptools versions we need eggsupport.py? Could it be a way foreward to remove it and use the setuptools version which no longer needs it as minimum version?

@d-maurer
Copy link
Contributor Author

d-maurer commented Oct 15, 2024 via email

@d-maurer
Copy link
Contributor Author

Issue solved by #183

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants