From dd1b11f653493d6ea3506fab4751adbd457e2afa Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 2 Dec 2020 17:30:41 -0500 Subject: [PATCH] refactor: use twine for releases --- .gitignore | 2 ++ release | 8 +++++++- setup.py | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 392c5f8..e514690 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,5 @@ doc/_build # Generated man page doc/gitlab_backup.1 + +README \ No newline at end of file diff --git a/release b/release index 2e9d392..c48de82 100755 --- a/release +++ b/release @@ -31,6 +31,11 @@ command -v rst-lint > /dev/null || { exit 1 } +command -v twine > /dev/null || { + echo -e "${RED}WARNING: Missing twine binary, please run: pip install twine==3.2.0${COLOR_OFF}\n" + exit 1 +} + if [[ "$@" != "major" ]] && [[ "$@" != "minor" ]] && [[ "$@" != "patch" ]]; then echo -e "${RED}WARNING: Invalid release type, must specify 'major', 'minor', or 'patch'${COLOR_OFF}\n" exit 1 @@ -125,7 +130,8 @@ git push -q origin master && git push -q --tags if [[ "$PUBLIC" == "true" ]]; then echo -e "${YELLOW}--->${COLOR_OFF} Creating python release" cp README.rst README - python setup.py sdist bdist_wheel upload > /dev/null + python setup.py sdist bdist_wheel > /dev/null + twine upload dist/* rm README fi diff --git a/setup.py b/setup.py index bb24451..e68be59 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ def open_file(fname): packages=['gitlab_backup'], scripts=['bin/gitlab-backup'], url='http://github.com/josegonzalez/python-gitlab-backup', - license=open('LICENSE.txt').read(), + license='MIT', classifiers=[ 'Development Status :: 5 - Production/Stable', 'Topic :: System :: Archiving :: Backup', @@ -43,6 +43,7 @@ def open_file(fname): ], description='backup a gitlab user or organization', long_description=open_file('README.rst').read(), + long_description_content_type='text/x-rst', install_requires=open_file('requirements.txt').readlines(), zip_safe=True, )