Merge pull request #56312 from costrouc/python-unstable
Fixes several broken python packages for python-unstable
This commit is contained in:
commit
0dbfd0e7f9
@ -1,4 +1,4 @@
|
|||||||
{ stdenv
|
{ lib
|
||||||
, buildPythonPackage
|
, buildPythonPackage
|
||||||
, fetchPypi
|
, fetchPypi
|
||||||
, pythonOlder
|
, pythonOlder
|
||||||
@ -15,24 +15,28 @@
|
|||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "gidgethub";
|
pname = "gidgethub";
|
||||||
version = "3.0.0";
|
version = "3.1.0";
|
||||||
format = "flit";
|
|
||||||
|
|
||||||
disabled = pythonOlder "3.6";
|
disabled = pythonOlder "3.6";
|
||||||
|
|
||||||
src = fetchPypi {
|
src = fetchPypi {
|
||||||
inherit pname version;
|
inherit pname version;
|
||||||
sha256 = "1ebe79cf80ad64cb78c880efc7f30ac664e18b80dfd18ee201bf8685cf029628";
|
sha256 = "52119435ba73ddd5e697dae7bec8b93a048bc738720b81691ebd4b4d81d2d762";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ setuptools pytestrunner ];
|
nativeBuildInputs = [ setuptools pytestrunner ];
|
||||||
checkInputs = [ pytest pytest-asyncio twisted treq tornado aiohttp ];
|
checkInputs = [ pytest pytest-asyncio twisted treq tornado aiohttp ];
|
||||||
propagatedBuildInputs = [ uritemplate ];
|
propagatedBuildInputs = [ uritemplate ];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace setup.py \
|
||||||
|
--replace "extras_require=extras_require," "extras_require=None,"
|
||||||
|
'';
|
||||||
|
|
||||||
# requires network (reqests github.com)
|
# requires network (reqests github.com)
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with lib; {
|
||||||
description = "An async GitHub API library";
|
description = "An async GitHub API library";
|
||||||
homepage = https://github.com/brettcannon/gidgethub;
|
homepage = https://github.com/brettcannon/gidgethub;
|
||||||
license = licenses.asl20;
|
license = licenses.asl20;
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
{ stdenv, buildPythonPackage, fetchPypi
|
{ lib
|
||||||
, six, requests-cache, pygments, pyquery }:
|
, buildPythonPackage
|
||||||
|
, fetchPypi
|
||||||
|
, six
|
||||||
|
, requests-cache
|
||||||
|
, pygments
|
||||||
|
, pyquery
|
||||||
|
, python
|
||||||
|
}:
|
||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "howdoi";
|
pname = "howdoi";
|
||||||
@ -12,9 +19,14 @@ buildPythonPackage rec {
|
|||||||
|
|
||||||
propagatedBuildInputs = [ six requests-cache pygments pyquery ];
|
propagatedBuildInputs = [ six requests-cache pygments pyquery ];
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
preCheck = ''
|
||||||
|
export HOME=$(mktemp -d)
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
description = "Instant coding answers via the command line";
|
description = "Instant coding answers via the command line";
|
||||||
homepage = https://pypi.python.org/pypi/howdoi;
|
homepage = https://pypi.python.org/pypi/howdoi;
|
||||||
license = licenses.mit;
|
license = licenses.mit;
|
||||||
|
maintainers = [ maintainers.costrouc ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,33 +1,42 @@
|
|||||||
{ stdenv, buildPythonPackage, fetchFromGitHub, nose, numpy, six, ruamel_yaml, msgpack-python, coverage, coveralls, pymongo, lsof }:
|
{ lib
|
||||||
|
, buildPythonPackage
|
||||||
|
, fetchFromGitHub
|
||||||
|
, nose
|
||||||
|
, numpy
|
||||||
|
, six
|
||||||
|
, ruamel_yaml
|
||||||
|
, msgpack-python
|
||||||
|
, coverage
|
||||||
|
, coveralls
|
||||||
|
, pymongo
|
||||||
|
, lsof
|
||||||
|
}:
|
||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "monty";
|
pname = "monty";
|
||||||
version = "1.0.2";
|
version = "1.0.4";
|
||||||
|
|
||||||
# No tests in Pypi
|
# No tests in Pypi
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "materialsvirtuallab";
|
owner = "materialsvirtuallab";
|
||||||
repo = pname;
|
repo = pname;
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "0ss70fanavqdpj56yymj06lacgnknb4ap39m2q28v9lz32cs6xdg";
|
sha256 = "0vqaaz0dw0ypl6sfwbycpb0qs3ap04c4ghbggklxih66spdlggh6";
|
||||||
};
|
};
|
||||||
|
|
||||||
propagatedBuildInputs = [ nose numpy six ruamel_yaml msgpack-python coverage coveralls pymongo lsof ];
|
checkInputs = [ lsof nose numpy msgpack-python coverage coveralls pymongo];
|
||||||
|
propagatedBuildInputs = [ six ruamel_yaml ];
|
||||||
|
|
||||||
preCheck = ''
|
preCheck = ''
|
||||||
substituteInPlace tests/test_os.py \
|
substituteInPlace tests/test_os.py \
|
||||||
--replace 'def test_which(self):' '#' \
|
--replace 'self.assertEqual("/usr/bin/find", which("/usr/bin/find"))' '#'
|
||||||
--replace 'py = which("python")' '#' \
|
|
||||||
--replace 'self.assertEqual(os.path.basename(py), "python")' '#' \
|
|
||||||
--replace 'self.assertEqual("/usr/bin/find", which("/usr/bin/find"))' '#' \
|
|
||||||
--replace 'self.assertIs(which("non_existent_exe"), None)' '#' \
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with lib; {
|
||||||
description = "Serves as a complement to the Python standard library by providing a suite of tools to solve many common problems";
|
description = "Serves as a complement to the Python standard library by providing a suite of tools to solve many common problems";
|
||||||
longDescription = "
|
longDescription = "
|
||||||
Monty implements supplementary useful functions for Python that are not part of the
|
Monty implements supplementary useful functions for Python that are not part of the
|
||||||
standard library. Examples include useful utilities like transparent support for zipped files, useful design
|
standard library. Examples include useful utilities like transparent support for zipped files, useful design
|
||||||
patterns such as singleton and cached_class, and many more.
|
patterns such as singleton and cached_class, and many more.
|
||||||
";
|
";
|
||||||
homepage = https://github.com/materialsvirtuallab/monty;
|
homepage = https://github.com/materialsvirtuallab/monty;
|
||||||
@ -35,4 +44,3 @@ buildPythonPackage rec {
|
|||||||
maintainers = with maintainers; [ psyanticy ];
|
maintainers = with maintainers; [ psyanticy ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
{ stdenv
|
{ lib
|
||||||
, buildPythonPackage
|
, buildPythonPackage
|
||||||
, fetchPypi
|
, fetchPypi
|
||||||
|
, isPy27
|
||||||
|
, funcsigs
|
||||||
}:
|
}:
|
||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
@ -8,14 +10,18 @@ buildPythonPackage rec {
|
|||||||
version = "0.9";
|
version = "0.9";
|
||||||
|
|
||||||
src = fetchPypi {
|
src = fetchPypi {
|
||||||
inherit pname version;
|
inherit version;
|
||||||
|
pname = "Pint";
|
||||||
sha256 = "32d8a9a9d63f4f81194c0014b3b742679dce81a26d45127d9810a68a561fe4e2";
|
sha256 = "32d8a9a9d63f4f81194c0014b3b742679dce81a26d45127d9810a68a561fe4e2";
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
propagatedBuildInputs = lib.optional isPy27 funcsigs;
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
description = "Physical quantities module";
|
description = "Physical quantities module";
|
||||||
license = licenses.bsd3;
|
license = licenses.bsd3;
|
||||||
homepage = "https://github.com/hgrecco/pint/";
|
homepage = "https://github.com/hgrecco/pint/";
|
||||||
|
maintainers = [ maintainers.costrouc ];
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,36 @@
|
|||||||
{ stdenv, buildPythonPackage, fetchFromGitHub, pytest, libsodium, cffi, six, hypothesis}:
|
{ stdenv
|
||||||
|
, buildPythonPackage
|
||||||
|
, fetchPypi
|
||||||
|
, pytest
|
||||||
|
, libsodium
|
||||||
|
, cffi
|
||||||
|
, six
|
||||||
|
, hypothesis
|
||||||
|
}:
|
||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "pynacl";
|
pname = "pynacl";
|
||||||
version = "1.3.0";
|
version = "1.3.0";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchPypi {
|
||||||
owner = "pyca";
|
inherit version;
|
||||||
repo = pname;
|
pname = "PyNaCl";
|
||||||
rev = version;
|
sha256 = "0c6100edd16fefd1557da078c7a31e7b7d7a52ce39fdca2bec29d4f7b6e7600c";
|
||||||
sha256 = "0ac00d5bfdmz1x428h2scq5b34llp61yhxradl94qjwz7ikqv052";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
checkInputs = [ pytest hypothesis ];
|
checkInputs = [ pytest hypothesis ];
|
||||||
propagatedBuildInputs = [ libsodium cffi six ];
|
buildInputs = [ libsodium ];
|
||||||
|
propagatedBuildInputs = [ cffi six ];
|
||||||
|
|
||||||
SODIUM_INSTALL = "system";
|
SODIUM_INSTALL = "system";
|
||||||
|
|
||||||
|
# fixed in next release 1.3.0+
|
||||||
|
# https://github.com/pyca/pynacl/pull/480
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace tests/test_bindings.py \
|
||||||
|
--replace "average_size=128," ""
|
||||||
|
'';
|
||||||
|
|
||||||
checkPhase = ''
|
checkPhase = ''
|
||||||
py.test
|
py.test
|
||||||
'';
|
'';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{ stdenv, buildPythonPackage, fetchPypi
|
{ stdenv, buildPythonPackage, fetchPypi, substituteAll
|
||||||
, geos, glibcLocales, pytest, cython
|
, geos, pytest, cython
|
||||||
, numpy
|
, numpy
|
||||||
}:
|
}:
|
||||||
|
|
||||||
@ -12,26 +12,31 @@ buildPythonPackage rec {
|
|||||||
sha256 = "c4b87bb61fc3de59fc1f85e71a79b0c709dc68364d9584473697aad4aa13240f";
|
sha256 = "c4b87bb61fc3de59fc1f85e71a79b0c709dc68364d9584473697aad4aa13240f";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ geos glibcLocales cython ];
|
nativeBuildInputs = [
|
||||||
|
geos # for geos-config
|
||||||
|
cython
|
||||||
|
];
|
||||||
|
|
||||||
checkInputs = [ pytest ];
|
checkInputs = [ pytest ];
|
||||||
|
|
||||||
propagatedBuildInputs = [ numpy ];
|
propagatedBuildInputs = [ numpy ];
|
||||||
|
|
||||||
preConfigure = ''
|
# environment variable used in shapely/_buildcfg.py
|
||||||
export LANG="en_US.UTF-8";
|
GEOS_LIBRARY_PATH = "${geos}/lib/libgeos_c${stdenv.hostPlatform.extensions.sharedLibrary}";
|
||||||
'';
|
|
||||||
|
|
||||||
patchPhase = let
|
patches = [
|
||||||
libc = if stdenv.isDarwin then "libc.dylib" else "libc.so.6";
|
(substituteAll {
|
||||||
in ''
|
src = ./library-paths.patch;
|
||||||
sed -i "s|_lgeos = load_dll('geos_c', fallbacks=.*)|_lgeos = load_dll('geos_c', fallbacks=['${geos}/lib/libgeos_c${stdenv.hostPlatform.extensions.sharedLibrary}'])|" shapely/geos.py
|
libgeos_c = GEOS_LIBRARY_PATH;
|
||||||
sed -i "s|free = load_dll('c').free|free = load_dll('c', fallbacks=['${stdenv.cc.libc}/lib/${libc}']).free|" shapely/geos.py
|
libc = "${stdenv.cc.libc}/lib/libc${stdenv.hostPlatform.extensions.sharedLibrary}"
|
||||||
'';
|
+ stdenv.lib.optionalString (!stdenv.isDarwin) ".6";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
# Disable the tests that improperly try to use the built extensions
|
# Disable the tests that improperly try to use the built extensions
|
||||||
checkPhase = ''
|
checkPhase = ''
|
||||||
py.test -k 'not test_vectorized and not test_fallbacks' tests
|
rm -r shapely # prevent import of local shapely
|
||||||
|
py.test tests
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
|
109
pkgs/development/python-modules/shapely/library-paths.patch
Normal file
109
pkgs/development/python-modules/shapely/library-paths.patch
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
diff --git a/shapely/geos.py b/shapely/geos.py
|
||||||
|
index 09bf1ab..837aa98 100644
|
||||||
|
--- a/shapely/geos.py
|
||||||
|
+++ b/shapely/geos.py
|
||||||
|
@@ -55,100 +55,10 @@ def load_dll(libname, fallbacks=None, mode=DEFAULT_MODE):
|
||||||
|
"Could not find lib {0} or load any of its variants {1}.".format(
|
||||||
|
libname, fallbacks or []))
|
||||||
|
|
||||||
|
-_lgeos = None
|
||||||
|
-
|
||||||
|
-if sys.platform.startswith('linux'):
|
||||||
|
- # Test to see if we have a wheel repaired by 'auditwheel' containing its
|
||||||
|
- # own libgeos_c
|
||||||
|
- geos_whl_so = glob.glob(os.path.abspath(os.path.join(os.path.dirname(
|
||||||
|
- __file__), '.libs/libgeos_c-*.so.*')))
|
||||||
|
- if len(geos_whl_so) == 1:
|
||||||
|
- _lgeos = CDLL(geos_whl_so[0])
|
||||||
|
- LOG.debug("Found GEOS DLL: %r, using it.", _lgeos)
|
||||||
|
- else:
|
||||||
|
- alt_paths = [
|
||||||
|
- 'libgeos_c.so.1',
|
||||||
|
- 'libgeos_c.so',
|
||||||
|
- # anaconda
|
||||||
|
- os.path.join(sys.prefix, "lib", "libgeos_c.so"),
|
||||||
|
- ]
|
||||||
|
- _lgeos = load_dll('geos_c', fallbacks=alt_paths)
|
||||||
|
- free = load_dll('c').free
|
||||||
|
- free.argtypes = [c_void_p]
|
||||||
|
- free.restype = None
|
||||||
|
-
|
||||||
|
-elif sys.platform == 'darwin':
|
||||||
|
- # Test to see if we have a delocated wheel with a GEOS dylib.
|
||||||
|
- geos_whl_dylib = os.path.abspath(os.path.join(os.path.dirname(
|
||||||
|
- __file__), '.dylibs/libgeos_c.1.dylib'))
|
||||||
|
- if os.path.exists(geos_whl_dylib):
|
||||||
|
- _lgeos = CDLL(geos_whl_dylib)
|
||||||
|
- LOG.debug("Found GEOS DLL: %r, using it.", _lgeos)
|
||||||
|
-
|
||||||
|
- else:
|
||||||
|
- if hasattr(sys, 'frozen'):
|
||||||
|
- try:
|
||||||
|
- # .app file from py2app
|
||||||
|
- alt_paths = [os.path.join(
|
||||||
|
- os.environ['RESOURCEPATH'], '..', 'Frameworks',
|
||||||
|
- 'libgeos_c.dylib')]
|
||||||
|
- except KeyError:
|
||||||
|
- # binary from pyinstaller
|
||||||
|
- alt_paths = [
|
||||||
|
- os.path.join(sys.executable, 'libgeos_c.dylib')]
|
||||||
|
- if hasattr(sys, '_MEIPASS'):
|
||||||
|
- alt_paths.append(
|
||||||
|
- os.path.join(sys._MEIPASS, 'libgeos_c.1.dylib'))
|
||||||
|
- else:
|
||||||
|
- alt_paths = [
|
||||||
|
- # anaconda
|
||||||
|
- os.path.join(sys.prefix, "lib", "libgeos_c.dylib"),
|
||||||
|
- # The Framework build from Kyng Chaos
|
||||||
|
- "/Library/Frameworks/GEOS.framework/Versions/Current/GEOS",
|
||||||
|
- # macports
|
||||||
|
- '/opt/local/lib/libgeos_c.dylib',
|
||||||
|
- ]
|
||||||
|
- _lgeos = load_dll('geos_c', fallbacks=alt_paths)
|
||||||
|
-
|
||||||
|
- free = load_dll('c').free
|
||||||
|
- free.argtypes = [c_void_p]
|
||||||
|
- free.restype = None
|
||||||
|
-
|
||||||
|
-elif sys.platform == 'win32':
|
||||||
|
- try:
|
||||||
|
- egg_dlls = os.path.abspath(
|
||||||
|
- os.path.join(os.path.dirname(__file__), 'DLLs'))
|
||||||
|
- if hasattr(sys, "frozen"):
|
||||||
|
- wininst_dlls = os.path.normpath(
|
||||||
|
- os.path.abspath(sys.executable + '../../DLLS'))
|
||||||
|
- else:
|
||||||
|
- wininst_dlls = os.path.abspath(os.__file__ + "../../../DLLs")
|
||||||
|
- original_path = os.environ['PATH']
|
||||||
|
- os.environ['PATH'] = "%s;%s;%s" % \
|
||||||
|
- (egg_dlls, wininst_dlls, original_path)
|
||||||
|
- _lgeos = load_dll("geos_c.dll", fallbacks=[
|
||||||
|
- os.path.join(sys.prefix, "Library", "lib", "geos_c.dll"),
|
||||||
|
- ])
|
||||||
|
- except (ImportError, WindowsError, OSError):
|
||||||
|
- raise
|
||||||
|
-
|
||||||
|
- def free(m):
|
||||||
|
- try:
|
||||||
|
- cdll.msvcrt.free(m)
|
||||||
|
- except WindowsError:
|
||||||
|
- # XXX: See http://trac.gispython.org/projects/PCL/ticket/149
|
||||||
|
- pass
|
||||||
|
-
|
||||||
|
-elif sys.platform == 'sunos5':
|
||||||
|
- _lgeos = load_dll('geos_c', fallbacks=['libgeos_c.so.1', 'libgeos_c.so'])
|
||||||
|
- free = CDLL('libc.so.1').free
|
||||||
|
- free.argtypes = [c_void_p]
|
||||||
|
- free.restype = None
|
||||||
|
-else: # other *nix systems
|
||||||
|
- _lgeos = load_dll('geos_c', fallbacks=['libgeos_c.so.1', 'libgeos_c.so'])
|
||||||
|
- free = load_dll('c', fallbacks=['libc.so.6']).free
|
||||||
|
- free.argtypes = [c_void_p]
|
||||||
|
- free.restype = None
|
||||||
|
+_lgeos = CDLL('@libgeos_c@')
|
||||||
|
+free = CDLL('@libc@').free
|
||||||
|
+free.argtypes = [c_void_p]
|
||||||
|
+free.restype = None
|
||||||
|
|
||||||
|
|
||||||
|
def _geos_version():
|
Loading…
x
Reference in New Issue
Block a user