##// END OF EJS Templates
scripts/make-release: fix PyPI upload by using twine...
scripts/make-release: fix PyPI upload by using twine Upload via 'python2 setup.py sdist upload' is deprecated. Worse, for unknown reasons it stopped working for 0.4, even though 0.3 did pretty much the same. Following output was given: WARNING: Uploading via this command is deprecated, use twine to upload instead (https://pypi.org/p/twine/) Traceback (most recent call last): File "setup.py", line 160, in <module> """, File "/tmp/kallithea-release-JtnfD/lib/python2.7/site-packages/setuptools/__init__.py", line 145, in setup return distutils.core.setup(**attrs) File "/usr/lib64/python2.7/distutils/core.py", line 151, in setup dist.run_commands() File "/usr/lib64/python2.7/distutils/dist.py", line 953, in run_commands self.run_command(cmd) File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/tmp/kallithea-release-JtnfD/lib/python2.7/site-packages/setuptools/command/upload.py", line 26, in run orig.upload.run(self) File "/usr/lib64/python2.7/distutils/command/upload.py", line 62, in run self.upload_file(command, pyversion, filename) File "/tmp/kallithea-release-JtnfD/lib/python2.7/site-packages/setuptools/command/upload.py", line 136, in upload_file value = str(value).encode('utf-8') UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 825: ordinal not in range(128) The error is pointing to a unicode character in the README.rst file. The proposed 'twine' command does not have this problem. As it seems that this is the future, we won't waste more time investigating the problem with 'sdist upload', and start using twine from now on.

File last commit:

r7499:e4452268 default
r7499:e4452268 default
Show More
make-release
79 lines | 2.2 KiB | text/plain | TextLexer
Mads Kiilerich
release: add scripts/make-release for automation of the release process
r5507 #!/bin/bash
set -e
set -x
Thomas De Schampheleire
make-release: use a fresh virtualenv for building the release...
r7138 cleanup()
{
echo "Removing venv $venv"
rm -rf "$venv"
}
echo "Checking that you are NOT inside a virtualenv"
[ -z "$VIRTUAL_ENV" ]
venv=$(mktemp -d --tmpdir kallithea-release-XXXXX)
trap cleanup EXIT
echo "Setting up a fresh virtualenv in $venv"
virtualenv -p python2 "$venv"
. "$venv/bin/activate"
Thomas De Schampheleire
make-release: import version and copyright updates from default branch (dba4e770d4b6)...
r7136 echo "Install/verify tools needed for building and uploading stuff"
pip install --upgrade -e .
Thomas De Schampheleire
scripts/make-release: fix PyPI upload by using twine...
r7499 pip install --upgrade -r dev_requirements.txt twine
Thomas De Schampheleire
make-release: import version and copyright updates from default branch (dba4e770d4b6)...
r7136
echo "Cleanup and update copyrights ... and clean checkout"
Mads Kiilerich
make-release: cleanup and fix bitrot...
r7116 scripts/run-all-cleanup
Thomas De Schampheleire
make-release: import version and copyright updates from default branch (dba4e770d4b6)...
r7136 scripts/update-copyrights.py
hg up -cr .
Mads Kiilerich
release: add scripts/make-release for automation of the release process
r5507
Thomas De Schampheleire
make-release: import version and copyright updates from default branch (dba4e770d4b6)...
r7136 echo "Make release build from clean checkout in build/"
rm -rf build dist
hg archive build
cd build
Mads Kiilerich
make-release: drop partial support for shipping the generated style.css and corresponding bootstrap
r7378 echo "Check that each entry in MANIFEST.in match something"
sed -e 's/[^ ]*[ ]*\([^ ]*\).*/\1/g' MANIFEST.in | xargs ls -lad
Thomas De Schampheleire
make-release: import version and copyright updates from default branch (dba4e770d4b6)...
r7136
echo "Build dist"
python2 setup.py compile_catalog
Mads Kiilerich
release: add scripts/make-release for automation of the release process
r5507 python2 setup.py sdist
Thomas De Schampheleire
make-release: import version and copyright updates from default branch (dba4e770d4b6)...
r7136 echo "Verify VERSION from kallithea/__init__.py"
Mads Kiilerich
release: add scripts/make-release for automation of the release process
r5507 namerel=$(cd dist && echo Kallithea-*.tar.gz)
namerel=${namerel%.tar.gz}
version=${namerel#Kallithea-}
Thomas De Schampheleire
make-release: import version and copyright updates from default branch (dba4e770d4b6)...
r7136 ls -l $(pwd)/dist/$namerel.tar.gz
Mads Kiilerich
release: add scripts/make-release for automation of the release process
r5507 echo "Releasing Kallithea $version in directory $namerel"
Thomas De Schampheleire
make-release: import version and copyright updates from default branch (dba4e770d4b6)...
r7136 echo "Verify dist file content"
Mads Kiilerich
make-release: cleanup and fix bitrot...
r7116 diff -u <((hg mani | grep -v '^\.hg') | LANG=C sort) <(tar tf dist/Kallithea-$version.tar.gz | sed "s|^$namerel/||" | grep . | grep -v '^kallithea/i18n/.*/LC_MESSAGES/kallithea.mo$\|^Kallithea.egg-info/\|^PKG-INFO$\|/$' | LANG=C sort)
Thomas De Schampheleire
make-release: import version and copyright updates from default branch (dba4e770d4b6)...
r7136
echo "Verify docs build"
Thomas De Schampheleire
scripts/make-release: remove uploading of PyPI docs...
r7498 python2 setup.py build_sphinx # the results are not actually used, but we want to make sure it builds
Thomas De Schampheleire
make-release: import version and copyright updates from default branch (dba4e770d4b6)...
r7136
cat - << EOT
Mads Kiilerich
release: add scripts/make-release for automation of the release process
r5507
Thomas De Schampheleire
make-release: import version and copyright updates from default branch (dba4e770d4b6)...
r7136 Now, make sure
* all tests are passing
* release note is ready
* announcement is ready
* source has been pushed to https://kallithea-scm.org/repos/kallithea
Mads Kiilerich
release: add scripts/make-release for automation of the release process
r5507
Thomas De Schampheleire
make-release: import version and copyright updates from default branch (dba4e770d4b6)...
r7136 EOT
Mads Kiilerich
release: add scripts/make-release for automation of the release process
r5507
Thomas De Schampheleire
make-release: import version and copyright updates from default branch (dba4e770d4b6)...
r7136 echo "Verify current revision is tagged for $version"
hg log -r "'$version'&." | grep .
Mads Kiilerich
release: add scripts/make-release for automation of the release process
r5507
echo -n "Enter \"pypi\" to upload Kallithea $version to pypi: "
read answer
[ "$answer" = "pypi" ]
Thomas De Schampheleire
make-release: import version and copyright updates from default branch (dba4e770d4b6)...
r7136 echo "Rebuild readthedocs for docs.kallithea-scm.org"
Mads Kiilerich
release: add scripts/make-release for automation of the release process
r5507 xdg-open https://readthedocs.org/projects/kallithea/
curl -X POST http://readthedocs.org/build/kallithea
xdg-open https://readthedocs.org/builds/kallithea/
xdg-open http://docs.kallithea-scm.org/en/latest/ # or whatever the branch is
Thomas De Schampheleire
make-release: import version and copyright updates from default branch (dba4e770d4b6)...
r7136
Thomas De Schampheleire
scripts/make-release: fix PyPI upload by using twine...
r7499 twine upload dist/*
Thomas De Schampheleire
make-release: import version and copyright updates from default branch (dba4e770d4b6)...
r7136 xdg-open https://pypi.python.org/pypi/Kallithea