Skip to content

Commit

Permalink
Single Pypi packaging mode
Browse files Browse the repository at this point in the history
  • Loading branch information
sapetnioc committed Feb 17, 2016
1 parent 450ddd1 commit 49b41e6
Showing 1 changed file with 9 additions and 38 deletions.
47 changes: 9 additions & 38 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,49 +15,20 @@
import argparse
import sys

# Select which package is created: core or gui
parser = argparse.ArgumentParser(add_help=False)
parser.add_argument("--gui", help="Create the gui package.",
action="store_true")
options, unknown = parser.parse_known_args()
sys.argv = [sys.argv[0]] + unknown

# Select appropriate modules
modules = find_packages()
core_modules = []
gui_modules = ["capsul"]
for module in modules:
if module.startswith("capsul.wip"):
continue
if module.startswith(("capsul.qt_apps", "capsul.qt_gui")):
gui_modules.append(module)
else:
core_modules.append(module)

# Set selcted package options
if options.gui:
import capsul
name_suffix = "gui"
modules = gui_modules
scripts = ["capsul/qt_apps/capsulview"]
pkgdata = {"capsul.qt_apps.resources": ["*.ui", "*.png", "*.qrc", "*.txt"]}
release_info = {}
execfile(os.path.join(os.path.dirname(capsul.__file__), "info.py"),
release_info)
else:
name_suffix = "core"
modules = core_modules
scripts = []
pkgdata = {
"capsul.utils.test": ["*.xml"],
"capsul.pipeline.test": ["*.json"]
}
release_info = {}
execfile(os.path.join("capsul", "info.py"), release_info)
scripts = ["capsul/qt_apps/capsulview"]
pkgdata = {
"capsul.qt_apps.resources": ["*.ui", "*.png", "*.gif", "*.qrc", "*.txt"],
"capsul.utils.test": ["*.xml"],
"capsul.pipeline.test": ["*.json"]
}
release_info = {}
execfile(os.path.join("capsul", "info.py"), release_info)

# Build the setup
setup(
name="{0}-{1}".format(release_info["NAME"], name_suffix),
name=release_info["NAME"],
description=release_info["DESCRIPTION"],
long_description=release_info["LONG_DESCRIPTION"],
license=release_info["LICENSE"],
Expand Down

0 comments on commit 49b41e6

Please sign in to comment.