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.
 
 
 

63 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 -r src/*.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. sleep 1
  17. git diff
  18. # Disallow unstaged changes in the working tree
  19. if ! git diff-files --check --exit-code --ignore-submodules -- >&2
  20. then
  21. echo >&2 "error: you have unstaged changes."
  22. #git diff-files --check --exit-code --ignore-submodules -- >&2
  23. exit 1
  24. fi
  25. # Disallow uncommitted changes in the index
  26. if ! git diff-index --cached --exit-code -r --ignore-submodules HEAD -- >&2
  27. then
  28. echo >&2 "error: your index contains uncommitted changes."
  29. exit 1
  30. fi
  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
  39. git tag -f -a $VERSION -m "Version $VERSION"
  40. git tag -f -a RELEASE -m "Current RELEASE"
  41. git push origin --tags
  42. echo "done."