Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
KM3BUU
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
simulation
KM3BUU
Commits
3f727258
Commit
3f727258
authored
5 years ago
by
Johannes Schumann
Browse files
Options
Downloads
Patches
Plain Diff
Integrated the image build to the python module
parent
1f4a1136
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1
Merge python environment
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
km3buu/__init__.py
+8
-0
8 additions, 0 deletions
km3buu/__init__.py
setup.py
+31
-0
31 additions, 0 deletions
setup.py
with
39 additions
and
0 deletions
km3buu/__init__.py
+
8
−
0
View file @
3f727258
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
)
This diff is collapsed.
Click to expand it.
setup.py
+
31
−
0
View file @
3f727258
...
...
@@ -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
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment