Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bilby
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lscsoft
bilby
Merge requests
!117
Clean up of setup
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Clean up of setup
clean-up-of-setup
into
master
Overview
0
Commits
2
Pipelines
1
Changes
1
Merged
Gregory Ashton
requested to merge
clean-up-of-setup
into
master
6 years ago
Overview
0
Commits
2
Pipelines
1
Changes
1
Expand
Closes
#146 (closed)
and general clean up of setup.py
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
9fa01c95
2 commits,
6 years ago
1 file
+
51
−
28
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
setup.py
+
51
−
28
Options
@@ -4,31 +4,55 @@ from setuptools import setup
import
subprocess
from
os
import
path
version
=
'
0.2.1
'
# Write a version file containing the git hash and info
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
==
''
:
status
=
'
(CLEAN)
'
+
git_log
else
:
status
=
'
(UNCLEAN)
'
+
git_log
except
subprocess
.
CalledProcessError
:
status
=
''
version_file
=
'
.version
'
if
path
.
isfile
(
version_file
)
is
False
:
with
open
(
'
tupak/
'
+
version_file
,
'
w+
'
)
as
f
:
f
.
write
(
'
{} - {}
'
.
format
(
version
,
status
))
here
=
path
.
abspath
(
path
.
dirname
(
__file__
))
with
open
(
path
.
join
(
here
,
'
README.rst
'
))
as
f
:
long_description
=
f
.
read
()
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
=
''
version_file
=
'
.version
'
if
path
.
isfile
(
version_file
)
is
False
:
with
open
(
'
tupak/
'
+
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
=
path
.
abspath
(
path
.
dirname
(
__file__
))
with
open
(
path
.
join
(
here
,
'
README.rst
'
))
as
f
:
long_description
=
f
.
read
()
return
long_description
version
=
'
0.2.1
'
version_file
=
write_version_file
(
version
)
long_description
=
get_long_description
()
setup
(
name
=
'
tupak
'
,
description
=
'
The User friendly Parameter estimAtion Kode
'
,
@@ -40,7 +64,8 @@ setup(name='tupak',
version
=
version
,
packages
=
[
'
tupak
'
,
'
tupak.core
'
,
'
tupak.gw
'
,
'
tupak.hyper
'
,
'
cli_tupak
'
],
package_dir
=
{
'
tupak
'
:
'
tupak
'
},
package_data
=
{
'
tupak.gw
'
:
[
'
prior_files/*
'
,
'
noise_curves/*.txt
'
,
'
detectors/*
'
],
package_data
=
{
'
tupak.gw
'
:
[
'
prior_files/*
'
,
'
noise_curves/*.txt
'
,
'
detectors/*
'
],
'
tupak
'
:
[
version_file
]},
install_requires
=
[
'
future
'
,
@@ -50,9 +75,7 @@ setup(name='tupak',
'
matplotlib>=2.0
'
,
'
deepdish
'
,
'
pandas
'
,
'
scipy
'
,
],
'
scipy
'
],
entry_points
=
{
'
console_scripts
'
:
[
'
tupak_plot=cli_tupak.plot_multiple_posteriors:main
'
]
})
Loading