You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

56 lines
1.5 KiB

  1. #!/bin/bash
  2. set -e
  3. VERSION=$(python -c "from src.wstools.version import __version__ ; print __version__")
  4. echo Preparing to release version $VERSION
  5. pip install -q --upgrade pep8 autopep8
  6. #pip install -q --upgrade autopep8
  7. if ! python setup.py test; then
  8. echo "The test suite failed. Fix it!"
  9. exit 1
  10. fi
  11. git pull -u
  12. python setup.py check --restructuredtext --strict
  13. autopep8 -i *.py
  14. # commented some errors temporarly, TODO: remove them and fix the code
  15. pep8 --max-line-length=180 --ignore=E502,E128,E123,E127,E125 src
  16. # Disallow unstaged changes in the working tree
  17. if ! git diff-files --quiet --ignore-submodules --
  18. then
  19. echo >&2 "cannot $1: you have unstaged changes."
  20. git diff-files --name-status -r --ignore-submodules -- >&2
  21. exit 1
  22. fi
  23. # Disallow uncommitted changes in the index
  24. if ! git diff-index --cached --quiet HEAD --ignore-submodules --
  25. then
  26. echo >&2 "cannot $1: your index contains uncommitted changes."
  27. git diff-index --cached --name-status -r --ignore-submodules HEAD -- >&2
  28. exit 1
  29. fi
  30. git tag -a $VERSION -m "Version $VERSION"
  31. echo "Please don't run this as a user. This generates a new release for PyPI. Press ^C to exit or Enter to continue."
  32. read
  33. # Clear old distutils stuff
  34. rm -rf build dist MANIFEST &> /dev/null
  35. # Build installers, etc. and upload to PyPI
  36. # python setup.py register sdist bdist_wininst upload
  37. #python setup.py register sdist build_sphinx upload upload_sphinx
  38. python setup.py register sdist upload