summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2016-09-20 20:18:24 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2016-09-29 22:07:06 +0200
commitdc3fd60715a5b17b9542ec888c6eaeb14c284e2b (patch)
tree18d9f17b8d582409f0db55ee32fc5efa674aaa2e /setup.py
parent1946486a67d6085318e00c753d341ab05d12904c (diff)
downloadaur-dc3fd60715a5b17b9542ec888c6eaeb14c284e2b.tar.gz
aur-dc3fd60715a5b17b9542ec888c6eaeb14c284e2b.tar.xz
Use setuptools to install Python modules
Instead of using relative imports, add support for installing the config and db Python modules to a proper location using setuptools. Change all git-interface scripts to access those modules from the search path. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/setup.py b/setup.py
new file mode 100644
index 00000000..48eb1769
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,20 @@
+import re
+from setuptools import setup, find_packages
+import sys
+
+version = None
+with open('web/lib/version.inc.php', 'r') as f:
+ for line in f.readlines():
+ match = re.match(r'^define\("AURWEB_VERSION", "v([0-9.]+)"\);$', line)
+ if match:
+ version = match.group(1)
+
+if not version:
+ sys.stderr.write('error: Failed to parse version file!')
+ sys.exit(1)
+
+setup(
+ name="aurweb",
+ version=version,
+ packages=find_packages(),
+)