From 19d7bc56054a3c29c1a18f281e41e83896721ab8 Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Thu, 27 Dec 2012 04:35:23 +0000 Subject: [PATCH] bugfixes for new package structure --- examples/initExample.py | 6 +++--- setup.py | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/examples/initExample.py b/examples/initExample.py index f95a0cb0..38dd3edc 100644 --- a/examples/initExample.py +++ b/examples/initExample.py @@ -2,10 +2,10 @@ import sys, os path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) path.rstrip(os.path.sep) -if path.endswith('pyqtgraph'): - sys.path.insert(0, os.path.join(path, '..')) ## examples installed inside pyqtgraph package -elif 'pyqtgraph' in os.listdir(path): +if 'pyqtgraph' in os.listdir(path): sys.path.insert(0, path) ## examples adjacent to pyqtgraph (as in source) +elif path.endswith('pyqtgraph'): + sys.path.insert(0, os.path.abspath(os.path.join(path, '..'))) ## examples installed inside pyqtgraph package ## should force example to use PySide instead of PyQt if 'pyside' in sys.argv: diff --git a/setup.py b/setup.py index e4dc07cf..64d22ba2 100644 --- a/setup.py +++ b/setup.py @@ -1,11 +1,19 @@ from distutils.core import setup +import distutils.dir_util import os ## generate list of all sub-packages -subdirs = [i[0].split(os.path.sep)[1:] for i in os.walk('./pyqtgraph') if '__init__.py' in i[2]] -subdirs = filter(lambda p: len(p) == 1 or p[1] != 'build', subdirs) +path = os.path.abspath(os.path.dirname(__file__)) +n = len(path.split(os.path.sep)) +subdirs = [i[0].split(os.path.sep)[n:] for i in os.walk(os.path.join(path, 'pyqtgraph')) if '__init__.py' in i[2]] all_packages = ['.'.join(p) for p in subdirs] + ['pyqtgraph.examples'] + +## Make sure build directory is clean before installing +buildPath = os.path.join(path, 'build') +if os.path.isdir(buildPath): + distutils.dir_util.remove_tree(buildPath) + setup(name='pyqtgraph', version='', description='Scientific Graphics and GUI Library for Python', @@ -23,6 +31,9 @@ It is intended for use in mathematics / scientific / engineering applications. D #package_data={'pyqtgraph': ['graphicsItems/PlotItem/*.png']}, classifiers = [ "Programming Language :: Python", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.6", + "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Development Status :: 4 - Beta", "Environment :: Other Environment",