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

Deprecate encryption methods and make eciespy dependency optional #110

Merged
merged 2 commits into from
Mar 14, 2024

Conversation

MHHukiewitz
Copy link
Member

eciespy is not actively maintained anymore and may cause problems when installed alongside newer versions of web3py and ethereum-related packages.

The solution makes installing eciespy optional, deprecates the Account.encrypt() and .decrypt() functions and will move them in future to their own aleph.sdk.encryption module.

eciespy is not actively maintained anymore and may cause problems when installed alongside newer versions of web3py and ethereum-related packages
@github-actions github-actions bot added the BLACK This PR has critical implications and must be reviewed by a senior engineer. label Mar 13, 2024
Copy link

  • New Dependencies: eciespy is a new dependency introduced which could introduce compatibility issues with other parts of the codebase or external libraries.
  • Deprecated Methods: The encrypt and decrypt methods in common.py file are deprecated and will be moved to their own modules, this could potentially break existing uses of these methods.
  • Potential Breaking Changes: There might be breaking changes introduced by the new dependencies or modifications to the codebase that may affect other parts of the system.

Consideration for reviewers should include understanding the impact on the codebase and ensuring that any potential issues are addressed before merging this PR. Only experienced developers should review 'BLACK' PRs, and the label should be used sparingly if possible.

# Example of how to use the CRC in a Python script
import subprocess

def categorize_pr(repo_name, description, rules, diff):
    user_message = f"""--- {repo_name} ---\n{description}\n\nRules: {rules}\n\nDiff:\n{diff}"""
    
    process = subprocess.run(['crc', '--input', '-'], input=user_message, text=True, capture_output=True)
    
    return process.stdout.strip()

repo_name = "aleph-im/aleph-sdk-python"
description = "Python SDK library for the Aleph.im network"
rules = ""
diff = """# Diff content here"""

print(categorize_pr(repo_name, description, rules, diff))

This script will run the CRC and print its output. The --input flag is used to pass the user message directly to the subprocess.

@MHHukiewitz MHHukiewitz merged commit 8503c3b into main Mar 14, 2024
11 checks passed
@MHHukiewitz MHHukiewitz deleted the mhh-optional-encryption-deps branch March 14, 2024 10:15
MHHukiewitz added a commit that referenced this pull request Mar 15, 2024
* Setup hatch for project & dependencies management

* Fix build targets

* Add Mike as author

* Remove unneeded files

* Add missing configs from setup.py

* Update README.md to reflect latest changes and use hatch in setup

* Add Flake8-pyproject plugin to enable flake8 configuration through pyproject.toml; Add ethereum deps to "testing" deps; Update workflows to only use `pip install -e .[testing]`

* Revert faulty formatting

* Move mypy.ini to pyproject.toml and make it lean

* Remove need for mypy.ini in workflow

* Fix mypy config

* Adding py.typed marker and automatically install type stubs when running mypy

* Use LICENCE.txt file in pyproject.toml

* Add classifiers

* Use VCS version (git tag)

* Add envs for testing and linting

* Merge optional encryption dependencies from #110

* Fix test and coverage; remove need for docker files in pytest workflow

* Fix workflows

* Further improve hatch scripts and workflows

* Fix python-version matrix

* Fix missing test dependencies

* Fix missing test dependencies for Python 3.12 and further improve workflow

* Remove Python 3.12 from supported versions

* Update pyproject.toml

Co-authored-by: Hugo Herter <[email protected]>

* Update pyproject.toml

Co-authored-by: Hugo Herter <[email protected]>

* Unify script/env names to equal aleph-vm conventions

* Fix codecov action param

* Add coverage.py for the codecov action

---------

Co-authored-by: Hugo Herter <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BLACK This PR has critical implications and must be reviewed by a senior engineer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants