Commit 9a15b557 authored by Luke Campagnola's avatar Luke Campagnola
Browse files

Correct setup to use new setuptools if it is available

parent 305dc746
......@@ -34,14 +34,18 @@ setupOpts = dict(
from distutils.core import setup
import distutils.dir_util
import os, sys, re
# just avoids warning about install_requires
import setuptools
from setuptools import setup
from setuptools.command import build
from setuptools.command import install
except ImportError:
from distutils.core import setup
from distutils.command import build
from distutils.command import install
path = os.path.split(__file__)[0]
sys.path.insert(0, os.path.join(path, 'tools'))
......@@ -55,9 +59,8 @@ allPackages = (helpers.listAllPackages(pkgroot='pyqtgraph') +
version, forcedVersion, gitVersion, initVersion = helpers.getVersionStrings(pkg='pyqtgraph')
class Build(
class Build(
* Clear build path before building
* Set version string in __init__ after building
......@@ -71,7 +74,7 @@ class Build(
if os.path.isdir(buildPath):
ret =
ret =
# If the version in __init__ is different from the automatically-generated
# version string, then we will update __init__ in the build directory
......@@ -94,9 +97,8 @@ class Build(
return ret
import distutils.command.install
class Install(distutils.command.install.install):
class Install(install.install):
* Check for previously-installed version before installing
......@@ -108,7 +110,8 @@ class Install(distutils.command.install.install):
"installed at %s; remove this before installing."
% (name, path))
print("Installing to %s" % path)
Markdown is supported
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