-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MAINT: Switch to using setuptools_scm for versioning
- Loading branch information
1 parent
9c89194
commit df9acd1
Showing
7 changed files
with
19 additions
and
52 deletions.
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
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 |
---|---|---|
|
@@ -15,3 +15,4 @@ MANIFEST | |
*.ipynb_checkpoints | ||
outdir/* | ||
.idea/* | ||
bilby/_version.py |
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
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
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
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[build-system] | ||
requires = [ | ||
"setuptools>=42", | ||
"setuptools_scm[toml]>=3.4.3", | ||
"wheel", | ||
] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.setuptools_scm] | ||
write_to = "bilby/_version.py" |
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,7 +1,6 @@ | ||
#!/usr/bin/env python | ||
|
||
from setuptools import setup | ||
import subprocess | ||
import sys | ||
import os | ||
|
||
|
@@ -10,44 +9,6 @@ | |
sys.exit("Python < 3.8 is not supported, aborting setup") | ||
|
||
|
||
def write_version_file(version): | ||
"""Writes a file with version information to be used at run time | ||
Parameters | ||
---------- | ||
version: str | ||
A string containing the current version information | ||
Returns | ||
------- | ||
version_file: str | ||
A path to the version file | ||
""" | ||
try: | ||
git_log = subprocess.check_output( | ||
["git", "log", "-1", "--pretty=%h %ai"] | ||
).decode("utf-8") | ||
git_diff = ( | ||
subprocess.check_output(["git", "diff", "."]) | ||
+ subprocess.check_output(["git", "diff", "--cached", "."]) | ||
).decode("utf-8") | ||
if git_diff == "": | ||
git_status = "(CLEAN) " + git_log | ||
else: | ||
git_status = "(UNCLEAN) " + git_log | ||
except Exception as e: | ||
print("Unable to obtain git version information, exception: {}".format(e)) | ||
git_status = "release" | ||
|
||
version_file = ".version" | ||
if os.path.isfile(version_file) is False: | ||
with open("bilby/" + version_file, "w+") as f: | ||
f.write("{}: {}".format(version, git_status)) | ||
|
||
return version_file | ||
|
||
|
||
def get_long_description(): | ||
"""Finds the README and reads in the description""" | ||
here = os.path.abspath(os.path.dirname(__file__)) | ||
|
@@ -73,8 +34,6 @@ def readfile(filename): | |
return filecontents | ||
|
||
|
||
VERSION = '1.2.0' | ||
version_file = write_version_file(VERSION) | ||
long_description = get_long_description() | ||
|
||
setup( | ||
|
@@ -86,7 +45,6 @@ def readfile(filename): | |
author="Greg Ashton, Moritz Huebner, Paul Lasky, Colm Talbot", | ||
author_email="[email protected]", | ||
license="MIT", | ||
version=VERSION, | ||
packages=[ | ||
"bilby", | ||
"bilby.bilby_mcmc", | ||
|
@@ -107,7 +65,6 @@ def readfile(filename): | |
"bilby.gw": ["prior_files/*"], | ||
"bilby.gw.detector": ["noise_curves/*.txt", "detectors/*"], | ||
"bilby.gw.eos": ["eos_tables/*.dat"], | ||
"bilby": [version_file], | ||
}, | ||
python_requires=">=3.8", | ||
install_requires=get_requirements(), | ||
|