paste.sr.ht/setup.py

50 lines
1.2 KiB
Python
Executable File

#!/usr/bin/env python3
from distutils.core import setup
import subprocess
import os
import sys
import importlib.resources
with importlib.resources.path('srht', 'Makefile') as f:
srht_path = f.parent.as_posix()
make = os.environ.get("MAKE", "make")
subp = subprocess.run([make, "SRHT_PATH=" + srht_path])
if subp.returncode != 0:
sys.exit(subp.returncode)
ver = os.environ.get("PKGVER") or subprocess.run(['git', 'describe', '--tags'],
stdout=subprocess.PIPE).stdout.decode().strip()
setup(
name = 'pastesrht',
packages = [
'pastesrht',
'pastesrht.types',
'pastesrht.blueprints',
'pastesrht.blueprints.api',
'pastesrht.alembic',
'pastesrht.alembic.versions',
],
version = ver,
description = 'paste.sr.ht website',
author = 'Drew DeVault',
author_email = 'sir@cmpwn.com',
url = 'https://git.sr.ht/~sircmpwn/paste.sr.ht',
install_requires = ['srht', 'PyYAML'],
license = 'AGPL-3.0',
package_data={
'pastesrht': [
'templates/*.html',
'static/icons/*',
'static/*',
'schema.graphqls',
'default_query.graphql',
]
},
scripts = [
'pastesrht-initdb',
'pastesrht-migrate',
],
)