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>
This commit is contained in:
Lukas Fleischer 2016-09-20 20:18:24 +02:00
parent 1946486a67
commit dc3fd60715
10 changed files with 66 additions and 42 deletions

20
setup.py Normal file
View file

@ -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(),
)