Skip to content

Added reference to attributes from parent module in CPython #14

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

Merged
merged 3 commits into from
Jan 16, 2022
Merged

Added reference to attributes from parent module in CPython #14

merged 3 commits into from
Jan 16, 2022

Conversation

aziascreations
Copy link
Contributor

This just a simple patch to add references to the implementation's hashlib attributes if it exists.

This omission caused the "adafruit_rsa" library to return the following error on CPython, but not on CircuitPython:

<redacted>
File "<redacted>\adafruit_rsa\__init__.py", line 17, in <module>
    from adafruit_rsa.pkcs1 import (
File "<redacted>\adafruit_rsa\pkcs1.py", line 37, in <module>
    "MD5": hashlib.md5,
AttributeError: module 'adafruit_hashlib' has no attribute 'md5'

More checks can be added if needed in order to reference the library's implementation of the hashing algorithms if they are not present in the implementation's version of hashlib.

@brentru
Copy link
Member

brentru commented Apr 21, 2021

Hi @aziascreations - this patch is failing on our build CI, specifically on the PyLint step: https://github.com/adafruit/Adafruit_CircuitPython_hashlib/pull/14/checks?check_run_id=2399955531

Please read thru https://learn.adafruit.com/improve-your-code-with-pylint and make the required changes. If you have any questions about this process, please let me know.

@jposada202020
Copy link
Contributor

@aziascreations Hello, would you able to check the links that brentru gave you, let me know if you need any help, we could help you with the PR. Thanks

@evaherrada evaherrada changed the base branch from master to main June 7, 2021 17:30
@FoamyGuy FoamyGuy requested a review from a team December 9, 2021 02:29
@FoamyGuy
Copy link
Contributor

FoamyGuy commented Dec 9, 2021

I re-created the error reported and confirmed the fix.

I've added a commit to import the algos instead of declaring variables which avoids the invalid-name issue.

@brentru what do you think of latest version in this PR?

Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix looks good to me. Tested successfully with CPython

@FoamyGuy FoamyGuy merged commit 7eac29a into adafruit:main Jan 16, 2022
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jan 17, 2022
Updating https://github.com/adafruit/Adafruit_CircuitPython_asyncio to 0.5.5 from 0.5.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_asyncio#13 from dhalbert/forgot-await-message

Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE to 8.1.4 from 8.1.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_BLE#149 from tekktrik/doc/add-missing-files

Updating https://github.com/adafruit/Adafruit_CircuitPython_hashlib to 1.4.1 from 1.4.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_hashlib#14 from aziascreations/master
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 this pull request may close these issues.

4 participants