forked from dahlend/TekAwg
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from qutech-lab/master
Push version and load it dynamically
- Loading branch information
Showing
2 changed files
with
13 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
|
@@ -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/', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters