Python 3 support, packaging, docs tweaks, code fixes, CI#6
Open
tony wants to merge 42 commits intoQencode-Corp:masterfrom
Open
Python 3 support, packaging, docs tweaks, code fixes, CI#6tony wants to merge 42 commits intoQencode-Corp:masterfrom
tony wants to merge 42 commits intoQencode-Corp:masterfrom
Conversation
This was referenced Jul 11, 2020
Closed
Closed
40c7ad8 to
afbec9a
Compare
Contributor
Author
|
@qencode-dev Rebased against e05c195 Also - Let me know if you would like me to make this PR smaller, e.g. without the formatting of the code, without poetry, etc. |
As a helper/for code completion and simplicity, make the params available through the root module withing having to import via qencode.custom_params.
Class instances should start with capital letters and always the pure object being classified if possible (for code completion, api interlinking, type annotations, etc)
In python 3, mutating a dict in a for loop will raise a RuntimeError
Contributor
Author
|
@VladimirParkhomenko @qencode-dev Rebased against master at 66c4674 |
Closed
Contributor
Author
|
Let me know if you want to go forward with this! We are currently using this in production. The reason I ask is since this PR adds black, it takes time to fix the conflicts. If you do let me know and I can rebase and fix them. Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2
Updates
Hi! I am a downstream package user and would like to contribute some fixes / suggestions to the library which got it working for us.
The conventions below are derived from whats common in other open source Python libraries and API (I maintain a few open source packages)
Github CI action
See it in action here: eduflow#1 (build example)
This will check tests, styling, etc. when pull requests and pushes are made. It checks Python 2 and 3
Codecov
For qencode team: Go to https://codecov.io/gh/qencode-dev/qencode-api-python-client and get the API key
Put the API key in Settings -> Secrets (no,
fafe668d-3d2b-4584-b8d3-f2b70feff1ffisn't our key 😆)Python 2 + 3 support
Use
._compatmodule and relative imports to iron out python 2/3 differencesPackage normalization
__init__.pyno long has variables that shadow module names, e.g.custom_params =in__init__.pywhencustom_params.pyexists in same module. This caused tricky import errors when the library was being usedQencodeApiClientrenamed toClient, available viaqencode.Clientqencode.format()in favor ofqencode.Format(). Instantiated classes should always be accessible via the base class with capital letter (unless its a factory function - there wasn't a reason for the abstractionEnvironment
Add Poetry for environmental setup and running
Linting, formatting, sorting
Add flake8, black, and isort and configurations for them so they can be integrated with CI and apply consistently across developer machines
Basic testing
Added a test that imports qencode
Doc tweaks
Formatting of code, formatting of markdown