builds.sr.ht/setup.py

59 lines
1.3 KiB
Python
Raw Permalink Normal View History

2017-04-18 15:12:56 +02:00
#!/usr/bin/env python3
from distutils.core import setup
import subprocess
import os
2019-01-30 17:17:28 +01:00
import sys
import importlib.resources
2017-04-18 15:12:56 +02:00
with importlib.resources.path('srht', 'Makefile') as f:
srht_path = f.parent.as_posix()
2019-01-30 17:17:28 +01:00
make = os.environ.get("MAKE", "make")
subp = subprocess.run([make, "SRHT_PATH=" + srht_path])
2019-01-30 17:17:28 +01:00
if subp.returncode != 0:
sys.exit(subp.returncode)
2017-04-18 15:12:56 +02:00
ver = os.environ.get("PKGVER") or subprocess.run(['git', 'describe', '--tags'],
stdout=subprocess.PIPE).stdout.decode().strip()
setup(
name = 'buildsrht',
packages = [
'buildsrht',
'buildsrht.alembic',
'buildsrht.alembic.versions',
'buildsrht.blueprints',
'buildsrht.types',
2017-04-18 15:12:56 +02:00
],
version = ver,
2018-09-10 14:28:04 +02:00
description = 'builds.sr.ht website',
2017-04-18 15:12:56 +02:00
author = 'Drew DeVault',
author_email = 'sir@cmpwn.com',
url = 'https://git.sr.ht/~sircmpwn/builds.sr.ht',
install_requires = [
'srht',
'redis',
'celery',
'pyyaml',
2017-04-18 15:12:56 +02:00
'markdown',
'bleach'
],
license = 'AGPL-3.0',
package_data={
'buildsrht': [
'templates/*.html',
'static/*',
2018-09-01 20:47:36 +02:00
'static/icons/*',
2021-05-03 20:08:21 +02:00
'schema.graphqls',
'default_query.graphql',
2017-04-18 15:12:56 +02:00
]
2018-12-31 18:19:15 +01:00
},
scripts = [
2020-03-26 13:54:11 +01:00
'buildsrht-initdb',
'buildsrht-keys',
'buildsrht-migrate',
'master-shell',
'runner-shell',
2018-12-31 18:19:15 +01:00
]
2017-04-18 15:12:56 +02:00
)