Skip to content
Snippets Groups Projects
Commit ffd684b9 authored by Christian Fobel's avatar Christian Fobel
Browse files

Merge branch 'conda-package'

parents 7997ff42 4ee87a9d
No related merge requests found
REM Generate `setup.py` from `pavement.py` definition.
"%PYTHON%" -m paver generate_setup
REM **Workaround** `conda build` runs a copy of `setup.py` named
REM `conda-build-script.py` with the recipe directory as the only argument.
REM This causes paver to fail, since the recipe directory is not a valid paver
REM task name.
REM
REM We can work around this by wrapping the original contents of `setup.py` in
REM an `if` block to only execute during package installation.
"%PYTHON%" -c "input_ = open('setup.py', 'r'); data = input_.read(); input_.close(); output_ = open('setup.py', 'w'); output_.write('\n'.join(['import sys', 'import path_helpers as ph', '''if ph.path(sys.argv[0]).name == 'conda-build-script.py':''', ' sys.argv.pop()', 'else:', '\n'.join([(' ' + d) for d in data.splitlines()])])); output_.close(); print open('setup.py', 'r').read()"
REM Install source directory as Python package.
"%PYTHON%" -m pip install --no-cache --find-links http://192.99.4.95/wheels --trusted-host 192.99.4.95 .
if errorlevel 1 exit 1
# source will be downloaded prior to filling in jinja templates
# Example assumes that this folder has setup.py in it
source:
git_url: ../
package:
name: dstat-interface
{% if GIT_DESCRIBE_NUMBER > '0' %}
version: {{ GIT_DESCRIBE_TAG[1:] }}.post{{ GIT_DESCRIBE_NUMBER }}
{% else %}
version: {{ GIT_DESCRIBE_TAG[1:] }}
{% endif %}
build:
entry_points:
- dstat-interface = dstat_interface.main:main
# If this is a new build for the same version, increment the build
# number. If you do not include this key, it defaults to 0.
number: 0
requirements:
build:
- python
- paver
- path_helpers
- matplotlib
- pandas
- psutil
- pycairo-gtk2
- pyserial
- pyyaml
- pyzmq
- seaborn
- si-prefix
- zeo
- zmq-plugin
- zodb
run:
- matplotlib
- pandas
- psutil
- pycairo-gtk2
- pyserial
- pyyaml
- pyzmq
- seaborn
- si-prefix
- zeo
- zmq-plugin
- zodb
......@@ -65,7 +65,16 @@ except ImportError:
sys.exit(1)
from serial import SerialException
import logging
os.chdir(os.path.dirname(os.path.abspath(sys.argv[0])))
# Add package directory to Python path.
#
# This is required for relative imports, which are required for running under a
# `multiprocessing` process.
parent_dir = os.path.abspath(os.path.dirname(__file__))
if parent_dir not in sys.path:
sys.path.insert(0, parent_dir)
# Change directory into package parent directory to support loading glade UI
# files using relative paths.
os.chdir(parent_dir)
from version import getVersion
import interface.save as save
......@@ -1031,8 +1040,12 @@ class Main(object):
self.plugin = None
if __name__ == "__main__":
def main():
multiprocessing.freeze_support()
gobject.threads_init()
MAIN = Main()
gtk.main()
if __name__ == "__main__":
main()
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment