A fork of https://github.com/Synerty/SOAPpy-py3 This is a working tree till fixes get imported upstream.
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.
 
 
 
 

54 lines
1.2 KiB

  1. #!/usr/bin/env bash
  2. PACKAGE="SOAPpy-py3"
  3. set -o nounset
  4. set -o errexit
  5. #set -x
  6. if [ -n "$(git status --porcelain)" ]; then
  7. echo "There are uncomitted changes, please make sure all changes are comitted" >&2
  8. exit 1
  9. fi
  10. if ! [ -f "setup.py" ]; then
  11. echo "setver.sh must be run in the directory where setup.py is" >&2
  12. exit 1
  13. fi
  14. VER="${1:?You must pass a version of the format 0.0.0 as the only argument}"
  15. if git tag | grep -q "${VER}"; then
  16. echo "Git tag for version ${VER} already exists." >&2
  17. exit 1
  18. fi
  19. echo "Setting version to $VER"
  20. # Update the setup.py
  21. sed -i "s;^package_version.*=.*;package_version = '${VER}';" setup.py
  22. ## Update the package version
  23. #sed -i "s;.*version.*;__version__ = '${VER}';" ${PACKAGE}/__init__.py
  24. # Upload to test pypi
  25. if [[ ${VER} == *"dev"* ]]; then
  26. python setup.py sdist
  27. git reset --hard
  28. else
  29. python setup.py sdist upload -r pypitest
  30. # Reset the commit, we don't want versions in the commit
  31. git commit -a -m "Updated to version ${VER}"
  32. git tag ${VER}
  33. git push
  34. git push --tags
  35. fi
  36. echo "If you're happy with this you can now run :"
  37. echo
  38. echo "python setup.py sdist upload -r pypi"
  39. echo