Skip to content
Snippets Groups Projects
Commit 3f727258 authored by Johannes Schumann's avatar Johannes Schumann
Browse files

Integrated the image build to the python module

parent 1f4a1136
Branches
Tags
1 merge request!1Merge python environment
from .__version__ import version
from os.path import isfile, abspath, join, dirname
image_path = abspath(join(dirname(__file__), "..", "GiBUU.simg"))
if not isfile(image_path):
raise EnvironmentError(
"GiBUU image was not found at %s; please run `make build` or `make buildremote`"
% image_path)
......@@ -7,6 +7,9 @@ KM3BUU setup script.
"""
from setuptools import setup, find_packages
from setuptools.command.install import install
from setuptools.command.develop import develop
from setuptools.command.egg_info import egg_info
PACKAGE_NAME = 'km3buu'
URL = 'https://git.km3net.de/simulation/km3buu'
......@@ -14,9 +17,34 @@ DESCRIPTION = 'GiBUU tools for KM3NeT'
__author__ = 'Johannes Schumann'
__email__ = 'jschumann@km3net.de'
import os
with open('requirements.txt') as fobj:
REQUIREMENTS = [l.strip() for l in fobj.readlines()]
def _build_image():
os.system('make buildremote')
class CustomInstallCmd(install):
def run(self):
install.run(self)
_build_image()
class CustomDevelopCmd(develop):
def run(self):
develop.run(self)
_build_image()
class CustomEggInfoCmd(egg_info):
def run(self):
egg_info.run(self)
_build_image()
setup(
name=PACKAGE_NAME,
url=URL,
......@@ -26,6 +54,9 @@ setup(
packages=find_packages(),
include_package_data=True,
platforms='any',
cmdclass={'install': CustomInstallCmd,
'develop': CustomDevelopCmd,
'egg_info': CustomEggInfoCmd},
setup_requires=['setuptools_scm'],
use_scm_version={
'write_to': '{}/version.txt'.format(PACKAGE_NAME),
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment