-
Notifications
You must be signed in to change notification settings - Fork 308
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
test_make_user_agent_string() failing in Debian build #870
Comments
@stefanor It's not clear to me why you're trying to run the tests in the environment that you described, or why you've even got an environment set up that way. However, it does sound like it's deviating from what I consider to be Twine's "standard" development/test environment, i.e. virtual environments, managed by tox, where Twine and its dependencies are installed via That said, I'd be surprised if #858 is the root cause, because it doesn't change anything related to the version of |
I suspect that this is because |
We (Debian) like to run the test-suites of packages when we build them (and when any of their dependencies change), so that we can be sure that we're shipping something that's working.
Now that I'm off an island with better cell coverage, and can play around, it looks simpler than I thought:
That's a pretty standard setup, and the name changed, I'd assume that's #858. How much do you care about the User-Agent format? |
Ah, I see that I misspoke; #858 clearly changes from an explicit list of package names to using Twine's metadata, which could result in the observed behavior (which I was able to reproduce from the previous comment). Given that, I don't understand why the test is passing in Twine's CI, and I don't know how to reproduce the failing test.
Not very much, I think. |
PyPI can parse it and use it for the purpose of debugging why a request went bad. Since PyPI can parse both |
I'll also point out that we were sending a static, constrained list of dependency names and versions. Now we seem to be including things that aren't strictly necessary to send which means that from a privacy stand-point we're potentially sending more information than a user might be comfortable (given users are probably already uncomfortable that we're sending packages and versions in the U-A). Would it be plausible to filter what we send to PyPI to what it would need to understand why a thing failed? I don't imagine PyPI should care that we're using |
We probably also want to see if PyPI even uses any of this and if it's worth sending in the U-A. When I added it, I had talked to Donald about the potential value but I don't know if it's ever been realized |
After a little more playing around: From what I can tell, the difference in behaviour is that when tox runs it has the twine sources in the current working directory, and prefers those to the twine module installed in the venv. So, I'd suggest that the test is checking for the wrong string, but as noted above, this isn't a big deal. For the moment, I'm carrying a patch in Debian to change the checked string. |
This all sounds reasonable to me, so I'm reopening this issue. |
We also got the same issue on Fedora while trying to build the latest version as an rpm and running the tests. |
@di Before I go searching the warehouse code, do you have a quick answer to whether or not PyPI uses the packages and versions that Twine is sending in the User-Agent string? |
A code search in warehouse seems to indicate that User-Agent is just used to set the So, it seems fine to remove the dependencies from the User-Agent string: Lines 93 to 99 in 133f8ae
|
* Canonicalize dependencies Closes: #870 * Explicitly select packages for User-Agent inclusion Revert back to a manual list of packages reported in the User-Agent string and --version. Reverting the part of #858 that switched to parsing twine's requires. See: #870 * Update package list * Remove dependencies from User-Agent * Add changelog entry Co-authored-by: Brian Rutledge <brian@bhrutledge.com>
* Canonicalize dependencies Closes: #870 * Explicitly select packages for User-Agent inclusion Revert back to a manual list of packages reported in the User-Agent string and --version. Reverting the part of #858 that switched to parsing twine's requires. See: #870 * Update package list * Remove dependencies from User-Agent * Add changelog entry Co-authored-by: Brian Rutledge <brian@bhrutledge.com>
Your Environment
sdist
.The Issue
Please describe the issue that you are experiencing.
On a sailboat with terrible Internet connectivity right now, I don't have the bandwidth to dig around. But:
Not sure exactly what changed here to cause
importlib-metadata
to not becomeimportlib_metadata
It seems that the change tolist_dependencies_and_versions()
in #858 expectedimportlib_metadata
and that isn't being delivered in this run.Maybe the difference is that in my environment
importlib_metadata
's metadata is in egg-info form, not dist-info form.Steps to Reproduce
If the issue is predictable and consistently reproducible, please list the steps here.
python3-importlib-metadata
from the Debian archive.The text was updated successfully, but these errors were encountered: