Merge pull request #204400 from dotlambda/python2Packages-remove

This commit is contained in:
Sandro 2022-12-07 22:34:48 +01:00 committed by GitHub
commit a6f3ef6c0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 2 additions and 598 deletions

View file

@ -1,26 +0,0 @@
{ lib
, buildPythonPackage
, fetchPypi
, cheetah
, nose
}:
buildPythonPackage rec {
pname = "TurboCheetah";
version = "1.0";
src = fetchPypi {
inherit pname version;
sha256 = "9e4c7ecb0d061bfb58281363ee1b09337083f013a8b4d0355326a5d8668f450c";
};
propagatedBuildInputs = [ cheetah ];
checkInputs = [ nose ];
meta = {
description = "TurboGears plugin to support use of Cheetah templates";
homepage = "http://docs.turbogears.org/TurboCheetah";
license = lib.licenses.mit;
};
}

View file

@ -1,33 +0,0 @@
{ lib
, buildPythonPackage
, fetchPypi
, markdown
, isPy3k
, TurboCheetah
}:
buildPythonPackage rec {
pname = "cheetah";
version = "2.4.4";
disabled = isPy3k;
src = fetchPypi {
inherit pname version;
sha256 = "be308229f0c1e5e5af4f27d7ee06d90bb19e6af3059794e5fd536a6f29a9b550";
};
propagatedBuildInputs = [ markdown ];
doCheck = false; # Circular dependency
checkInputs = [
TurboCheetah
];
meta = {
homepage = "http://www.cheetahtemplate.org/";
description = "A template engine and code generation tool";
license = lib.licenses.mit;
};
}

View file

@ -1,39 +0,0 @@
{ lib, stdenv, buildPythonPackage, fetchFromGitHub
, pytestCheckHook, pytest-benchmark, enum34, numpy, arrow, ruamel-yaml
}:
buildPythonPackage rec {
pname = "construct";
version = "2.10.54";
# no tests in PyPI tarball
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "v${version}";
sha256 = "1mqspsn6bf3ibvih1zna2glkg8iw7vy5zg9gzg0d1m8zcndk2c48";
};
checkInputs = [ pytestCheckHook enum34 numpy ];
# these have dependencies that are broken on Python 2
disabledTestPaths = [
"tests/gallery/test_gallery.py"
"tests/test_benchmarks.py"
"tests/test_compiler.py"
];
disabledTests = [
"test_benchmarks"
"test_timestamp"
] ++ lib.optionals stdenv.isDarwin [
"test_multiprocessing"
];
meta = with lib; {
description = "Powerful declarative parser (and builder) for binary data";
homepage = "https://construct.readthedocs.org/";
license = licenses.mit;
maintainers = with maintainers; [ dotlambda ];
};
}

View file

@ -1,52 +0,0 @@
{ lib
, buildPythonPackage
, fetchPypi
, tornado
, requests
, httplib2
, sure
, nose
, nose-exclude
, coverage
, rednose
, nose-randomly
, six
, mock
}:
buildPythonPackage rec {
pname = "httpretty";
version = "0.9.7";
# drop this for version > 0.9.7
# Flaky tests: https://github.com/gabrielfalcao/HTTPretty/pull/394
doCheck = lib.versionAtLeast version "0.9.8";
src = fetchPypi {
inherit pname version;
sha256 = "66216f26b9d2c52e81808f3e674a6fb65d4bf719721394a1a9be926177e55fbe";
};
propagatedBuildInputs = [ six ];
checkInputs = [ nose sure coverage mock rednose
# Following not declared in setup.py
nose-randomly requests tornado httplib2 nose-exclude
];
__darwinAllowLocalNetworking = true;
# Those flaky tests are failing intermittently on all platforms
NOSE_EXCLUDE = lib.concatStringsSep "," [
"tests.functional.test_httplib2.test_callback_response"
"tests.functional.test_requests.test_streaming_responses"
"tests.functional.test_httplib2.test_callback_response"
"tests.functional.test_requests.test_httpretty_should_allow_adding_and_overwritting_by_kwargs_u2"
];
meta = with lib; {
homepage = "https://httpretty.readthedocs.org/";
description = "HTTP client request mocking tool";
license = licenses.mit;
};
}

View file

@ -1,33 +0,0 @@
{ lib
, buildPythonPackage
, fetchPypi
, setuptools
, nose
, pyyaml
, pythonOlder
, importlib-metadata
}:
buildPythonPackage rec {
pname = "Markdown";
version = "3.1.1";
src = fetchPypi {
inherit pname version;
sha256 = "2e50876bcdd74517e7b71f3e7a76102050edec255b3983403f1a63e7c8a41e7a";
};
propagatedBuildInputs = [
setuptools
] ++ lib.optionals (pythonOlder "3.8") [
importlib-metadata
];
checkInputs = [ nose pyyaml ];
meta = {
description = "A Python implementation of John Gruber's Markdown with Extension support";
homepage = "https://github.com/Python-Markdown/markdown";
license = lib.licenses.bsd3;
};
}

View file

@ -1,34 +0,0 @@
{ lib
, buildPythonPackage
, fetchPypi
, hypothesis
, pycodestyle
, pyflakes
, pytest
, setuptools
, pkgs
}:
buildPythonPackage rec {
pname = "mutagen";
version = "1.43.1";
src = fetchPypi {
inherit pname version;
sha256 = "d873baeb7815311d3420aab0a1d83f050f628228cbc2d6045a14a16460411bc9";
};
propagatedBuildInputs = [ setuptools ];
checkInputs = [
pkgs.faad2 pkgs.flac pkgs.vorbis-tools pkgs.liboggz
pkgs.glibcLocales pycodestyle pyflakes pytest hypothesis
];
LC_ALL = "en_US.UTF-8";
meta = with lib; {
description = "Python multimedia tagging library";
homepage = "https://mutagen.readthedocs.io";
license = licenses.lgpl2Plus;
platforms = platforms.all;
};
}

View file

@ -1,99 +0,0 @@
{ lib
, fetchPypi
, python
, buildPythonPackage
, gfortran
, pytest
, blas
, lapack
, writeTextFile
, isPyPy
, cython
, setuptools
}:
assert (!blas.isILP64) && (!lapack.isILP64);
let
cfg = writeTextFile {
name = "site.cfg";
text = (lib.generators.toINI {} {
${blas.implementation} = {
include_dirs = "${lib.getDev blas}/include:${lib.getDev lapack}/include";
library_dirs = "${blas}/lib:${lapack}/lib";
runtime_library_dirs = "${blas}/lib:${lapack}/lib";
libraries = "lapack,lapacke,blas,cblas";
};
lapack = {
include_dirs = "${lib.getDev lapack}/include";
library_dirs = "${lapack}/lib";
runtime_library_dirs = "${lapack}/lib";
};
blas = {
include_dirs = "${lib.getDev blas}/include";
library_dirs = "${blas}/lib";
runtime_library_dirs = "${blas}/lib";
};
});
};
in buildPythonPackage rec {
pname = "numpy";
version = "1.16.6";
format = "pyproject";
src = fetchPypi {
inherit pname version;
extension = "zip";
sha256 = "e5cf3fdf13401885e8eea8170624ec96225e2174eb0c611c6f26dd33b489e3ff";
};
nativeBuildInputs = [ gfortran pytest cython setuptools ];
buildInputs = [ blas lapack ];
patches = lib.optionals python.hasDistutilsCxxPatch [
# We patch cpython/distutils to fix https://bugs.python.org/issue1222585
# Patching of numpy.distutils is needed to prevent it from undoing the
# patch to distutils.
./numpy-distutils-C++.patch
];
preConfigure = ''
sed -i 's/-faltivec//' numpy/distutils/system_info.py
export NPY_NUM_BUILD_JOBS=$NIX_BUILD_CORES
export OMP_NUM_THREADS=$((NIX_BUILD_CORES > 64 ? 64 : NIX_BUILD_CORES))
'';
preBuild = ''
ln -s ${cfg} site.cfg
'';
enableParallelBuilding = true;
doCheck = !isPyPy; # numpy 1.16+ hits a bug in pypy's ctypes, using either numpy or pypy HEAD fixes this (https://github.com/numpy/numpy/issues/13807)
checkPhase = ''
runHook preCheck
pushd "$out"
${python.interpreter} -c 'import numpy; numpy.test("fast", verbose=10)'
popd
runHook postCheck
'';
passthru = {
# just for backwards compatibility
blas = blas.provider;
blasImplementation = blas.implementation;
inherit cfg;
};
# Disable test
# - test_large_file_support: takes a long time and can cause the machine to run out of disk space
NOSE_EXCLUDE="test_large_file_support";
meta = {
description = "Scientific tools for Python";
homepage = "https://numpy.org/";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ fridh ];
};
}

View file

@ -1,30 +0,0 @@
diff --git a/numpy/distutils/unixccompiler.py b/numpy/distutils/unixccompiler.py
--- a/numpy/distutils/unixccompiler.py
+++ b/numpy/distutils/unixccompiler.py
@@ -44,8 +44,6 @@ def UnixCCompiler__compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts
if opt not in llink_s:
self.linker_so = llink_s.split() + opt.split()
- display = '%s: %s' % (os.path.basename(self.compiler_so[0]), src)
-
# gcc style automatic dependencies, outputs a makefile (-MF) that lists
# all headers needed by a c file as a side effect of compilation (-MMD)
if getattr(self, '_auto_depends', False):
@@ -54,8 +52,15 @@ def UnixCCompiler__compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts
deps = []
try:
- self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + deps +
- extra_postargs, display = display)
+ if self.detect_language(src) == 'c++':
+ display = '%s: %s' % (os.path.basename(self.compiler_so_cxx[0]), src)
+ self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] + deps +
+ extra_postargs, display = display)
+ else:
+ display = '%s: %s' % (os.path.basename(self.compiler_so[0]), src)
+ self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + deps +
+ extra_postargs, display = display)
+
except DistutilsExecError:
msg = str(get_exception())
raise CompileError(msg)

View file

@ -1,47 +0,0 @@
{ lib, stdenv, buildPythonPackage, fetchPypi, isPyPy, isPy3k
, olefile, freetype, libjpeg, zlib, libtiff, libwebp, tcl, lcms2, tk, libX11
, openjpeg, libimagequant, pyroma, numpy, pytestCheckHook
}@args:
import ./generic.nix (rec {
pname = "Pillow";
version = "6.2.2";
disabled = !isPy3k;
src = fetchPypi {
inherit pname version;
sha256 = "0l5rv8jkdrb5q846v60v03mcq64yrhklidjkgwv6s1pda71g17yv";
};
meta = with lib; {
homepage = "https://python-pillow.org/";
description = "The friendly PIL fork (Python Imaging Library)";
longDescription = ''
The Python Imaging Library (PIL) adds image processing
capabilities to your Python interpreter. This library
supports many file formats, and provides powerful image
processing and graphics capabilities.
'';
license = "http://www.pythonware.com/products/pil/license.htm";
maintainers = with maintainers; [ goibhniu prikhi SuperSandro2000 ];
knownVulnerabilities = [
"CVE-2020-10177"
"CVE-2020-10378"
"CVE-2020-10379"
"CVE-2020-10994"
"CVE-2020-11538"
"CVE-2020-35653"
"CVE-2020-35654"
"CVE-2020-35655"
"CVE-2021-25289"
"CVE-2021-25290"
"CVE-2021-25291"
"CVE-2021-25292"
"CVE-2021-25293"
"CVE-2021-27921"
"CVE-2021-27922"
"CVE-2021-27923"
];
};
} // args )

View file

@ -1,77 +0,0 @@
{ pname
, version
, disabled
, src
, meta
, ...
}@args:
with args;
buildPythonPackage rec {
inherit pname version src meta;
# Disable imagefont tests, because they don't work well with infinality:
# https://github.com/python-pillow/Pillow/issues/1259
postPatch = ''
rm Tests/test_imagefont.py
'';
# Disable darwin tests which require executables: `iconutil` and `screencapture`
disabledTests = lib.optionals stdenv.isDarwin [
"test_grab"
"test_grabclipboard"
"test_save"
# pillow-simd
"test_roundtrip"
"test_basic"
] ++ lib.optionals (lib.versions.major version == "6") [
# RuntimeError: Error setting from dictionary
"test_custom_metadata"
];
propagatedBuildInputs = [ olefile ]
++ lib.optionals (lib.versionAtLeast version "8.2.0") [ defusedxml ];
checkInputs = [ pytestCheckHook pyroma numpy ];
buildInputs = [ freetype libjpeg openjpeg libimagequant zlib libtiff libwebp tcl lcms2 ]
++ lib.optionals (lib.versionAtLeast version "7.1.0") [ libxcb ]
++ lib.optionals (isPyPy) [ tk libX11 ];
# NOTE: we use LCMS_ROOT as WEBP root since there is not other setting for webp.
# NOTE: The Pillow install script will, by default, add paths like /usr/lib
# and /usr/include to the search paths. This can break things when building
# on a non-NixOS system that has some libraries installed that are not
# installed in Nix (for example, Arch Linux has jpeg2000 but Nix doesn't
# build Pillow with this support). We patch the `disable_platform_guessing`
# setting here, instead of passing the `--disable-platform-guessing`
# command-line option, since the command-line option doesn't work when we run
# tests.
preConfigure = let
libinclude' = pkg: ''"${pkg.out}/lib", "${pkg.out}/include"'';
libinclude = pkg: ''"${pkg.out}/lib", "${pkg.dev}/include"'';
in ''
sed -i "setup.py" \
-e 's|^FREETYPE_ROOT =.*$|FREETYPE_ROOT = ${libinclude freetype}|g ;
s|^JPEG_ROOT =.*$|JPEG_ROOT = ${libinclude libjpeg}|g ;
s|^JPEG2K_ROOT =.*$|JPEG2K_ROOT = ${libinclude openjpeg}|g ;
s|^IMAGEQUANT_ROOT =.*$|IMAGEQUANT_ROOT = ${libinclude' libimagequant}|g ;
s|^ZLIB_ROOT =.*$|ZLIB_ROOT = ${libinclude zlib}|g ;
s|^LCMS_ROOT =.*$|LCMS_ROOT = ${libinclude lcms2}|g ;
s|^TIFF_ROOT =.*$|TIFF_ROOT = ${libinclude libtiff}|g ;
s|^TCL_ROOT=.*$|TCL_ROOT = ${libinclude' tcl}|g ;
s|self\.disable_platform_guessing = None|self.disable_platform_guessing = True|g ;'
export LDFLAGS="$LDFLAGS -L${libwebp}/lib"
export CFLAGS="$CFLAGS -I${libwebp}/include"
'' + lib.optionalString (lib.versionAtLeast version "7.1.0") ''
export LDFLAGS="$LDFLAGS -L${libxcb}/lib"
export CFLAGS="$CFLAGS -I${libxcb.dev}/include"
'' + lib.optionalString stdenv.isDarwin ''
# Remove impurities
substituteInPlace setup.py \
--replace '"/Library/Frameworks",' "" \
--replace '"/System/Library/Frameworks"' ""
'';
}

View file

@ -1,37 +0,0 @@
{ lib
, buildPythonPackage
, fetchPypi
, glibcLocales
, setuptools-scm
, wcwidth
}:
buildPythonPackage rec {
pname = "prettytable";
version = "1.0.1";
src = fetchPypi {
inherit pname version;
sha256 = "0wcpp1nkicrswb353yn6xd2x535cpif62nw5rgz33c1wj0wzbdvb";
};
nativeBuildInputs = [ setuptools-scm ];
buildInputs = [ glibcLocales ];
propagatedBuildInputs = [ wcwidth ];
preCheck = ''
export LANG="en_US.UTF-8"
'';
# no test no longer available in pypi package
doCheck = false;
pythonImportsCheck = [ "prettytable" ];
meta = with lib; {
description = "Simple Python library for easily displaying tabular data in a visually appealing ASCII table format";
homepage = "http://code.google.com/p/prettytable/";
license = licenses.bsd3;
};
}

View file

@ -1,38 +0,0 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, cython
, libyaml
, isPy27
, python
}:
buildPythonPackage rec {
pname = "PyYAML";
version = "5.4.1.1";
src = fetchFromGitHub {
owner = "yaml";
repo = "pyyaml";
rev = version;
sha256 = "1v386gzdvsjg0mgix6v03rd0cgs9dl81qvn3m547849jm8r41dx8";
};
nativeBuildInputs = [ cython ];
buildInputs = [ libyaml ];
checkPhase = ''
runHook preCheck
PYTHONPATH=""tests/lib":$PYTHONPATH" ${python.interpreter} -m test_all
runHook postCheck
'';
pythonImportsCheck = [ "yaml" ];
meta = with lib; {
description = "The next generation YAML parser and emitter for Python";
homepage = "https://github.com/yaml/pyyaml";
license = licenses.mit;
};
}

View file

@ -1,26 +0,0 @@
{ lib
, buildPythonPackage
, fetchurl
, isPy3k
}:
buildPythonPackage rec {
pname = "qpid-python";
version = "0.32";
disabled = isPy3k;
src = fetchurl {
url = "http://www.us.apache.org/dist/qpid/${version}/${pname}-${version}.tar.gz";
sha256 = "09hdfjgk8z4s3dr8ym2r6xn97j1f9mkb2743pr6zd0bnj01vhsv4";
};
# needs a broker running and then ./qpid-python-test
doCheck = false;
meta = with lib; {
homepage = "https://qpid.apache.org/";
description = "Python client implementation and AMQP conformance tests for Apache Qpid";
license = licenses.asl20;
};
}

View file

@ -63,9 +63,9 @@ let
} else rec {
python = scons.python.withPackages (ps: with ps; [
pyyaml
setuptools
typing
cheetah
cheetah3
]);
scons = sconsPackages.scons_3_1_2;

View file

@ -17,12 +17,8 @@ with self; with super; {
chardet = callPackage ../development/python2-modules/chardet { };
cheetah = callPackage ../development/python2-modules/cheetah { };
configparser = callPackage ../development/python2-modules/configparser { };
construct = callPackage ../development/python2-modules/construct { };
contextlib2 = callPackage ../development/python2-modules/contextlib2 { };
coverage = callPackage ../development/python2-modules/coverage { };
@ -37,8 +33,6 @@ with self; with super; {
gtkme = callPackage ../development/python2-modules/gtkme { };
httpretty = callPackage ../development/python2-modules/httpretty { };
hypothesis = callPackage ../development/python2-modules/hypothesis { };
idna = callPackage ../development/python2-modules/idna { };
@ -51,31 +45,18 @@ with self; with super; {
inherit (pkgs) marisa;
};
markdown = callPackage ../development/python2-modules/markdown { };
markupsafe = callPackage ../development/python2-modules/markupsafe { };
mock = callPackage ../development/python2-modules/mock { };
more-itertools = callPackage ../development/python2-modules/more-itertools { };
mutagen = callPackage ../development/python2-modules/mutagen { };
numpy = callPackage ../development/python2-modules/numpy { };
packaging = callPackage ../development/python2-modules/packaging { };
pillow = callPackage ../development/python2-modules/pillow {
inherit (pkgs) freetype libjpeg zlib libtiff libwebp tcl lcms2 tk;
inherit (pkgs.xorg) libX11;
};
pip = callPackage ../development/python2-modules/pip { };
pluggy = callPackage ../development/python2-modules/pluggy { };
prettytable = callPackage ../development/python2-modules/prettytable { };
protobuf = callPackage ../development/python2-modules/protobuf {
disabled = isPyPy;
protobuf = pkgs.protobuf3_17; # last version compatible with Python 2
@ -113,10 +94,6 @@ with self; with super; {
pytest-xdist = callPackage ../development/python2-modules/pytest-xdist { };
pyyaml = callPackage ../development/python2-modules/pyyaml { };
qpid-python = callPackage ../development/python2-modules/qpid-python { };
recoll = disabled super.recoll;
rivet = disabled super.rivet;
@ -137,8 +114,6 @@ with self; with super; {
sphinx = callPackage ../development/python2-modules/sphinx { };
TurboCheetah = callPackage ../development/python2-modules/TurboCheetah { };
typing = callPackage ../development/python2-modules/typing { };
zeek = disabled super.zeek;