Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
8 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,19 @@ | ||
"""PyPI | ||
""" | ||
from invoke import run | ||
from twine import settings | ||
from twine.commands import upload as twine_upload | ||
|
||
|
||
def upload_to_pypi( | ||
dists: str = 'sdist bdist_wheel', | ||
username: str = None, | ||
password: str = None, | ||
skip_existing: bool = False | ||
): | ||
"""Creates the wheel and uploads to pypi with twine. | ||
:param dists: The dists string passed to setup.py. Default: 'bdist_wheel' | ||
:param username: PyPI account username string | ||
:param password: PyPI account password string | ||
:param skip_existing: Continue uploading files if one already exists. (Only valid when | ||
uploading to PyPI. Other implementations may not support this.) | ||
""" | ||
run('python setup.py {}'.format(dists)) | ||
twine_upload.upload( | ||
settings.Settings( | ||
username=username, | ||
password=password, | ||
skip_existing=skip_existing, | ||
), | ||
['dist/*'], | ||
) | ||
run('twine upload -u {} -p {}'.format(username, password)) | ||
run('rm -rf build dist') |
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