Skip to content

Setup boilerplate #1

Merged
FYJen merged 5 commits intomasterfrom
ajen_issue_3992_setup_boilerplatte
Apr 14, 2020
Merged

Setup boilerplate #1
FYJen merged 5 commits intomasterfrom
ajen_issue_3992_setup_boilerplatte

Conversation

@FYJen
Copy link
Copy Markdown
Contributor

@FYJen FYJen commented Apr 12, 2020

This PR bootstraps the framework for the SDK. The goal is to maintain the similar interface for all of our admin SDKs (starting with nodejs - https://docs.magic.link/admin-sdk/node-js)

The example below:

pip install magic-admin
from magic_admin import Magic

magic = Magic('secret_key')

# Examples for Token
magic.Token.get_issuer()
magic.Token.get_public_address()
magic.Token.decode()
magic.Token.validate()

# Examples for User
magic.User.logout_by_issuer()
magic.User.logout_by_public_address()
magic.User.logout_by_token()
magic.User.get_metadata_by_issuer()
magic.User.get_metadata_by_token()
...

The tests and pre-commit hook have been set up already. Package has been tested with

platform darwin -- Python 3.6.5, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
rootdir: /Users/ajen/pg/magic-sdk-python
plugins: web3-5.4.0, cov-2.8.1
collected 4 items

tests/unit/magic_test.py .                                                                                                                                                                                                                                             [ 25%]
tests/unit/resources/api_test.py .                                                                                                                                                                                                                                     [ 50%]
tests/unit/resources/token_test.py .                                                                                                                                                                                                                                   [ 75%]
tests/unit/resources/user_test.py .                                                                                                                                                                                                                                    [100%]

---------- coverage: platform darwin, python 3.6.5-final-0 -----------
Name                              Stmts   Miss  Cover   Missing
---------------------------------------------------------------
magic_sdk/__init__.py                 1      0   100%
magic_sdk/magic.py                    2      0   100%
magic_sdk/resources/__init__.py       2      0   100%
magic_sdk/resources/api.py            2      0   100%
magic_sdk/resources/token.py          2      0   100%
magic_sdk/resources/user.py           2      0   100%
magic_sdk/utils/__init__.py           0      0   100%
magic_sdk/utils/http.py               0      0   100%
magic_sdk/utils/time.py               0      0   100%
---------------------------------------------------------------
TOTAL                                11      0   100%


========================================================================================================================= slowest 10 test durations ==========================================================================================================================

(0.00 durations hidden.  Use -vv to show these durations.)
============================================================================================================================= 4 passed in 0.07s ==============================================================================================================================
py36 runtests: commands[4] | pre-commit install -f --install-hooks
pre-commit installed at .git/hooks/pre-commit
py36 runtests: commands[5] | pre-commit run --all-files
Flake8...................................................................Passed
Trim Trailing Whitespace.................................................Passed
Fix End of Files.........................................................Passed
Check for merge conflicts................................................Passed
Fix requirements.txt.....................................................Passed
Tests should end in _test.py.............................................Passed
Fix double quoted strings................................................Passed
Forbid new submodules....................................................Passed
Check Yaml...............................................................Passed
Check JSON...........................................(no files to check)Skipped
autopep8.................................................................Passed
Add trailing commas......................................................Passed
Reorder python imports...................................................Passed
pyupgrade................................................................Passed
__________________________________________________________________________________________________________________________________ summary ___________________________________________________________________________________________________________________________________
  py36: commands succeeded
  congratulations :)

@FYJen FYJen requested a review from d9chen April 12, 2020 00:22
@FYJen FYJen self-assigned this Apr 12, 2020
@FYJen FYJen merged commit 9c7f137 into master Apr 14, 2020
@damianjachyra damianjachyra deleted the ajen_issue_3992_setup_boilerplatte branch July 24, 2025 13:50
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.

2 participants