Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Upload distribution files to GitHub Releases (#177)
* refactor(github): create upload_asset function Create a function to call the asset upload API. This will soon be used to upload assets specified by the user. * refactor(github): infer Content-Type from file extension Infer the Content-Type header based on the file extension instead of setting it manually. * refactor(pypi): move building of dists to cli.py Refactor to have the building/removal of distributions in cli.py instead of within the upload_to_pypi function. This makes way for uploading to other locations, such as GitHub Releases, too. * feat(github): upload dists to release Upload Python wheels to the GitHub release. Configured with the option upload_to_release, on by default if using GitHub. * docs: document upload_to_release config option * test(github): add tests for Github.upload_dists * fix(github): fix upload of .whl files Fix uploading of .whl files due to a missing MIME type (defined custom type as application/x-wheel+zip). Additionally, continue with other uploads even if one fails. * refactor(cli): additional output during publish Add some additional output during the publish command. * refactor(github): move api calls to separate methods Move each type of GitHub API request into its own method to improve readability. Re-implementation of #172 * fix: post changelog after PyPI upload Post the changelog in-between uploading to PyPI and uploading to GitHub Releases. This is so that if the PyPI upload fails, GitHub users will not be notified. GitHub uploads still need to be processed after creating the changelog as the release notes must be published to upload assets to them.
- Loading branch information
Showing
9 changed files
with
301 additions
and
82 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"""Build and manage distributions | ||
""" | ||
from invoke import run | ||
|
||
|
||
def build_dists(): | ||
run('python setup.py sdist bdist_wheel') | ||
|
||
|
||
def remove_dists(path: str): | ||
run(f'rm -rf {path}') |
This file contains 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
This file contains 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
Oops, something went wrong.