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

Should the Crypto stubs be for pycrypto or pycryptodome? #2952

Closed
JelleZijlstra opened this issue May 4, 2019 · 7 comments
Closed

Should the Crypto stubs be for pycrypto or pycryptodome? #2952

JelleZijlstra opened this issue May 4, 2019 · 7 comments

Comments

@JelleZijlstra
Copy link
Member

We currently have a set of stubs in third_party/2and3/Crypto for a library called pycrypto However, pycrypto was apparently abandoned (the last release was in 2013), and a new library called pycryptodome replaces it. This library also uses the "Crypto" name when imported. It started as a fork but has added new features since then.

Should we update the stubs to cover pycryptodome instead of pycrypto?

I'm not sure how widely used pycryptodome is. I ran into this because I was trying to typecheck some code using "Crypto" that turned out to be using pycryptodome, not pycrypto.

@srittau
Copy link
Collaborator

srittau commented Jun 5, 2019

A bit off-topic for this issue, but when we implement #2491 (third-party stubs as packages) we should support multiple distributions providing the same packages.

pycryptodome looks to be well maintained and describes itself as a near-drop-in, so replacing it looks like a good idea to me.

@Hanaasagi
Copy link
Contributor

Hello, I meet this problem with pycryptodome. Is there some workaround?

@JelleZijlstra
Copy link
Member Author

@Hanaasagi we should probably just update our stubs to be for pycryptodome, PRs would be appreciated.

@Hanaasagi
Copy link
Contributor

I see pycryptodome already distributing it's own stub files in the pypi package. Is there some way to use the stub files?

@gvanrossum
Copy link
Member

This is a good example of why we need the new typeshed structure...

@JelleZijlstra
Copy link
Member Author

Following PEP 561, the stubs in the package should supersede the ones in typeshed already (https://www.python.org/dev/peps/pep-0561/#type-checker-module-resolution-order). So if pycryptodome properly includes a py.typed file, the typeshed stubs should already be ignored.

hauntsaninja pushed a commit to hauntsaninja/typeshed that referenced this issue Oct 4, 2020
Crypto is a package that comes from pycrypto, which was last updated in
2013. It proudly supports Python 2.1 through 3.3.
There's a near drop-in replacement from pycryptodome, which seems well
maintained. pycryptodome has provided stubs for the last two years.

I propose we get rid of the whole thing. pycrypto seems about as dead as
software can get. These stubs have received two fixes since 2016.

python#2952
https://pycryptodome.readthedocs.io/en/latest/src/vs_pycrypto.html
https://github.com/Legrandin/pycryptodome/blob/master/Changelog.rst#371-25-november-2018
hauntsaninja pushed a commit to hauntsaninja/typeshed that referenced this issue Oct 4, 2020
Crypto is a package that comes from pycrypto, which was last updated in
2013. It proudly supports Python 2.1 through 3.3.
There's a near drop-in replacement from pycryptodome, which seems well
maintained. pycryptodome has provided stubs for the last two years.

I propose we get rid of the whole thing. pycrypto seems about as dead as
software can get. These stubs have received two fixes since 2016.

python#2952
https://pycryptodome.readthedocs.io/en/latest/src/vs_pycrypto.html
https://github.com/Legrandin/pycryptodome/blob/master/Changelog.rst#371-25-november-2018
hauntsaninja added a commit that referenced this issue Oct 4, 2020
Crypto is a package that comes from pycrypto, which was last updated in
2013. It proudly supports Python 2.1 through 3.3.
There's a near drop-in replacement from pycryptodome, which seems well
maintained. pycryptodome has provided stubs for the last two years.

I propose we get rid of the whole thing. pycrypto seems about as dead as
software can get. These stubs have received two fixes since 2016.

#2952
https://pycryptodome.readthedocs.io/en/latest/src/vs_pycrypto.html
https://github.com/Legrandin/pycryptodome/blob/master/Changelog.rst#371-25-november-2018

Co-authored-by: hauntsaninja <>
@hauntsaninja
Copy link
Collaborator

Resolved by #4606

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

No branches or pull requests

5 participants