From ded1c14e192d691982168b1982ba5ee26df4d80b Mon Sep 17 00:00:00 2001 From: Insoleet <insomniak.fr@gmail.com> Date: Tue, 17 Nov 2015 11:07:55 +0100 Subject: [PATCH] Fix build on windows --- setup.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/setup.py b/setup.py index 40564ca2..a612a543 100644 --- a/setup.py +++ b/setup.py @@ -26,13 +26,6 @@ packages = ["libnacl", "encodings", "jsonschema"] includefiles = [] zipincludes = [] -schemas = os.path.join(site.getsitepackages()[0], "jsonschema", "schemas") - -onlyfiles = [ f for f in listdir(schemas) if isfile(join(schemas,f)) ] - -for f in onlyfiles: - zipincludes.append((os.path.join(schemas, f), os.path.join("jsonschema", "schemas", f))) - if sys.platform == "win32": app = QtCore.QCoreApplication(sys.argv) libEGL_path = "" @@ -43,7 +36,13 @@ if sys.platform == "win32": libEGL_path = os.path.join(os.path.dirname(path), "libEGL.dll") if 'CONDA_DEFAULT_ENV' in os.environ: - # Check if we are in Conda env + # Check if we are in Conda env + schemas = os.path.join(site.getsitepackages()[1], "jsonschema", "schemas") + + onlyfiles = [ f for f in listdir(schemas) if isfile(join(schemas,f)) ] + for f in onlyfiles: + zipincludes.append((os.path.join(schemas, f), os.path.join("jsonschema", "schemas", f))) + path = QtCore.QCoreApplication.libraryPaths()[0] libEGL_path = os.path.join(path, "Scripts", "libEGL.dll") libsodium_path = os.path.join(path, "Scripts", "libsodium.dll") @@ -64,18 +63,26 @@ elif sys.platform == "darwin": else: libsodium_path = "" print(QtCore.QCoreApplication.libraryPaths()) + schemas = os.path.join(site.getsitepackages()[0], "jsonschema", "schemas") + for f in onlyfiles: + zipincludes.append((os.path.join(schemas, f), os.path.join("jsonschema", "schemas", f))) + + onlyfiles = [ f for f in listdir(schemas) if isfile(join(schemas,f)) ] # Check if we are in Conda env if 'CONDA_ENV_PATH' in os.environ: libsodium_path = os.path.join(os.environ['CONDA_ENV_PATH'], "lib", "libsodium.so.13") includefiles.append((libsodium_path, "libsodium.so.13")) + print("Includes : ") print(includes) print("Excludes : ") print(exclude) print("Include files : ") print(includefiles) +print("Zip files : ") +print(zipincludes) print("Packages : ") print(packages) print(sys.path) -- GitLab