todo.sr.ht/setup.py

55 lines
1.3 KiB
Python
Raw Permalink Normal View History

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