Skip to content

Commit

Permalink
Minor fixes in Makefile and setup
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrivenaes committed Aug 5, 2019
1 parent 2c08d3f commit df3b61b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 11 deletions.
11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 24 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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"]
Expand Down

0 comments on commit df3b61b

Please sign in to comment.