Skip to content

Commit

Permalink
Merge pull request #2 from qutech-lab/master
Browse files Browse the repository at this point in the history
Push version and load it dynamically
  • Loading branch information
terrorfisch authored May 26, 2019
2 parents a8b95fa + 6066427 commit 5876f6c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
13 changes: 12 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from setuptools import setup
import re

classifiers = [
"Programming Language :: Python :: 3",
Expand All @@ -11,8 +12,18 @@
with open("README.md", "r") as fp:
tek_awg_long_description = fp.read()

with open("tek_awg.py", "r") as f:
module_contents = f.read()

def extract_version(version_file):
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='tek_awg',
version='0.1',
version=extract_version(module_contents),
author='Simon Humpohl',
author_email='[email protected]',
url='https://github.com/qutech/TekAwg/',
Expand Down
1 change: 1 addition & 0 deletions tek_awg.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
06.2018 Modified by Simon Hmupohl
"""
__version__ = "0.2"

from typing import Sequence, Union, Optional, Tuple, Iterable, cast, Callable, Any
import types
Expand Down

0 comments on commit 5876f6c

Please sign in to comment.