mopidy-funkwhale/setup.py

31 lines
756 B
Python
Raw Permalink Normal View History

2018-10-03 18:34:45 +02:00
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
import os
2018-10-03 18:34:45 +02:00
from setuptools import setup
2022-02-06 11:59:20 +01:00
def read(rel_path):
here = os.path.abspath(os.path.dirname(__file__))
2022-02-06 11:59:20 +01:00
with codecs.open(os.path.join(here, rel_path), "r") as fp:
return fp.read()
2022-02-06 11:59:20 +01:00
def get_version():
2022-02-06 11:59:20 +01:00
tag = os.getenv("CI_COMMIT_TAG", None)
if tag:
return tag
for line in read("mopidy_funkwhale/__init__.py").splitlines():
2022-02-06 11:59:20 +01:00
if line.startswith("__version__"):
delim = '"' if '"' in line else "'"
version = line.split(delim)[1]
2022-02-06 11:59:20 +01:00
iid = os.getenv("CI_PIPELINE_IID", 0)
return "{}.dev{}".format(version, iid)
raise RuntimeError("Unable to find version string.")
2022-02-06 11:59:20 +01:00
setup(
version=get_version(),
)