Skip to content

Commit

Permalink
simplify setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
markusressel committed Sep 27, 2024
1 parent 6a2024b commit 90268ff
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,13 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
import os
import subprocess

from setuptools import setup, find_packages

VERSION_NUMBER = "6.0.3"

GIT_BRANCH = subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"])
GIT_BRANCH = GIT_BRANCH.decode() # convert to standard string
GIT_BRANCH = GIT_BRANCH.rstrip() # remove unnecessary whitespace

if GIT_BRANCH == "master":
DEVELOPMENT_STATUS = "Development Status :: 5 - Production/Stable"
VERSION_NAME = VERSION_NUMBER
elif GIT_BRANCH == "beta":
DEVELOPMENT_STATUS = "Development Status :: 4 - Beta"
VERSION_NAME = "%s-beta" % VERSION_NUMBER
elif GIT_BRANCH == "dev":
DEVELOPMENT_STATUS = "Development Status :: 3 - Alpha"
VERSION_NAME = "%s-dev" % VERSION_NUMBER
elif os.environ.get("TRAVIS_BRANCH", None) == os.environ.get("TRAVIS_TAG", None) == "v{}".format(VERSION_NUMBER) or \
"GITHUB_RELEASE" in os.environ:
# travis tagged release branch
DEVELOPMENT_STATUS = "Development Status :: 5 - Production/Stable"
VERSION_NAME = VERSION_NUMBER
else:
print("Unknown git branch, using pre-alpha as default")
DEVELOPMENT_STATUS = "Development Status :: 2 - Pre-Alpha"
VERSION_NAME = "%s-%s" % (VERSION_NUMBER, GIT_BRANCH)
DEVELOPMENT_STATUS = "Development Status :: 5 - Production/Stable"
VERSION_NAME = VERSION_NUMBER


def readme_type() -> str:
Expand Down

0 comments on commit 90268ff

Please sign in to comment.