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

typing-extensions vs. typing_extensions #173

Closed
jherland opened this issue Feb 20, 2023 · 0 comments · Fixed by #193
Closed

typing-extensions vs. typing_extensions #173

jherland opened this issue Feb 20, 2023 · 0 comments · Fixed by #193
Assignees

Comments

@jherland
Copy link
Member

While attempting to run FD on itself (after #169), I found this pair in our output:

These imports appear to be undeclared dependencies:
- 'typing_extensions'
These dependencies appear to be unused (i.e. not imported):
- 'typing-extensions'

More checking with --json reveals that we are using the identity mapping for this dependency:

  "unused_deps": [
    {
      "name": "typing-extensions",
      "references": [
        {
          "name": "typing-extensions",
          "source": {
            "path": "pyproject.toml"
          },
          "import_names": [
            "typing-extensions"
          ],
          "mapping": "IDENTITY"
        }
      ]
    }

and the module is indeed not returned from importlib_metadata.packages_distributions(), because we instead get this:

{ 'typing_extensions': ['typing_extensions'], }

meaning that - according to importlib_metadata the package is indeed called typing_extensions. pip also agrees with this:

$ pip list
...
typing_extensions  4.4.0
...

So we have a package that is installed as typing-extensions via our pyproject.toml (and is referred to by this name in many other packages as well, is presented as typing-extensions on PyPI (although searching for either name gets you there), and you can pip install it using either name.

However, no matter how you install it, it will from that point be known as typing_extensions inside your virtualenv.

I wonder if the only way to deal with this is to do the same/similar normalization that most other tools seem to already be doing... 🤔

@jherland jherland added this to the First public release milestone Feb 21, 2023
@jherland jherland changed the title typing-extensions vs. typing_extenstions typing-extensions vs. typing_extensions Feb 27, 2023
@jherland jherland self-assigned this Feb 27, 2023
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 a pull request may close this issue.

1 participant