Skip to content

Commit

Permalink
refactor: use twine for releases
Browse files Browse the repository at this point in the history
  • Loading branch information
Jose Diaz-Gonzalez committed Dec 2, 2020
1 parent 44a7157 commit dd1b11f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ doc/_build

# Generated man page
doc/gitlab_backup.1

README
8 changes: 7 additions & 1 deletion release
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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,
)

0 comments on commit dd1b11f

Please sign in to comment.