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

Api models #223

Merged
merged 9 commits into from
Apr 12, 2020
Merged

Api models #223

merged 9 commits into from
Apr 12, 2020

Conversation

adithyabsk
Copy link
Member

@adithyabsk adithyabsk commented Apr 12, 2020

Checklist

  • Added tests for changed code.
  • Updated documentation for changed code.
  • I've added a news fragment of my changes with the name,
    "{ISSUE_NUM}.{feature|bugfix|doc|removal|misc}""

Related Issue

No related issues.

Description by File

Note: these are only the important files

  • .github/workflows/main.yml
    • Updated the listing process to install all dependencies so that static type checking can occur using mpy
    • Fix cache paths in restore-key
  • .pre-commit-config.yaml
    • Bump pre-commit config python version
    • Let mypy use locally installed version
    • Add darglint to pre-commit
  • pyproject.toml
    • Add darglint for function signature and docstring agreement checking
    • Add freezegun to allow for freezing of time when unit testing
    • Make sure extras points at toolkit and not toml
  • init.py
    • Patch bug that depended on pyproject.toml being shipped in the wheels for versioning to work
  • endpoints
    • Use yarl for easy URL management
  • exceptions
    • refactor to make more pythonic and drop unused
  • models folder
    • refactor sessionmanager so that it now sits in the models folder
    • Add a BaseModel: all models inherit from this and hence SimpleNamepsace
    • Add BaseSchema: all schemas inherit from this and are hooked to a particular model
    • Add OAuth and Challenge models and schemas to be used in SessionManager
    • SessionManager
      • Refactor to use new models
      • add dump and load functions to allow convenient storing of credentials
  • test_*.py
    • Add relevant tests

models.

* Update example notebook
* Add packages:
  * pytz (already dep)
  * marshmallow (serialization)
* Move constant endpoints in session manager to endpoints.py
* Add models file
* Add models file with project models and schema
  * BaseModel + BaseSchema
  * OAuth + OAuthSchema
* Re-factor tests
* Move mypy to local execution and add poetry installation steps to the
  build process
* Add freezegun package
* Resolve typing issues in project
* ABCMeta typing issue with requests package
  * python/mypy#5264 (comment)
* Run pytest and remove broken test as functionality was removed.
* Ignore D106, this will be quite annoying with marshmallow's required
  Meta subclass definition.
* _process_dict_values failed to account for passthrough case
* Mark type checking code as no cover
* Remove unnecessary status checking in login oauth code
* Add test for token_expired and login_set in test_sessionamanger
* Add tests for base model and schema
* Add tests for challenge and oauth models
@adithyabsk adithyabsk merged commit e58f385 into master Apr 12, 2020
@adithyabsk adithyabsk deleted the api_models branch April 12, 2020 07:44
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.

1 participant