2803: Split arvados and arvados_fuse Python modules.
authorBrett Smith <brett@curoverse.com>
Fri, 9 May 2014 18:37:07 +0000 (14:37 -0400)
committerBrett Smith <brett@curoverse.com>
Fri, 9 May 2014 20:47:56 +0000 (16:47 -0400)
Prior commits tried to make separate SDK and FUSE packages from the
same sdk/python source tree.  However, this didn't work as intended
once the packages were installed.  Python modules don't work like Ruby
namespaces.  If you ask Python to import arvados.fuse, it finds the
arvados module, then looks for the fuse submodule under it.  So you
can't have arvados.fuse installed somewhere completely differently.

In addition, Python packages assume the installation script is called
setup.py.  So they wouldn't find setup_fuse.py.

We still want to have the FUSE module separate, so in discussion on
IRC we decided that the least worst option was to rename the module to
arvados_fuse.  This commit implements that.  If accepted, the new
build procedure will be:

  $ python setup.py egg_info -b \
    ".$(git log --format=format:%ct.%h -n1 .)" sdist upload

Refs #2803.

12 files changed:
sdk/python/MANIFEST.in [deleted file]
sdk/python/requirements.txt
sdk/python/setup.py
sdk/python/setup_header.py [deleted file]
services/fuse/.gitignore [new symlink]
services/fuse/arvados_fuse/__init__.py [moved from sdk/python/arvados/fuse/__init__.py with 100% similarity]
services/fuse/bin/arv-mount [moved from sdk/python/bin/arv-mount with 99% similarity]
services/fuse/readme.llfuse [moved from sdk/python/readme.llfuse with 100% similarity]
services/fuse/requirements.txt [new file with mode: 0644]
services/fuse/run_test_server.py [new symlink]
services/fuse/setup.py [moved from sdk/python/setup_fuse.py with 76% similarity]
services/fuse/test_mount.py [moved from sdk/python/test_mount.py with 99% similarity]

diff --git a/sdk/python/MANIFEST.in b/sdk/python/MANIFEST.in
deleted file mode 100644 (file)
index e03678f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-include setup_header.py
\ No newline at end of file
index a6a7591c8d11c8cdb77c5dffe9a34de55daa8355..0bea19bcd36b9de471f5b34afcae102dba48e212 100644 (file)
@@ -2,7 +2,5 @@ google-api-python-client==1.2
 httplib2==0.8
 python-gflags==2.0
 urllib3==1.7.1
-llfuse==0.40
 ws4py==0.3.4
 PyYAML==3.11
-python-daemon==1.6
index e8bcb5c42df493fe139a4732f81ef02f360ef6f2..3e756cecc74000720a2f74e585b248e457f30e99 100644 (file)
@@ -1,8 +1,7 @@
 from setuptools import setup
-import setup_header
 
 setup(name='arvados-python-client',
-      version='0.1.' + setup_header.minor_version,
+      version='0.1',
       description='Arvados client library',
       author='Arvados',
       author_email='info@arvados.org',
diff --git a/sdk/python/setup_header.py b/sdk/python/setup_header.py
deleted file mode 100644 (file)
index 21b9500..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-import shutil
-import os
-import sys
-import re
-
-if os.path.exists("PKG-INFO"):
-    with open("PKG-INFO", "r") as p:
-        for l in p:
-            g = re.match(r'Version: (.*)', l)
-            if g != None:
-                minor_version = g.group(1)
-else:
-    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)
diff --git a/services/fuse/.gitignore b/services/fuse/.gitignore
new file mode 120000 (symlink)
index 0000000..ed3b362
--- /dev/null
@@ -0,0 +1 @@
+../../sdk/python/.gitignore
\ No newline at end of file
similarity index 99%
rename from sdk/python/bin/arv-mount
rename to services/fuse/bin/arv-mount
index e7e559cb6e4b903867c88a072e443d212a83b1b1..f6b2992782ef51b9efd737bd23a4dbe98c5e86c6 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-from arvados.fuse import *
+from arvados_fuse import *
 import arvados
 import subprocess
 import argparse
diff --git a/services/fuse/requirements.txt b/services/fuse/requirements.txt
new file mode 100644 (file)
index 0000000..079ebd2
--- /dev/null
@@ -0,0 +1,3 @@
+arvados-python-client>=0.1
+llfuse==0.40
+python-daemon==1.6
diff --git a/services/fuse/run_test_server.py b/services/fuse/run_test_server.py
new file mode 120000 (symlink)
index 0000000..8d0a3b1
--- /dev/null
@@ -0,0 +1 @@
+../../sdk/python/run_test_server.py
\ No newline at end of file
similarity index 76%
rename from sdk/python/setup_fuse.py
rename to services/fuse/setup.py
index 0a05f3fe64b803b736edafaf7b0c9ce6153b8155..835c20d213cd1eceba4edac538cd6b0f32af09a7 100644 (file)
@@ -1,15 +1,16 @@
+#!/usr/bin/env python
+
 from setuptools import setup
-import setup_header
 
-setup(name='arvados-fuse-driver',
-      version='0.1.' + setup_header.minor_version,
+setup(name='arvados_fuse',
+      version='0.1',
       description='Arvados FUSE driver',
       author='Arvados',
       author_email='info@arvados.org',
       url="https://arvados.org",
       download_url="https://github.com/curoverse/arvados.git",
       license='Apache 2.0',
-      packages=['arvados.fuse'],
+      packages=['arvados_fuse'],
       scripts=[
         'bin/arv-mount'
         ],
similarity index 99%
rename from sdk/python/test_mount.py
rename to services/fuse/test_mount.py
index fd7348bb2b8b2c116f6d975c682dc6903884663c..a6440033e15256a6557de12570dc0ce595a2287e 100644 (file)
@@ -1,6 +1,6 @@
 import unittest
 import arvados
-import arvados.fuse as fuse
+import arvados_fuse as fuse
 import threading
 import time
 import os