Gitlab will migrate to a new storage backend starting 0300 UTC on 2020-04-04. We do not anticipate a maintenance window for this migration. Performance may be impacted over the weekend. Thanks for your patience.

Commit ab32741c authored by Duncan Macleod's avatar Duncan Macleod

setup.py: parse version from version.py don't import

its simpler to parse the version number from `ligo.gracedb.version`, rather than importing, so that `six` isn't required on the build machine _before_ building. importing in setup.py has also been seen to confuse some coverage parsers, and other profiling tools.
parent 707901c7
......@@ -16,12 +16,27 @@
# You should have received a copy of the GNU General Public License
# along with gracedb. If not, see <http://www.gnu.org/licenses/>.
import os
import re
from setuptools import setup, find_packages
from ligo.gracedb import __version__
def parse_version(path):
"""Extract the `__version__` string from the given file
"""
with open(path, 'r') as fp:
version_file = fp.read()
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")
setup(
name = "ligo-gracedb",
version = __version__,
version = parse_version(os.path.join('ligo', 'gracedb', 'version.py')),
maintainer = "Tanner Prestegard, Alexander Pace",
maintainer_email = "tanner.prestegard@ligo.org, alexander.pace@ligo.org",
description = "Gravitational Wave Candidate Event Database",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment