[ARVADOS] updated: d9aa5decc6edce30285df049277de2cf2c138c26
git at public.curoverse.com
git at public.curoverse.com
Wed May 7 11:40:01 EDT 2014
Summary of changes:
sdk/python/.gitignore | 1 -
sdk/python/build.sh | 16 ----------------
sdk/python/run_test_server.py | 4 ++--
sdk/python/{setup.py.src => setup.py} | 10 ++--------
sdk/python/setup.py.src | 9 ---------
sdk/python/{setup_fuse.py.src => setup_fuse.py} | 11 ++---------
sdk/python/setup_header.py | 11 +++++++++++
7 files changed, 17 insertions(+), 45 deletions(-)
delete mode 100755 sdk/python/build.sh
copy sdk/python/{setup.py.src => setup.py} (71%)
rename sdk/python/{setup_fuse.py.src => setup_fuse.py} (65%)
create mode 100644 sdk/python/setup_header.py
via d9aa5decc6edce30285df049277de2cf2c138c26 (commit)
via 5b252752cdfd8b129d10913f7e2ec7b47f544ead (commit)
from 31c711afc4ff8a1728aeb3e5f405a131047671c9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit d9aa5decc6edce30285df049277de2cf2c138c26
Merge: 31c711a 5b25275
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Wed May 7 11:39:55 2014 -0400
Merge branch '2035-arv-mount-tags-folders' into origin-2035-arv-mount-tags-folders
commit 5b252752cdfd8b129d10913f7e2ec7b47f544ead
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Wed May 7 10:32:54 2014 -0400
Eliminated build.sh and sed in favor of a common setup_header.py script which
call popen to get the git revision directly. Removed spurious server_pid > 0
and added except Execption: on run_test_server.py.
diff --git a/sdk/python/.gitignore b/sdk/python/.gitignore
index 6d57899..7f9c17b 100644
--- a/sdk/python/.gitignore
+++ b/sdk/python/.gitignore
@@ -2,4 +2,3 @@
/dist/
/*.egg-info
/tmp
-setup.py
diff --git a/sdk/python/build.sh b/sdk/python/build.sh
deleted file mode 100755
index ac8ec47..0000000
--- a/sdk/python/build.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-#
-# Apparently the only reliable way to distribute Python packages with pypi and
-# install them via pip is as source packages (sdist).
-#
-# That means that setup.py is run on the system the package is being installed on,
-# outside of the Arvados git tree.
-#
-# In turn, this means that we can not build the minor_version on the fly when
-# setup.py is being executed. Instead, we use this script to generate a 'static'
-# version of setup.py which will can be distributed via pypi.
-
-minor_version=`git log --format=format:%ct.%h -n1 .`
-
-sed "s|%%MINOR_VERSION%%|$minor_version|" < setup.py.src > setup.py
-sed "s|%%MINOR_VERSION%%|$minor_version|" < setup_fuse.py.src > setup_fuse.py
diff --git a/sdk/python/run_test_server.py b/sdk/python/run_test_server.py
index 511f2e6..b4886f0 100644
--- a/sdk/python/run_test_server.py
+++ b/sdk/python/run_test_server.py
@@ -19,8 +19,8 @@ def find_server_pid(PID_PATH):
try:
with open(PID_PATH, 'r') as f:
server_pid = int(f.read())
- good_pid = (server_pid > 0) and (os.kill(server_pid, 0) == None)
- except:
+ good_pid = (os.kill(server_pid, 0) == None)
+ except Exception:
good_pid = False
if not good_pid:
diff --git a/sdk/python/setup.py.src b/sdk/python/setup.py
similarity index 71%
copy from sdk/python/setup.py.src
copy to sdk/python/setup.py
index 807327c..e8bcb5c 100644
--- a/sdk/python/setup.py.src
+++ b/sdk/python/setup.py
@@ -1,14 +1,8 @@
from setuptools import setup
-import shutil
-
-minor_version = '%%MINOR_VERSION%%'
-
-# setup.py and setup_fuse.py both share the build/ directory (argh!) so
-# make sure to delete it to avoid scooping up the wrong files.
-shutil.rmtree('build')
+import setup_header
setup(name='arvados-python-client',
- version='0.1.' + minor_version,
+ version='0.1.' + setup_header.minor_version,
description='Arvados client library',
author='Arvados',
author_email='info at arvados.org',
diff --git a/sdk/python/setup.py.src b/sdk/python/setup.py.src
index 807327c..fbb8c52 100644
--- a/sdk/python/setup.py.src
+++ b/sdk/python/setup.py.src
@@ -1,12 +1,3 @@
-from setuptools import setup
-import shutil
-
-minor_version = '%%MINOR_VERSION%%'
-
-# setup.py and setup_fuse.py both share the build/ directory (argh!) so
-# make sure to delete it to avoid scooping up the wrong files.
-shutil.rmtree('build')
-
setup(name='arvados-python-client',
version='0.1.' + minor_version,
description='Arvados client library',
diff --git a/sdk/python/setup_fuse.py.src b/sdk/python/setup_fuse.py
similarity index 64%
rename from sdk/python/setup_fuse.py.src
rename to sdk/python/setup_fuse.py
index 9e191fb..4c759c1 100644
--- a/sdk/python/setup_fuse.py.src
+++ b/sdk/python/setup_fuse.py
@@ -1,15 +1,8 @@
from setuptools import setup
-import distutils
-import shutil
-
-minor_version = '%%MINOR_VERSION%%'
-
-# setup.py and setup_fuse.py both share the build/ directory (argh!) so
-# make sure to delete it to avoid scooping up the wrong files.
-shutil.rmtree('build')
+import setup_header
setup(name='arvados-fuse-driver',
- version='0.1.' + minor_version,
+ version='0.1.' + setup_header.minor_version,
description='Arvados FUSE driver',
author='Arvados',
author_email='info at arvados.org',
diff --git a/sdk/python/setup_header.py b/sdk/python/setup_header.py
new file mode 100644
index 0000000..c97f94d
--- /dev/null
+++ b/sdk/python/setup_header.py
@@ -0,0 +1,11 @@
+import shutil
+import os
+import sys
+
+with os.popen("git log --format=format:%ct.%h -n1 .") as m:
+ minor_version=m.read()
+
+# setup.py and setup_fuse.py both share the build/ directory (argh!) so
+# make sure to delete it to avoid scooping up the wrong files.
+build_dir = os.path.join(os.path.dirname(sys.argv[0]), 'build')
+shutil.rmtree(build_dir, ignore_errors=True)
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list