Skip to content

test_make_user_agent_string() failing in Debian build #870

@stefanor

Description

@stefanor

Your Environment

  1. Your operating system: Debian/unstable
  2. Version of python you are running: 3.9.10 and 3.10.2.
  3. How did you install twine? Building from the sdist.
  4. Version of twine you have installed: 3.8.0

The Issue

Please describe the issue that you are experiencing.

    def test_make_user_agent_string(default_repo):
        """Add twine and its dependencies to User-Agent session header."""
        assert "User-Agent" in default_repo.session.headers
    
        user_agent = default_repo.session.headers["User-Agent"]
        packages = (
            "twine/",
            "requests/",
            "requests-toolbelt/",
            "pkginfo/",
            "importlib_metadata/",
        )
        for p in packages:
>           assert p in user_agent
E           AssertionError: assert 'importlib_metadata/' in 'twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/24.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.9.10'

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 become importlib_metadata It seems that the change to list_dependencies_and_versions() in #858 expected importlib_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.

  1. Run the tests with python3-importlib-metadata from the Debian archive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions