Eli Schwartz 23e980fc74 use importlib.resources from python 3.7 to find Makefile
importlib.resources will guarantee to find any importable module, and
check that the resource ('Makefile') can be found within it.

This lets us get rid of the current getsitepackages() hack and
environment variable fallback, which is both verbose and badly handles
some edge cases when installing modules, and instead use the recommended
way to find data files shipped with a python module.
2020-05-11 09:36:29 -04:00

47 lines
1.1 KiB
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 =[make, "SRHT_PATH=" + srht_path])
if subp.returncode != 0:
ver = os.environ.get("PKGVER") or['git', 'describe', '--tags'],
name = 'hubsrht',
packages = [
version = ver,
description = ' website',
author = 'Drew DeVault',
author_email = '',
url = '',
install_requires = ['srht'],
license = 'AGPL-3.0',
'hubsrht': [
scripts = [