Commit cfe668f4 authored by Kipp Cannon's avatar Kipp Cannon

put the version into the .spec automatically

parent b8d98df0
......@@ -6,6 +6,7 @@ __pycache__
MANIFEST
build
dist
ligo-segments.spec
glue/git_version.py
src/conf/s6_db2/*.sql
/docs/_build
......@@ -2,6 +2,7 @@ include LICENSE MANIFEST.in
include src/*.c
include src/*.h
include ligo-segments.spec
include ligo-segments.spec.in
include debian/*
include debian/source/*
include test/*
%global srcname ligo-segments
Name: %{srcname}
Version: 1.0.0
Version: @VERSION@
Release: 1%{?dist}
Summary: Representations of semi-open intervals
......
......@@ -28,6 +28,11 @@ def find_version(path):
raise RuntimeError("'%s': unable to find __version__ string" % path)
return version_match.group(1)
version = find_version(os.path.join('ligo', 'segments.py'))
# transform ligo-segments.spec.in to ligo-segments.spec
open("ligo-segments.spec", "w").writelines([line.replace("@VERSION@", version) for line in open("ligo-segments.spec.in")])
# declare dependencies
setup_requires = ['setuptools']
cmdclass = {}
......@@ -47,7 +52,7 @@ if {'build_sphinx'}.intersection(sys.argv):
# run setup
setup(
name = 'ligo-segments',
version = find_version(os.path.join('ligo', 'segments.py')),
version = version,
description = 'Representations of semi-open intervals',
author = 'Kipp Cannon',
author_email = 'kipp.cannon@ligo.org',
......
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