--- /dev/null
+#!/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
+
from setuptools import setup
import subprocess
-minor_version = subprocess.check_output(
- ['git', 'log', '--format=format:%ct.%h', '-n1', '.'])
+minor_version = '%%MINOR_VERSION%%'
setup(name='arvados-python-client',
version='0.1.' + minor_version,
description='Arvados client library',
author='Arvados',
author_email='info@arvados.org',
- url="https://github.com/curoverse/arvados.git",
+ url="https://arvados.org",
+ download_url="https://github.com/curoverse/arvados.git",
license='Apache 2.0',
packages=['arvados'],
scripts=[