diff --git a/Makefile b/Makefile index 924effc..05d1399 100644 --- a/Makefile +++ b/Makefile @@ -116,19 +116,18 @@ dist: clean ## builds wheel package install: dist @echo "Running ${PIP} (${PYTHON_VERSION}) ..." - @${PIP} install --upgrade --global-option=build \ - --global-option='--executable=/usr/bin/env python' . + ${PIP} install . --upgrade + #@${PIP} install --upgrade --global-option=build \ + #--global-option='--executable=/usr/bin/env python' . siteinstall: dist ## Install in project/res (Trondheim) using $TARGET @echo $(HOST) - PYTHONUSERBASE=${TARGET} ${PIP} install . --user --upgrade \ - --global-option=build --global-option='--executable=/usr/bin/env python' + PYTHONUSERBASE=${TARGET} ${PIP} install . --user --upgrade userinstall: dist @echo $(HOST) - PYTHONUSERBASE=${HOME} ${PIP} install . --user --upgrade --global-option=build \ - --global-option='--executable=/usr/bin/env python' + PYTHONUSERBASE=${HOME} ${PIP} install . --user --upgrade docsinstall: docsrun diff --git a/setup.py b/setup.py index e173e01..ad297ba 100644 --- a/setup.py +++ b/setup.py @@ -2,18 +2,17 @@ # -*- coding: utf-8 -*- """The setup script.""" +import fileinput import os +import sys +import sysconfig from glob import glob from os.path import basename from os.path import splitext from setuptools import setup, find_packages -with open("README.rst") as readme_file: - readme = readme_file.read() - -with open("HISTORY.rst") as history_file: - history = history_file.read() +APPS = ("grid3d_hc_thickness", "grid3d_average_map") def parse_requirements(filename): @@ -30,6 +29,26 @@ def src(x): return os.path.abspath(os.path.join(root, x)) +def _post_install(): + """Replace the shebang line of console script fra spesific to a general""" + print("POST INSTALL") + spath = sysconfig.get_paths()["scripts"] + xapps = [] + for app in APPS: + xapps.append(os.path.join(spath, app)) + print(xapps) + for line in fileinput.input(xapps, inplace=1): + line = line.replace(spath + "/python", "/usr/bin/env python") + sys.stdout.write(line) + + +with open("README.rst") as readme_file: + readme = readme_file.read() + +with open("HISTORY.rst") as history_file: + history = history_file.read() + + requirements = parse_requirements("requirements.txt") setup_requirements = ["pytest-runner", "wheel", "setuptools_scm>=3.2.0"]