Merge branch 'master' into unused5

This commit is contained in:
Jörg Thalheim
2018-07-21 15:41:22 +01:00
committed by GitHub
203 changed files with 1655 additions and 627 deletions

View File

@@ -1,20 +0,0 @@
{ stdenv, buildPythonPackage, fetchPypi, isPy3k, six }:
buildPythonPackage rec {
pname = "python-dateutil";
version = "2.7.3";
disabled = isPy3k;
src = fetchPypi {
inherit pname version;
sha256 = "e27001de32f627c22380a688bcc43ce83504a7bc5da472209b4c70f02829f0b8";
};
propagatedBuildInputs = [ six ];
meta = with stdenv.lib; {
description = "Powerful extensions to the standard datetime module";
homepage = https://pypi.python.org/pypi/python-dateutil;
license = "BSD-style";
};
}

View File

@@ -21,7 +21,7 @@
}:
let
inherit (stdenv.lib) optional optionalString concatStringsSep;
inherit (stdenv.lib) optional optionalString;
inherit (stdenv) isDarwin;
in buildPythonPackage rec {
pname = "pandas";

View File

@@ -23,7 +23,7 @@
}:
let
inherit (stdenv.lib) optional optionals optionalString concatStringsSep;
inherit (stdenv.lib) optional optionals optionalString;
inherit (stdenv) isDarwin;
in buildPythonPackage rec {

View File

@@ -12,13 +12,13 @@
buildPythonPackage rec {
pname = "qasm2image";
version = "0.5.0";
version = "0.7.0";
src = fetchFromGitHub {
owner = "nelimeee";
repo = "qasm2image";
rev = "7f3c3e4d1701b8b284ef0352aa3a47722ebbbcaa";
sha256 = "129xlpwp36h2czzw1wcl8df2864zg3if2gaad1v18ah1cf68b0f3";
rev = "57a640621bbbc74244f07e2e068a26411b0d9b24";
sha256 = "1ha5vfl4jfwcwbipsq07xlknkrvx79z5bwbzndybclyk9pa69dlz";
};
propagatedBuildInputs = [

View File

@@ -19,13 +19,13 @@
buildPythonPackage rec {
pname = "qiskit";
version = "0.5.4";
version = "0.5.7";
disabled = !isPy3k;
src = fetchPypi {
inherit pname version;
sha256 = "a86014da4ea8fe057ad3b953b44e2342f2bae3e1f9ac0d5f5d51dd659c33accf";
sha256 = "a5a2c6c074f8479dc83d1d599dfebf2363402a182835b8fa5742804055148b17";
};
buildInputs = [ cmake ]
@@ -48,13 +48,9 @@ buildPythonPackage rec {
# Pypi's tarball doesn't contain tests
doCheck = false;
patches = [
./setup.py.patch
];
meta = {
description = "Quantum Software Development Kit for writing quantum computing experiments, programs, and applications";
homepage = https://github.com/QISKit/qiskit-sdk-py;
homepage = https://github.com/QISKit/qiskit-terra;
license = stdenv.lib.licenses.asl20;
maintainers = with stdenv.lib.maintainers; [
pandaman

View File

@@ -1,21 +0,0 @@
--- a/setup.py
+++ b/setup.py
@@ -18,13 +18,13 @@ from setuptools.dist import Distribution
requirements = [
"IBMQuantumExperience>=1.9.2",
- "matplotlib>=2.1,<2.2",
- "networkx>=2.0,<2.1",
- "numpy>=1.13,<1.15",
- "ply==3.10",
- "scipy>=0.19,<1.2",
- "sympy>=1.0,<1.2",
- "pillow>=4.2.1,<5.2"
+ "matplotlib>=2.1",
+ "networkx>=2.0",
+ "numpy>=1.13",
+ "ply>=3.10",
+ "scipy>=0.19",
+ "sympy>=1.0",
+ "pillow>=4.2.1"
]

View File

@@ -3,30 +3,28 @@
, nose
, scipy
, xgboost
, substituteAll
}:
buildPythonPackage rec {
pname = "xgboost";
inherit (xgboost) version src meta;
patches = [
(substituteAll {
src = ./lib-path-for-python.patch;
libpath = "${xgboost}/lib";
})
];
postPatch = "cd python-package";
propagatedBuildInputs = [ scipy ];
buildInputs = [ xgboost ];
checkInputs = [ nose ];
postPatch = let
libname = "libxgboost.${stdenv.hostPlatform.extensions.sharedLibrary}";
in ''
cd python-package
sed "s/CURRENT_DIR = os.path.dirname(__file__)/CURRENT_DIR = os.path.abspath(os.path.dirname(__file__))/g" -i setup.py
sed "/^LIB_PATH.*/a LIB_PATH = [os.path.relpath(LIB_PATH[0], CURRENT_DIR)]" -i setup.py
cat <<EOF >xgboost/libpath.py
def find_lib_path():
return ["${xgboost}/lib/${libname}"]
EOF
'';
postInstall = ''
rm -rf $out/xgboost
checkPhase = ''
ln -sf ../demo .
nosetests ../tests/python
'';
}

View File

@@ -0,0 +1,59 @@
diff --git a/python-package/setup.py b/python-package/setup.py
index e6c3386f..4ed0a8bd 100644
--- a/python-package/setup.py
+++ b/python-package/setup.py
@@ -16,8 +16,6 @@ libpath_py = os.path.join(CURRENT_DIR, 'xgboost/libpath.py')
libpath = {'__file__': libpath_py}
exec(compile(open(libpath_py, "rb").read(), libpath_py, 'exec'), libpath, libpath)
-LIB_PATH = [os.path.relpath(libfile, CURRENT_DIR) for libfile in libpath['find_lib_path']()]
-print("Install libxgboost from: %s" % LIB_PATH)
# Please use setup_pip.py for generating and deploying pip installation
# detailed instruction in setup_pip.py
setup(name='xgboost',
@@ -35,7 +33,6 @@ setup(name='xgboost',
# this will use MANIFEST.in during install where we specify additional files,
# this is the golden line
include_package_data=True,
- data_files=[('xgboost', LIB_PATH)],
license='Apache-2.0',
classifiers=['License :: OSI Approved :: Apache Software License'],
url='https://github.com/dmlc/xgboost')
diff --git a/python-package/xgboost/libpath.py b/python-package/xgboost/libpath.py
index d87922c0..859a30fb 100644
--- a/python-package/xgboost/libpath.py
+++ b/python-package/xgboost/libpath.py
@@ -19,32 +19,4 @@ def find_lib_path():
lib_path: list(string)
List of all found library path to xgboost
"""
- curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
- # make pythonpack hack: copy this directory one level upper for setup.py
- dll_path = [curr_path, os.path.join(curr_path, '../../lib/'),
- os.path.join(curr_path, './lib/'),
- os.path.join(sys.prefix, 'xgboost')]
- if sys.platform == 'win32':
- if platform.architecture()[0] == '64bit':
- dll_path.append(os.path.join(curr_path, '../../windows/x64/Release/'))
- # hack for pip installation when copy all parent source directory here
- dll_path.append(os.path.join(curr_path, './windows/x64/Release/'))
- else:
- dll_path.append(os.path.join(curr_path, '../../windows/Release/'))
- # hack for pip installation when copy all parent source directory here
- dll_path.append(os.path.join(curr_path, './windows/Release/'))
- dll_path = [os.path.join(p, 'xgboost.dll') for p in dll_path]
- elif sys.platform.startswith('linux') or sys.platform.startswith('freebsd'):
- dll_path = [os.path.join(p, 'libxgboost.so') for p in dll_path]
- elif sys.platform == 'darwin':
- dll_path = [os.path.join(p, 'libxgboost.dylib') for p in dll_path]
-
- lib_path = [p for p in dll_path if os.path.exists(p) and os.path.isfile(p)]
-
- # From github issues, most of installation errors come from machines w/o compilers
- if not lib_path and not os.environ.get('XGBOOST_BUILD_DOC', False):
- raise XGBoostLibraryNotFound(
- 'Cannot find XGBoost Library in the candidate path, ' +
- 'did you install compilers and run build.sh in root path?\n'
- 'List of candidates:\n' + ('\n'.join(dll_path)))
- return lib_path
+ return ["@libpath@/libxgboost.so"]