-
-
Notifications
You must be signed in to change notification settings - Fork 433
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
Make coverage packaging be PEP-517 compliant #1395
Comments
I'm not opposed to this, but could use help changing the tooling. |
There's not actually a problem here with PEP 517 compliance:
Certainly, coverage could change its build process to reflect recent standards, but the existing code is recognised and handled correctly, at least by a modern version of pip. Maybe the OP can give a better explanation of how to reproduce the issue, as it doesn't seem to reproduce for me. I'll note that the error reported, "Using legacy 'setup.py install' for coverage, since package 'wheel' is not installed" would not normally be given by pip if run with no special options, as |
I am sure that I did not add any argument to pip when doing so and I seen this warning being displayed multiple times (different repos using coverage). Maybe in some cases pip ends up creating a build environment for one package without wheel package, one that requires coverage. It might be related to pip or tox but I was still unable to find any place where this flag would have being set. Sadly I forgot to post full log and now I do not know on which project I seen it. I will be back with more details, i bet it will not take long to see it again as I use coverage in most projects. |
Reproduced it. It happens all the time if you do not have wheel installed. In my case macos, python 3.11-dev from pyenv, no virtualenv active and pip 22.1.1:
@pfmoore WTDY, does it count as a pip bug? Shouldn't pip install wheel when missing instead of falling back to setup.py? As wheel is not magically installed by default. PS. Either way, it is still true that removing |
As my previous post shows, it's not obvious that it's a pip bug, as it works on Windows. So my expectation is that it's something in your environment. Pip does install wheel when missing, unless there's command line settings (or configuration) to make it behave differently. What does
Not necessarily. If your environment is blocking build isolation somehow, removing |
There is no custom pip config present.
I tried to use other python versions (like 3.9 from system/brew) and I was not able to reproduce the issue, mainly because coverage already has binary wheels for most platforms and pythons. The reason why I seen this is because there is no binary wheel for 3.11 and will likely reproduce with any py311. I still think we should do something about it to avoid it, like installing wheel. |
As I showed, Sorry for the wasted time, and thanks for your patience. Coverage works fine under PEP 517 as it stands, but adding a
Note that you don't need to include wheel in Removing |
Fixes: nedbat#1395
Interestingly adding the PS. I do really appreciate your patience on this, btw feel free to rename or propose a different issue title to make it more appropriate as it is not fully PEP-517. Ditching the setup.py may be long shot, but still nice. |
I've made a pull request: #1447. It didn't have an problem with greenlet, should I be concerned? |
Hmm, I was using greenlet==1.1.2 and it worked, but in the meantime they've released 1.1.3 as requested in python-greenlet/greenlet#305, so all is well I guess. |
This is in commit 447334c. |
Now that I've done this, I can no longer run my test suite while offline. Is there way to run "make clean; tox" while not connected to the internet? |
Pip can be used offline, but you probably forgot something. Something that I almost always add inside tox file, is a |
I assume the issue is that pip attempts to install wheel which is not provisioned by venv. You could try downloading wheel ahead of time and setting |
This was what I tried: run the test suite once while online, turn off the network, run tox exactly the same again. No cleaning, etc. The second run fails. What am I doing wrong, or what do I have to do differently?
Turned off the wifi, then:
|
I suspect that this might be caused by either virtualenv or venv. For example virtualenv has some optional flags Try venv(s) first, to rule them out. |
The problem is that pip is building the project (the What you need to do is download wheels for setuptools and wheel from PyPI, and store them somewhere local. Then, when you're offline, set the envrionment variable You may need to tell tox to pass the |
This is now released as part of coverage 6.5.0. |
Version 6.5.0 — 2022-09-29 -------------------------- - The JSON report now includes details of which branches were taken, and which are missing for each file. Thanks, Christoph Blessing (`pull 1438`_). Closes `issue 1425`_. - Starting with coverage.py 6.2, ``class`` statements were marked as a branch. This wasn't right, and has been reverted, fixing `issue 1449`_. Note this will very slightly reduce your coverage total if you are measuring branch coverage. - Packaging is now compliant with `PEP 517`_, closing `issue 1395`_. - A new debug option ``--debug=pathmap`` shows details of the remapping of paths that happens during combine due to the ``[paths]`` setting. - Fix an internal problem with caching of invalid Python parsing. Found by OSS-Fuzz, fixing their `bug 50381`_. .. _bug 50381: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50381 .. _PEP 517: https://peps.python.org/pep-0517/ .. _issue 1395: nedbat/coveragepy#1395 .. _issue 1425: nedbat/coveragepy#1425 .. _pull 1438: nedbat/coveragepy#1438 .. _issue 1449: nedbat/coveragepy#1449
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [coverage](https://togithub.com/nedbat/coveragepy) | `==6.4.2` -> `==7.1.0` | [![age](https://badges.renovateapi.com/packages/pypi/coverage/7.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/coverage/7.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/coverage/7.1.0/compatibility-slim/6.4.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/coverage/7.1.0/confidence-slim/6.4.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>nedbat/coveragepy</summary> ### [`v7.1.0`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-710--2023-01-24) [Compare Source](https://togithub.com/nedbat/coveragepy/compare/7.0.5...7.1.0) - Added: the debug output file can now be specified with `[run] debug_file` in the configuration file. Closes `issue 1319`\_. - Performance: fixed a slowdown with dynamic contexts that's been around since 6.4.3. The fix closes `issue 1538`*. Thankfully this doesn't break the `Cython change`* that fixed `issue 972`\_. Thanks to Mathieu Kniewallner for the deep investigative work and comprehensive issue report. - Typing: all product and test code has type annotations. .. \_Cython change:[https://github.com/nedbat/coveragepy/pull/1347](https://togithub.com/nedbat/coveragepy/pull/1347)7 .. \_issue 972[https://github.com/nedbat/coveragepy/issues/972](https://togithub.com/nedbat/coveragepy/issues/972)72 .. \_issue 131[https://github.com/nedbat/coveragepy/issues/1319](https://togithub.com/nedbat/coveragepy/issues/1319)319 .. \_issue 15[https://github.com/nedbat/coveragepy/issues/1538](https://togithub.com/nedbat/coveragepy/issues/1538)1538 .. \_changes\_7-0-5: ### [`v7.0.5`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-705--2023-01-10) [Compare Source](https://togithub.com/nedbat/coveragepy/compare/7.0.4...7.0.5) - Fix: On Python 3.7, a file with type annotations but no `from __future__ import annotations` would be missing statements in the coverage report. This is now fixed, closing `issue 1524`\_. .. \_issue 1524:[https://github.com/nedbat/coveragepy/issues/1524](https://togithub.com/nedbat/coveragepy/issues/1524)4 .. \_changes\_7-0-4: ### [`v7.0.4`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-704--2023-01-07) [Compare Source](https://togithub.com/nedbat/coveragepy/compare/7.0.3...7.0.4) - Performance: an internal cache of file names was accidentally disabled, resulting in sometimes drastic reductions in performance. This is now fixed, closing `issue 1527`\_. Thanks to Ivan Ciuvalschii for the reproducible test case. .. \_issue 1527:[https://github.com/nedbat/coveragepy/issues/1527](https://togithub.com/nedbat/coveragepy/issues/1527)7 .. \_changes\_7-0-3: ### [`v7.0.3`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-703--2023-01-03) [Compare Source](https://togithub.com/nedbat/coveragepy/compare/7.0.2...7.0.3) - Fix: when using pytest-cov or pytest-xdist, or perhaps both, the combining step could fail with `assert row is not None` using 7.0.2. This was due to a race condition that has always been possible and is still possible. In 7.0.1 and before, the error was silently swallowed by the combining code. Now it will produce a message "Couldn't combine data file" and ignore the data file as it used to do before 7.0.2. Closes `issue 1522`\_. .. \_issue 1522:[https://github.com/nedbat/coveragepy/issues/1522](https://togithub.com/nedbat/coveragepy/issues/1522)2 .. \_changes\_7-0-2: ### [`v7.0.2`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-702--2023-01-02) [Compare Source](https://togithub.com/nedbat/coveragepy/compare/7.0.1...7.0.2) - Fix: when using the `[run] relative_files = True` setting, a relative `[paths]` pattern was still being made absolute. This is now fixed, closing `issue 1519`\_. - Fix: if Python doesn't provide tomllib, then TOML configuration files can only be read if coverage.py is installed with the `[toml]` extra. Coverage.py will raise an error if TOML support is not installed when it sees your settings are in a .toml file. But it didn't understand that `[tools.coverage]` was a valid section header, so the error wasn't reported if you used that header, and settings were silently ignored. This is now fixed, closing `issue 1516`\_. - Fix: adjusted how decorators are traced on PyPy 7.3.10, fixing `issue 1515`\_. - Fix: the `coverage lcov` report did not properly implement the `--fail-under=MIN` option. This has been fixed. - Refactor: added many type annotations, including a number of refactorings. This should not affect outward behavior, but they were a bit invasive in some places, so keep your eyes peeled for oddities. - Refactor: removed the vestigial and long untested support for Jython and IronPython. .. \_issue 1515:[https://github.com/nedbat/coveragepy/issues/1515](https://togithub.com/nedbat/coveragepy/issues/1515)5 .. \_issue 1516[https://github.com/nedbat/coveragepy/issues/1516](https://togithub.com/nedbat/coveragepy/issues/1516)16 .. \_issue 151[https://github.com/nedbat/coveragepy/issues/1519](https://togithub.com/nedbat/coveragepy/issues/1519)519 .. \_changes\_7-0-1: ### [`v7.0.1`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-701--2022-12-23) [Compare Source](https://togithub.com/nedbat/coveragepy/compare/7.0.0...7.0.1) - When checking if a file mapping resolved to a file that exists, we weren't considering files in .whl files. This is now fixed, closing `issue 1511`\_. - File pattern rules were too strict, forbidding plus signs and curly braces in directory and file names. This is now fixed, closing `issue 1513`\_. - Unusual Unicode or control characters in source files could prevent reporting. This is now fixed, closing `issue 1512`\_. - The PyPy wheel now installs on PyPy 3.7, 3.8, and 3.9, closing `issue 1510`\_. .. \_issue 1510:[https://github.com/nedbat/coveragepy/issues/1510](https://togithub.com/nedbat/coveragepy/issues/1510)0 .. \_issue 1511[https://github.com/nedbat/coveragepy/issues/1511](https://togithub.com/nedbat/coveragepy/issues/1511)11 .. \_issue 151[https://github.com/nedbat/coveragepy/issues/1512](https://togithub.com/nedbat/coveragepy/issues/1512)512 .. \_issue 15[https://github.com/nedbat/coveragepy/issues/1513](https://togithub.com/nedbat/coveragepy/issues/1513)1513 .. \_changes\_7-0-0: ### [`v7.0.0`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-700--2022-12-18) [Compare Source](https://togithub.com/nedbat/coveragepy/compare/6.5.0...7.0.0) Nothing new beyond 7.0.0b1. .. \_changes\_7-0-0b1: ### [`v6.5.0`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-650--2022-09-29) [Compare Source](https://togithub.com/nedbat/coveragepy/compare/6.4.4...6.5.0) - The JSON report now includes details of which branches were taken, and which are missing for each file. Thanks, `Christoph Blessing <pull 1438_>`*. Closes `issue 1425`*. - Starting with coverage.py 6.2, `class` statements were marked as a branch. This wasn't right, and has been reverted, fixing `issue 1449`\_. Note this will very slightly reduce your coverage total if you are measuring branch coverage. - Packaging is now compliant with `PEP 517`*, closing `issue 1395`*. - A new debug option `--debug=pathmap` shows details of the remapping of paths that happens during combine due to the `[paths]` setting. - Fix an internal problem with caching of invalid Python parsing. Found by OSS-Fuzz, fixing their `bug 50381`\_. .. \_bug 50381: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50381 .. \_PEP 517: https://peps.python.org/pep-0517/ .. \_issue 139[https://github.com/nedbat/coveragepy/issues/1395](https://togithub.com/nedbat/coveragepy/issues/1395)395 .. \_issue 14[https://github.com/nedbat/coveragepy/issues/1425](https://togithub.com/nedbat/coveragepy/issues/1425)1425 .. \_issue 1[https://github.com/nedbat/coveragepy/issues/1449](https://togithub.com/nedbat/coveragepy/issues/1449)/1449 .. \_pull [https://github.com/nedbat/coveragepy/pull/1438](https://togithub.com/nedbat/coveragepy/pull/1438)l/1438 .. \_changes\_6-4-4: ### [`v6.4.4`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-644--2022-08-16) [Compare Source](https://togithub.com/nedbat/coveragepy/compare/6.4.3...6.4.4) - Wheels are now provided for Python 3.11. .. \_changes\_6-4-3: ### [`v6.4.3`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-643--2022-08-06) [Compare Source](https://togithub.com/nedbat/coveragepy/compare/6.4.2...6.4.3) - Fix a failure when combining data files if the file names contained glob-like patterns. Thanks, `Michael Krebs and Benjamin Schubert <pull 1405_>`\_. - Fix a messaging failure when combining Windows data files on a different drive than the current directory, closing `issue 1428`*. Thanks, `Lorenzo Micò <pull 1430_>`*. - Fix path calculations when running in the root directory, as you might do in a Docker container. Thanks `Arthur Rio <pull 1403_>`\_. - Filtering in the HTML report wouldn't work when reloading the index page. This is now fixed. Thanks, `Marc Legendre <pull 1413_>`\_. - Fix a problem with Cython code measurement, closing `issue 972`*. Thanks, `Matus Valo <pull 1347_>`*. .. \_issue 972:[https://github.com/nedbat/coveragepy/issues/972](https://togithub.com/nedbat/coveragepy/issues/972)2 .. \_issue 1428[https://github.com/nedbat/coveragepy/issues/1428](https://togithub.com/nedbat/coveragepy/issues/1428)28 .. \_pull 134[https://github.com/nedbat/coveragepy/pull/1347](https://togithub.com/nedbat/coveragepy/pull/1347)347 .. \_pull 14[https://github.com/nedbat/coveragepy/issues/1403](https://togithub.com/nedbat/coveragepy/issues/1403)1403 .. \_pull 1[https://github.com/nedbat/coveragepy/issues/1405](https://togithub.com/nedbat/coveragepy/issues/1405)/1405 .. \_pull [https://github.com/nedbat/coveragepy/issues/1413](https://togithub.com/nedbat/coveragepy/issues/1413)s/1413 .. \_pull[https://github.com/nedbat/coveragepy/pull/1430](https://togithub.com/nedbat/coveragepy/pull/1430)ll/1430 .. \_changes\_6-4-2: </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/allenporter/flux-local). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xMjQuMiIsInVwZGF0ZWRJblZlciI6IjM0LjEyNC4yIn0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Describe the bug
I observed some warnings when installing coverage related to the packaging of coverage, likely caused by lack of PEP-517 compliance.
To Reproduce
Expected behavior
Full PEP-517 compliance (aka removal of setup.py and adoption of pyproject.toml).
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: