Skip to content

Commit

Permalink
Workung setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Vassyli committed Dec 22, 2015
1 parent 082d9e8 commit 5da3481
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 42 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ var/
.installed.cfg
*.egg

distmaker_windows.bat

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
Expand Down
10 changes: 8 additions & 2 deletions biofragmentor.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@
import lib
import lib.ms as ms

PATH_CONFIG = [os.path.dirname(os.path.realpath(__file__)), "data"]
def get_data_path():
if getattr(sys, "frozen", False):
return os.path.dirname(sys.executable)
else:
return os.path.dirname(os.path.realpath(__file__))

PATH_CONFIG = [get_data_path(), "data"]

APP_AUTHOR = "Basilius Sauter"
APP_NAME = "BioFragmentor"
APP_DESC = "BioFragmentor -- Biopolymer in silico fragmentation tool"
APP_VERSION = 0.1
APP_VERSION = "0.1"

APP_URL = "https://github.com/Vassyli/biofragmentor"
APP_LICENSE = "GNU General Public License Version 3"
Expand Down
73 changes: 33 additions & 40 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,45 +1,38 @@
import sys
import sys, os

from .biofragmentor import PATH_CONFIG, \
APP_AUTHOR, APP_DESC, APP_LICENSE, \
APP_NAME, APP_URL, APP_VERSION
from cx_Freeze import setup, Executable

if sys.platform == 'win32':
from disutils.core import setup
import py2exe
from biofragmentor import APP_AUTHOR, APP_DESC, \
APP_LICENSE, APP_NAME, APP_URL, APP_VERSION

# Additional files (data/*.xml), license, readme..
dataFiles = (
("", [
"LICENSE",
"README.md"]),
("data", [
"data/atoms.xml",
"data/monomers.xml"
"data/sequences.xml"]),
)
# Additional files (data/*.xml), license, readme..
includefiles = [
"LICENSE",
"README.md",
"data",
]
packages = []
excludes = ["Tkinter"]

# py2exe options
py2exe_options = {
"bundle_files" : 1,
"compressed" : True,
"optimize" : 2,
"excludes" : ["Tkconstants", "Tkinter", "tcl"],
}
# build_exe Options
build_exe_options = {
"excludes" : excludes,
"packages" : packages,
"include_files" : includefiles}

setup(
name = APP_NAME,
version = APP_VERSION,
description = APP_DESC,
author = APP_AUTHOR,
url = APP_URL,
license = APP_LICENSE,
windows = ["biofragmentor.py"],
data_files = dataFiles,
options = {"py2exe" : py2exe_options},
zipfile = None
)
elif sys.platform == 'darwin':
pass
else:
pass
base = None

setup(
name = APP_NAME,
version = APP_VERSION,
description = APP_DESC,
author = APP_AUTHOR,
url = APP_URL,
license = APP_LICENSE,
windows = ["biofragmentor.py"],
options = {
"build_exe" : build_exe_options},
executables = [
Executable("biofragmentor.py", base=None)
]
)

0 comments on commit 5da3481

Please sign in to comment.