~sircmpwn/dispatch.sr.ht

dispatch.sr.ht/setup.py -rwxr-xr-x 1.3 KiB View raw
562cf2dcEli Schwartz setup.py: use importlib.resources from python 3.7 to find core.sr.ht Makefile 28 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/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 = 'dispatchsrht',
  packages = [
      'dispatchsrht',
      'dispatchsrht.alembic',
      'dispatchsrht.alembic.versions',
      'dispatchsrht.blueprints',
      'dispatchsrht.tasks',
      'dispatchsrht.tasks.github',
      'dispatchsrht.tasks.gitlab',
      'dispatchsrht.types',
  ],
  version = ver,
  description = 'dispatch.sr.ht website',
  author = 'Drew DeVault',
  author_email = 'sir@cmpwn.com',
  url = 'https://dispatch.sr.ht/~sircmpwn/dispatch.sr.ht',
  license = 'AGPL-3.0',
  package_data={
      'dispatchsrht': [
          'templates/*.html',
          'templates/github/*.html',
          'templates/gitlab/*.html',
          'static/*',
          'static/icons/*',
      ]
  },
  scripts = [
      'dispatchsrht-initdb',
      'dispatchsrht-migrate',
  ],
)