push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
# Python 2 is Not Supported
Packages, applications, and services based on Python 2 are no longer supported and are being removed. If you require a Python 2 based package, you can include that package in your own local repository.
Some packages may continue to be maintained for internal use by nixpkgs, but they should not be used by new public packages.
For more details, see [Issue #201859](https://github.com/NixOS/nixpkgs/pull/201859).

View File

@@ -0,0 +1,42 @@
{
lib,
buildPythonPackage,
fetchPypi,
}:
buildPythonPackage rec {
pname = "attrs";
version = "21.4.0";
format = "setuptools";
src = fetchPypi {
inherit pname version;
hash = "sha256-YmuoI0IR25joad92IwoTfExAoS1yRFxF1fW3FvB24v0=";
};
outputs = [
"out"
"testout"
];
postInstall = ''
# Install tests as the tests output.
mkdir $testout
cp -R tests $testout/tests
'';
pythonImportsCheck = [
"attr"
];
# pytest depends on attrs, so we can't do this out-of-the-box.
# Instead, we do this as a passthru.tests test.
doCheck = false;
meta = with lib; {
description = "Python attributes without boilerplate";
homepage = "https://github.com/hynek/attrs";
license = licenses.mit;
maintainers = [ ];
};
}

View File

@@ -0,0 +1,38 @@
{
lib,
buildPythonPackage,
fetchPypi,
setuptools,
setuptools-scm,
}:
buildPythonPackage rec {
pname = "backports-functools-lru-cache";
version = "1.6.6";
format = "pyproject";
src = fetchPypi {
pname = "backports.functools_lru_cache";
inherit version;
hash = "sha256-e3DnAbpNtYwO2GcanTORsKu5vRvCTU6Qw0gPS6r8wtw=";
};
nativeBuildInputs = [
setuptools
setuptools-scm
];
# circular dependency:
# backports-functools-lru-cache -> pytest -> wc-width -> backports-functools-lru-cache
doCheck = false;
pythonImportsCheck = [
"backports.functools_lru_cache"
];
meta = {
description = "Backport of functools.lru_cache";
homepage = "https://github.com/jaraco/backports.functools_lru_cache";
license = lib.licenses.mit;
};
}

View File

@@ -0,0 +1,86 @@
{
lib,
stdenv,
python,
makeWrapper,
unzip,
pipInstallHook,
setuptoolsBuildHook,
wheel,
pip,
setuptools,
}:
stdenv.mkDerivation rec {
pname = "pip";
inherit (pip) version;
name = "${python.libPrefix}-bootstrapped-${pname}-${version}";
srcs = [
wheel.src
pip.src
setuptools.src
];
sourceRoot = ".";
dontUseSetuptoolsBuild = true;
dontUsePipInstall = true;
# Should be propagatedNativeBuildInputs
propagatedBuildInputs = [
# Override to remove dependencies to prevent infinite recursion.
(pipInstallHook.override { pip = null; })
(setuptoolsBuildHook.override {
setuptools = null;
wheel = null;
})
];
postPatch = ''
mkdir -p $out/bin
'';
nativeBuildInputs = [
makeWrapper
unzip
];
buildInputs = [ python ];
dontBuild = true;
installPhase =
lib.optionalString (!stdenv.hostPlatform.isWindows) ''
export SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES=0
''
+ ''
# Give folders a known name
mv pip* pip
mv setuptools* setuptools
mv wheel* wheel
# Set up PYTHONPATH:
# - pip and setuptools need to be in PYTHONPATH to install setuptools, wheel, and pip.
# - $out is where we are installing to and takes precedence, and is where wheel will end so we can install pip.
export PYTHONPATH="$out/${python.sitePackages}:$(pwd)/pip/src:$(pwd)/setuptools:$(pwd)/setuptools/pkg_resources:$PYTHONPATH"
echo "Building setuptools wheel..."
pushd setuptools
${python.pythonOnBuildForHost.interpreter} -m pip install --no-build-isolation --no-index --prefix=$out --ignore-installed --no-dependencies --no-cache .
popd
echo "Building wheel wheel..."
pushd wheel
${python.pythonOnBuildForHost.interpreter} -m pip install --no-build-isolation --no-index --prefix=$out --ignore-installed --no-dependencies --no-cache .
popd
echo "Building pip wheel..."
pushd pip
${python.pythonOnBuildForHost.interpreter} -m pip install --no-build-isolation --no-index --prefix=$out --ignore-installed --no-dependencies --no-cache .
popd
'';
meta = {
description = "Version of pip used for bootstrapping";
license = lib.unique (pip.meta.license ++ setuptools.meta.license ++ wheel.meta.license);
homepage = pip.meta.homepage;
};
}

View File

@@ -0,0 +1,52 @@
{
lib,
stdenv,
cffi,
}:
if cffi == null then
null
else
cffi.overridePythonAttrs {
disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
# cannot load library 'c'
"test_FILE"
"test_FILE_object"
"test_FILE_only_for_FILE_arg"
"test_load_and_call_function"
"test_load_library"
# cannot load library 'dl'
"test_dlopen_handle"
# cannot load library 'm'
"test_dir_on_dlopen_lib"
"test_dlclose"
"test_dlopen"
"test_dlopen_constant"
"test_dlopen_flags"
"test_function_typedef"
"test_line_continuation_in_defines"
"test_missing_function"
"test_remove_comments"
"test_remove_line_continuation_comments"
"test_simple"
"test_sin"
"test_sinf"
"test_stdcall_only_on_windows"
"test_wraps_from_stdlib"
# MemoryError
"test_callback_as_function_argument"
"test_callback_crash"
"test_callback_decorator"
"test_callback_large_struct"
"test_callback_returning_void"
"test_cast_functionptr_and_int"
"test_function_pointer"
"test_functionptr_intptr_return"
"test_functionptr_simple"
"test_functionptr_void_return"
"test_functionptr_voidptr_return"
];
}

View File

@@ -0,0 +1,33 @@
{
lib,
stdenv,
buildPythonPackage,
fetchPypi,
setuptools-scm,
}:
buildPythonPackage rec {
pname = "configparser";
version = "4.0.2";
format = "setuptools";
src = fetchPypi {
inherit pname version;
sha256 = "c7d282687a5308319bf3d2e7706e575c635b0a470342641c93bea0ea3b5331df";
};
# No tests available
doCheck = false;
nativeBuildInputs = [ setuptools-scm ];
preConfigure = ''
export LC_ALL=${if stdenv.hostPlatform.isDarwin then "en_US" else "C"}.UTF-8
'';
meta = with lib; {
description = "Updated configparser from Python 3.7 for Python 2.6+";
license = licenses.mit;
homepage = "https://github.com/jaraco/configparser";
};
}

View File

@@ -0,0 +1,25 @@
{
lib,
buildPythonPackage,
fetchPypi,
}:
buildPythonPackage rec {
pname = "contextlib2";
version = "0.6.0.post1";
format = "setuptools";
src = fetchPypi {
inherit pname version;
sha256 = "01f490098c18b19d2bd5bb5dc445b2054d2fa97f09a4280ba2c5f3c394c8162e";
};
# requires unittest2, which has been removed
doCheck = false;
meta = {
description = "Backports and enhancements for the contextlib module";
homepage = "https://contextlib2.readthedocs.org/";
license = lib.licenses.psfl;
};
}

View File

@@ -0,0 +1,27 @@
{
lib,
buildPythonPackage,
fetchPypi,
mock,
}:
buildPythonPackage rec {
pname = "coverage";
version = "5.5";
format = "setuptools";
src = fetchPypi {
inherit pname version;
sha256 = "ebe78fe9a0e874362175b02371bdfbee64d8edc42a044253ddf4ee7d3c15212c";
};
# No tests in archive
doCheck = false;
nativeCheckInputs = [ mock ];
meta = {
description = "Code coverage measurement for python";
homepage = "https://coverage.readthedocs.io/";
license = lib.licenses.bsd3;
};
}

View File

@@ -0,0 +1,28 @@
{
lib,
buildPythonPackage,
fetchPypi,
isPy3k,
isPyPy,
}:
buildPythonPackage rec {
pname = "enum";
version = "0.4.7";
format = "setuptools";
disabled = isPy3k;
src = fetchPypi {
inherit pname version;
sha256 = "001iq0yqs9f5bslvl793bhkcs71k5km9kv8yrj5h0lfsgrcg6z4c";
};
doCheck = !isPyPy;
meta = with lib; {
homepage = "https://pypi.python.org/pypi/enum/";
description = "Robust enumerated type support in Python";
license = licenses.gpl2;
};
}

View File

@@ -0,0 +1,28 @@
{
lib,
buildPythonPackage,
fetchPypi,
setuptools-scm,
}:
buildPythonPackage rec {
pname = "filelock";
version = "3.2.1";
format = "setuptools";
src = fetchPypi {
inherit pname version;
sha256 = "1qry67zv2pmz8px6wdfbjqv75nmryy2ac7asqgs6q6db2722kpcw";
};
nativeBuildInputs = [
setuptools-scm
];
meta = with lib; {
homepage = "https://github.com/benediktschmitt/py-filelock";
description = "Platform independent file lock for Python";
license = licenses.unlicense;
maintainers = with maintainers; [ henkkalkwater ];
};
}

View File

@@ -0,0 +1,35 @@
{
lib,
buildPythonPackage,
fetchPypi,
isPy3k,
python,
stdenv,
}:
buildPythonPackage rec {
pname = "futures";
version = "3.3.0";
format = "setuptools";
src = fetchPypi {
inherit pname version;
sha256 = "7e033af76a5e35f58e56da7a91e687706faf4e7bdfb2cbc3f2cca6b9bcda9794";
};
# This module is for backporting functionality to Python 2.x, it's builtin in py3k
disabled = isPy3k;
checkPhase = ''
${python.interpreter} test_futures.py
'';
doCheck = !stdenv.hostPlatform.isDarwin;
meta = with lib; {
description = "Backport of the concurrent.futures package from Python 3.2";
homepage = "https://github.com/agronholm/pythonfutures";
license = licenses.bsd2;
maintainers = [ ];
};
}

View File

@@ -0,0 +1,61 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
attrs,
coverage,
pexpect,
doCheck ? true,
pytest,
pytest-xdist,
flaky,
mock,
sortedcontainers,
}:
buildPythonPackage rec {
# https://hypothesis.readthedocs.org/en/latest/packaging.html
# Hypothesis has optional dependencies on the following libraries
# pytz fake_factory django numpy pytest
# If you need these, you can just add them to your environment.
version = "4.57.1";
format = "setuptools";
pname = "hypothesis";
# Use github tarballs that includes tests
src = fetchFromGitHub {
owner = "HypothesisWorks";
repo = "hypothesis-python";
rev = "hypothesis-python-${version}";
sha256 = "1qcpcrk6892hzyjsdr581pw6i4fj9035nv89mcjrcrzcmycdlfds";
};
postUnpack = "sourceRoot=$sourceRoot/hypothesis-python";
propagatedBuildInputs = [
attrs
coverage
sortedcontainers
];
nativeCheckInputs = [
pytest
pytest-xdist
flaky
mock
pexpect
];
inherit doCheck;
checkPhase = ''
rm tox.ini # This file changes how py.test runs and breaks it
py.test tests/cover
'';
meta = with lib; {
description = "Python library for property based testing";
homepage = "https://github.com/HypothesisWorks/hypothesis";
license = licenses.mpl20;
};
}

View File

@@ -0,0 +1,45 @@
{
lib,
buildPythonPackage,
fetchPypi,
setuptools-scm,
zipp,
pathlib2,
contextlib2,
configparser,
isPy3k,
}:
buildPythonPackage rec {
pname = "importlib-metadata";
version = "2.1.1";
format = "setuptools";
src = fetchPypi {
pname = "importlib_metadata";
inherit version;
sha256 = "1pdmsmwagimn0lsl4x7sg3skcr2fvzqpv2pjd1rh7yrm5gzrxpmq";
};
nativeBuildInputs = [ setuptools-scm ];
propagatedBuildInputs = [
zipp
]
++ lib.optionals (!isPy3k) [
pathlib2
contextlib2
configparser
];
# Cyclic dependencies
doCheck = false;
pythonImportsCheck = [ "importlib_metadata" ];
meta = with lib; {
description = "Read metadata from Python packages";
homepage = "https://importlib-metadata.readthedocs.io/";
license = licenses.asl20;
};
}

View File

@@ -0,0 +1,48 @@
{
lib,
stdenv,
buildPythonPackage,
isPy3k,
fetchPypi,
pytest,
markupsafe,
setuptools,
}:
buildPythonPackage rec {
pname = "Jinja2";
version = "2.11.3";
format = "setuptools";
src = fetchPypi {
inherit pname version;
sha256 = "a6d58433de0ae800347cab1fa3043cebbabe8baa9d29e668f1c768cb87a333c6";
};
nativeCheckInputs = [ pytest ];
propagatedBuildInputs = [
markupsafe
setuptools
];
# Multiple tests run out of stack space on 32bit systems with python2.
# See https://github.com/pallets/jinja/issues/1158
# warnings are no longer being filtered correctly for python2
doCheck = !stdenv.hostPlatform.is32bit && isPy3k;
checkPhase = ''
pytest -v tests -W ignore::DeprecationWarning
'';
meta = with lib; {
homepage = "http://jinja.pocoo.org/";
description = "Stand-alone template engine";
license = licenses.bsd3;
longDescription = ''
Jinja2 is a template engine written in pure Python. It provides a
Django inspired non-XML syntax but supports inline expressions and
an optional sandboxed environment.
'';
maintainers = with maintainers; [ pierron ];
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
buildPythonPackage,
fetchPypi,
}:
buildPythonPackage rec {
pname = "MarkupSafe";
version = "1.1.1";
format = "setuptools";
src = fetchPypi {
inherit pname version;
sha256 = "29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b";
};
meta = with lib; {
description = "Implements a XML/HTML/XHTML Markup safe string";
homepage = "http://dev.pocoo.org";
license = licenses.bsd3;
maintainers = [ ];
};
}

View File

@@ -0,0 +1,47 @@
{
lib,
buildPythonPackage,
fetchPypi,
isPy27,
funcsigs,
six,
pbr,
unittestCheckHook,
pytest,
}:
buildPythonPackage rec {
pname = "mock";
version = "3.0.5";
format = "setuptools";
src = fetchPypi {
inherit pname version;
sha256 = "83657d894c90d5681d62155c82bda9c1187827525880eda8ff5df4ec813437c3";
};
propagatedBuildInputs = [
six
pbr
]
++ lib.optionals isPy27 [ funcsigs ];
# On PyPy for Python 2.7 in particular, Mock's tests have a known failure.
# Mock upstream has a decoration to disable the failing test and make
# everything pass, but it is not yet released. The commit:
# https://github.com/testing-cabal/mock/commit/73bfd51b7185#diff-354f30a63fb0907d4ad57269548329e3L12
#doCheck = !(python.isPyPy && python.isPy27);
doCheck = false; # Infinite recursion pytest
nativeCheckInputs = [
unittestCheckHook
pytest
];
meta = with lib; {
description = "Mock objects for Python";
homepage = "http://python-mock.sourceforge.net/";
license = licenses.bsd2;
};
}

View File

@@ -0,0 +1,32 @@
{
lib,
buildPythonPackage,
fetchPypi,
unittestCheckHook,
six,
stdenv,
}:
buildPythonPackage rec {
pname = "more-itertools";
version = "5.0.0";
format = "setuptools";
src = fetchPypi {
inherit pname version;
sha256 = "38a936c0a6d98a38bcc2d03fdaaedaba9f412879461dd2ceff8d37564d6522e4";
};
nativeCheckInputs = [ unittestCheckHook ];
propagatedBuildInputs = [ six ];
# iterable = range(10 ** 10) # Is efficiently reversible
# OverflowError: Python int too large to convert to C long
doCheck = !stdenv.hostPlatform.is32bit;
meta = {
homepage = "https://more-itertools.readthedocs.org";
description = "Expansion of the itertools module";
license = lib.licenses.mit;
};
}

View File

@@ -0,0 +1,46 @@
{
lib,
buildPythonPackage,
fetchPypi,
pyparsing,
six,
pytestCheckHook,
pretend,
}:
# We keep 20.4 because it uses setuptools instead of flit-core
# which requires Python 3 to build a universal wheel.
buildPythonPackage rec {
pname = "packaging";
version = "20.4";
format = "setuptools";
src = fetchPypi {
inherit pname version;
sha256 = "4357f74f47b9c12db93624a82154e9b120fa8293699949152b22065d556079f8";
};
propagatedBuildInputs = [
pyparsing
six
];
nativeCheckInputs = [
pytestCheckHook
pretend
];
# Prevent circular dependency
doCheck = false;
meta = with lib; {
description = "Core utilities for Python packages";
homepage = "https://github.com/pypa/packaging";
license = [
licenses.bsd2
licenses.asl20
];
maintainers = with maintainers; [ bennofs ];
};
}

View File

@@ -0,0 +1,48 @@
{
lib,
buildPythonPackage,
bootstrapped-pip,
fetchFromGitHub,
mock,
scripttest,
virtualenv,
pretend,
pytest,
}:
buildPythonPackage rec {
pname = "pip";
version = "20.3.4";
format = "other";
src = fetchFromGitHub {
owner = "pypa";
repo = pname;
rev = version;
sha256 = "0hkhs9yc1cjdj1gn9wkycd3sy65c05q8k8rhqgsm5jbpksfssiwn";
name = "${pname}-${version}-source";
};
nativeBuildInputs = [ bootstrapped-pip ];
# pip detects that we already have bootstrapped_pip "installed", so we need
# to force it a little.
pipInstallFlags = [ "--ignore-installed" ];
nativeCheckInputs = [
mock
scripttest
virtualenv
pretend
pytest
];
# Pip wants pytest, but tests are not distributed
doCheck = false;
meta = {
description = "PyPA recommended tool for installing Python packages";
license = with lib.licenses; [ mit ];
homepage = "https://pip.pypa.io/";
priority = 10;
};
}

View File

@@ -0,0 +1,36 @@
{
buildPythonPackage,
lib,
fetchPypi,
setuptools-scm,
importlib-metadata,
}:
buildPythonPackage rec {
pname = "pluggy";
version = "0.13.1";
format = "setuptools";
src = fetchPypi {
inherit pname version;
sha256 = "15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0";
};
checkPhase = ''
py.test
'';
# To prevent infinite recursion with pytest
doCheck = false;
nativeBuildInputs = [ setuptools-scm ];
propagatedBuildInputs = [ importlib-metadata ];
meta = {
description = "Plugin and hook calling mechanisms for Python";
homepage = "https://github.com/pytest-dev/pluggy";
license = lib.licenses.mit;
maintainers = [ ];
};
}

View File

@@ -0,0 +1,66 @@
{
lib,
fetchFromGitHub,
fetchpatch,
meson,
ninja,
buildPythonPackage,
pytest,
pkg-config,
cairo,
python,
}:
buildPythonPackage rec {
pname = "pycairo";
version = "1.18.2";
format = "other";
src = fetchFromGitHub {
owner = "pygobject";
repo = "pycairo";
rev = "v${version}";
sha256 = "142145a2whvlk92jijrbf3i2bqrzmspwpysj0bfypw0krzi0aa6j";
};
patches = [
(fetchpatch {
url = "https://github.com/pygobject/pycairo/commit/678edd94d8a6dfb5d51f9c3549e6ee8c90a73744.patch";
sha256 = "sha256-HmP69tUGYxZvJ/M9FJHwHTCjb9Kf4aWRyMT4wSymrT0=";
})
];
nativeBuildInputs = [
meson
ninja
pkg-config
];
buildInputs = [
cairo
];
# HACK: Don't use the pytestCheckHook because PYTHONPATH
# will be added by the Python setuptook breaking meson.
checkPhase = ''
${pytest}/bin/pytest
'';
mesonFlags = [
# This is only used for figuring out what version of Python is in
# use, and related stuff like figuring out what the install prefix
# should be, but it does need to be able to execute Python code.
"-Dpython=${python.pythonOnBuildForHost.interpreter}"
];
meta = with lib; {
description = "Python 2 bindings for cairo";
homepage = "https://pycairo.readthedocs.io/";
license = with licenses; [
lgpl21Only
mpl11
];
platforms = lib.platforms.linux ++ lib.platforms.darwin;
};
}

View File

@@ -0,0 +1,62 @@
{
lib,
stdenv,
fetchurl,
fetchpatch,
python,
buildPythonPackage,
pkg-config,
glib,
isPy3k,
pythonAtLeast,
}:
buildPythonPackage rec {
pname = "pygobject";
version = "2.28.7";
format = "other";
disabled = pythonAtLeast "3.9";
src = fetchurl {
url = "mirror://gnome/sources/pygobject/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
sha256 = "0nkam61rsn7y3wik3vw46wk5q2cjfh2iph57hl9m39rc8jijb7dv";
};
outputs = [
"out"
"devdoc"
];
patches = lib.optionals stdenv.hostPlatform.isDarwin [
./pygobject-2.0-fix-darwin.patch
(fetchpatch {
url = "https://github.com/macports/macports-ports/raw/f2975d5bbbc2459c661905c5a850cc661fa32f55/python/py-gobject/files/py-gobject-dynamic_lookup-11.patch";
sha256 = "sha256-mtlyu+La3+iC5iQAmVJzDA5E35XGaRQy/EKXzvrWRCg=";
extraPrefix = "";
})
];
configureFlags = [ "--disable-introspection" ];
nativeBuildInputs = [ pkg-config ];
buildInputs = [ glib ];
# in a "normal" setup, pygobject and pygtk are installed into the
# same site-packages: we need a pth file for both. pygtk.py would be
# used to select a specific version, in our setup it should have no
# effect, but we leave it in case somebody expects and calls it.
postInstall = lib.optionalString (!isPy3k) ''
mv $out/${python.sitePackages}/{pygtk.pth,${pname}-${version}.pth}
# Prevent wrapping of codegen files as these are meant to be
# executed by the python program
chmod a-x $out/share/pygobject/*/codegen/*.py
'';
meta = with lib; {
homepage = "https://pygobject.readthedocs.io/";
description = "Python bindings for GLib";
license = licenses.gpl2;
maintainers = [ ];
};
}

View File

@@ -0,0 +1,88 @@
--- a/gio/unix-types.defs
+++ b/gio/unix-types.defs
@@ -7,18 +7,6 @@
(gtype-id "G_TYPE_UNIX_CONNECTION")
)
-(define-object DesktopAppInfo
- (docstring
- "DesktopAppInfo(desktop_id) -> gio.unix.DesktopAppInfo\n\n"
- "gio.Unix.DesktopAppInfo is an implementation of gio.AppInfo\n"
- "based on desktop files."
- )
- (in-module "giounix")
- (parent "GObject")
- (c-name "GDesktopAppInfo")
- (gtype-id "G_TYPE_DESKTOP_APP_INFO")
-)
-
(define-object FDMessage
(in-module "giounix")
(parent "GSocketControlMessage")
--- a/gio/unix.defs
+++ b/gio/unix.defs
@@ -32,54 +32,6 @@
-;; From gdesktopappinfo.h
-
-(define-function desktop_app_info_get_type
- (c-name "g_desktop_app_info_get_type")
- (return-type "GType")
-)
-
-(define-function desktop_app_info_new_from_filename
- (c-name "g_desktop_app_info_new_from_filename")
- (return-type "GDesktopAppInfo*")
- (parameters
- '("const-char*" "filename")
- )
-)
-
-(define-function g_desktop_app_info_new_from_keyfile
- (c-name "g_desktop_app_info_new_from_keyfile")
- (return-type "GDesktopAppInfo*")
- (parameters
- '("GKeyFile*" "key_file")
- )
-)
-
-(define-function desktop_app_info_new
- (c-name "g_desktop_app_info_new")
- (is-constructor-of "GDesktopAppInfo")
- (return-type "GDesktopAppInfo*")
- (parameters
- '("const-char*" "desktop_id")
- )
-)
-
-(define-method get_is_hidden
- (of-object "GDesktopAppInfo")
- (c-name "g_desktop_app_info_get_is_hidden")
- (return-type "gboolean")
-)
-
-(define-function desktop_app_info_set_desktop_env
- (c-name "g_desktop_app_info_set_desktop_env")
- (return-type "none")
- (parameters
- '("const-char*" "desktop_env")
- )
-)
-
-
-
;; From gunixfdmessage.h
(define-function g_unix_fd_message_get_type
--- a/gio/unix.override
+++ b/gio/unix.override
@@ -24,7 +24,6 @@
#define NO_IMPORT_PYGOBJECT
#include <pygobject.h>
#include <gio/gio.h>
-#include <gio/gdesktopappinfo.h>
#include <gio/gunixinputstream.h>
#include <gio/gunixmounts.h>
#include <gio/gunixoutputstream.h>

View File

@@ -0,0 +1,99 @@
{
lib,
stdenv,
fetchurl,
fetchpatch,
python,
pkg-config,
gtk2,
pygobject2,
pycairo,
pango,
buildPythonPackage,
isPy3k,
}:
buildPythonPackage rec {
pname = "pygtk";
outputs = [
"out"
"dev"
];
version = "2.24.0";
format = "other";
disabled = isPy3k;
src = fetchurl {
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.bz2";
sha256 = "04k942gn8vl95kwf0qskkv6npclfm31d78ljkrkgyqxxcni1w76d";
};
patches = [
# https://bugzilla.gnome.org/show_bug.cgi?id=660216 - fixes some memory leaks
(fetchpatch {
url = "https://gitlab.gnome.org/Archive/pygtk/commit/eca72baa5616fbe4dbebea43c7e5940847dc5ab8.diff";
sha256 = "031px4w5cshcx1sns430sdbr2i007b9zyb2carb3z65nzr77dpdd";
})
(fetchpatch {
url = "https://gitlab.gnome.org/Archive/pygtk/commit/4aaa48eb80c6802aec6d03e5695d2a0ff20e0fc2.patch";
sha256 = "0z8cg7nr3qki8gg8alasdzzyxcihfjlxn518glq5ajglk3q5pzsn";
})
];
nativeBuildInputs = [ pkg-config ];
buildInputs = [
pango
];
propagatedBuildInputs = [
gtk2
pygobject2
pycairo
];
configurePhase = "configurePhase";
buildPhase = "buildPhase";
env.NIX_CFLAGS_COMPILE =
lib.optionalString stdenv.hostPlatform.isDarwin "-ObjC"
+ lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) " -lpython2.7"
+ " -fpermissive"; # downgrade code errors to warnings
installPhase = "installPhase";
checkPhase = ''
sed -i -e "s/glade = importModule('gtk.glade', buildDir)//" \
tests/common.py
sed -i -e "s/, glade$//" \
-e "s/.*testGlade.*//" \
-e "s/.*(glade.*//" \
tests/test_api.py
''
+ ''
sed -i -e "s/sys.path.insert(0, os.path.join(buildDir, 'gtk'))//" \
-e "s/sys.path.insert(0, buildDir)//" \
tests/common.py
make check
'';
# XXX: TypeError: Unsupported type: <class 'gtk._gtk.WindowType'>
# The check phase was not executed in the previous
# non-buildPythonPackage setup - not sure why not.
doCheck = false;
postInstall = ''
rm $out/bin/pygtk-codegen-2.0
ln -s ${pygobject2}/bin/pygobject-codegen-2.0 $out/bin/pygtk-codegen-2.0
ln -s ${pygobject2}/${python.sitePackages}/pygobject-${pygobject2.version}.pth \
$out/${python.sitePackages}/${pname}-${version}.pth
'';
meta = with lib; {
description = "GTK 2 Python bindings";
homepage = "https://gitlab.gnome.org/Archive/pygtk";
platforms = platforms.all;
license = with licenses; [ lgpl21Plus ];
maintainers = with lib.maintainers; [ bryango ];
};
}

View File

@@ -0,0 +1,49 @@
{
buildPythonPackage,
fetchFromGitHub,
lib,
# since this is a dependency of pytest, we need to avoid
# circular dependencies
jinja2,
railroad-diagrams,
}:
let
pyparsing = buildPythonPackage rec {
pname = "pyparsing";
version = "2.4.7";
format = "setuptools";
src = fetchFromGitHub {
owner = "pyparsing";
repo = pname;
rev = "pyparsing_${version}";
sha256 = "14pfy80q2flgzjcx8jkracvnxxnr59kjzp3kdm5nh232gk1v6g6h";
};
# circular dependencies if enabled by default
doCheck = false;
nativeCheckInputs = [
jinja2
railroad-diagrams
];
checkPhase = ''
python -m unittest
'';
passthru.tests = {
check = pyparsing.overridePythonAttrs (_: {
doCheck = true;
});
};
meta = with lib; {
homepage = "https://github.com/pyparsing/pyparsing";
description = "Alternative approach to creating and executing simple grammars, vs. the traditional lex/yacc approach, or the use of regular expressions";
license = licenses.mit;
};
};
in
pyparsing

View File

@@ -0,0 +1,59 @@
{
lib,
fetchPypi,
buildPythonPackage,
execnet,
pytest,
setuptools-scm,
pytest-forked,
filelock,
psutil,
six,
isPy3k,
}:
buildPythonPackage rec {
pname = "pytest-xdist";
version = "1.34.0";
format = "setuptools";
src = fetchPypi {
inherit pname version;
sha256 = "1vh4ps32lp5ignch5adbl3pgchvigdfmrl6qpmhxih54wa1qw3il";
};
nativeBuildInputs = [
setuptools-scm
pytest
];
nativeCheckInputs = [
pytest
filelock
];
propagatedBuildInputs = [
execnet
pytest-forked
psutil
six
];
# Encountered a memory leak
# https://github.com/pytest-dev/pytest-xdist/issues/462
doCheck = !isPy3k;
checkPhase = ''
# Excluded tests access file system
py.test testing -k "not test_distribution_rsyncdirs_example \
and not test_rsync_popen_with_path \
and not test_popen_rsync_subdir \
and not test_init_rsync_roots \
and not test_rsyncignore"
'';
meta = with lib; {
description = "py.test xdist plugin for distributed testing and loop-on-failing modes";
homepage = "https://github.com/pytest-dev/pytest-xdist";
license = licenses.mit;
maintainers = with maintainers; [ dotlambda ];
};
}

View File

@@ -0,0 +1,105 @@
{
lib,
buildPythonPackage,
pythonOlder,
fetchPypi,
attrs,
hypothesis,
py,
setuptools-scm,
setuptools,
six,
pluggy,
funcsigs,
isPy3k,
more-itertools,
atomicwrites,
mock,
writeText,
pathlib2,
wcwidth,
packaging,
isPyPy,
}:
buildPythonPackage rec {
version = "4.6.11";
format = "setuptools";
pname = "pytest";
src = fetchPypi {
inherit pname version;
sha256 = "50fa82392f2120cc3ec2ca0a75ee615be4c479e66669789771f1758332be4353";
};
postPatch = ''
substituteInPlace setup.py \
--replace "pluggy>=0.12,<1.0" "pluggy>=0.12,<2.0"
'';
nativeCheckInputs = [
hypothesis
mock
];
buildInputs = [ setuptools-scm ];
propagatedBuildInputs = [
attrs
py
setuptools
six
pluggy
more-itertools
atomicwrites
wcwidth
packaging
]
++ lib.optionals (!isPy3k) [ funcsigs ]
++ lib.optionals (pythonOlder "3.6") [ pathlib2 ];
doCheck = !isPyPy; # https://github.com/pytest-dev/pytest/issues/3460
checkPhase = ''
runHook preCheck
# don't test bash builtins
rm testing/test_argcomplete.py
# determinism - this test writes non deterministic bytecode
rm -rf testing/test_assertrewrite.py
PYTHONDONTWRITEBYTECODE=1 $out/bin/py.test -x testing/ -k "not test_collect_pyargs_with_testpaths"
runHook postCheck
'';
# Remove .pytest_cache when using py.test in a Nix build
setupHook = writeText "pytest-hook" ''
pytestcachePhase() {
find $out -name .pytest_cache -type d -exec rm -rf {} +
}
appendToVar preDistPhases pytestcachePhase
# pytest generates it's own bytecode files to improve assertion messages.
# These files similar to cpython's bytecode files but are never laoded
# by python interpreter directly. We remove them for a few reasons:
# - files are non-deterministic: https://github.com/NixOS/nixpkgs/issues/139292
# (file headers are generatedt by pytest directly and contain timestamps)
# - files are not needed after tests are finished
pytestRemoveBytecodePhase () {
# suffix is defined at:
# https://github.com/pytest-dev/pytest/blob/4.6.11/src/_pytest/assertion/rewrite.py#L32-L47
find $out -name "*-PYTEST.py[co]" -delete
}
appendToVar preDistPhases pytestRemoveBytecodePhase
'';
meta = with lib; {
homepage = "https://docs.pytest.org";
description = "Framework for writing tests";
maintainers = with maintainers; [
lovek323
madjar
lsix
];
license = licenses.mit;
platforms = platforms.unix;
};
}

View File

@@ -0,0 +1,28 @@
diff --git a/scandir.py b/scandir.py
index 3f602fb..40af3e5 100644
--- a/scandir.py
+++ b/scandir.py
@@ -23,6 +23,7 @@ from os import listdir, lstat, stat, strerror
from os.path import join, islink
from stat import S_IFDIR, S_IFLNK, S_IFREG
import collections
+import platform
import sys
try:
@@ -432,6 +433,15 @@ elif sys.platform.startswith(('linux', 'darwin', 'sunos5')) or 'bsd' in sys.plat
('__d_padding', ctypes.c_uint8 * 4),
('d_name', ctypes.c_char * 256),
)
+ elif 'darwin' in sys.platform and 'arm64' in platform.machine():
+ _fields_ = (
+ ('d_ino', ctypes.c_uint64),
+ ('d_off', ctypes.c_uint64),
+ ('d_reclen', ctypes.c_uint16),
+ ('d_namlen', ctypes.c_uint16),
+ ('d_type', ctypes.c_uint8),
+ ('d_name', ctypes.c_char * 1024),
+ )
else:
_fields_ = (
('d_ino', ctypes.c_uint32), # must be uint32, not ulong

View File

@@ -0,0 +1,30 @@
{
lib,
python,
buildPythonPackage,
fetchPypi,
}:
buildPythonPackage rec {
pname = "scandir";
version = "1.10.0";
format = "setuptools";
src = fetchPypi {
inherit pname version;
sha256 = "1bkqwmf056pkchf05ywbnf659wqlp6lljcdb0y88wr9f0vv32ijd";
};
patches = [
./add-aarch64-darwin-dirent.patch
];
checkPhase = "${python.interpreter} test/run_tests.py";
meta = with lib; {
description = "Better directory iterator and faster os.walk()";
homepage = "https://github.com/benhoyt/scandir";
license = licenses.gpl3;
maintainers = [ ];
};
}

View File

@@ -0,0 +1,30 @@
{
lib,
buildPythonPackage,
fetchPypi,
toml,
}:
buildPythonPackage rec {
pname = "setuptools_scm";
version = "5.0.2";
format = "setuptools";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-g6DO3TRJ45RjB4EaTHudicS1/UZKL7XuzNCluxWK5cg=";
};
propagatedBuildInputs = [ toml ];
# Requires pytest, circular dependency
doCheck = false;
pythonImportsCheck = [ "setuptools_scm" ];
meta = with lib; {
homepage = "https://github.com/pypa/setuptools_scm/";
description = "Handles managing your python package versions in scm metadata";
license = licenses.mit;
maintainers = [ ];
};
}

View File

@@ -0,0 +1,88 @@
{
stdenv,
buildPythonPackage,
fetchFromGitHub,
python,
bootstrapped-pip,
lib,
pipInstallHook,
setuptoolsBuildHook,
}:
let
pname = "setuptools";
version = "44.0.0";
# Create an sdist of setuptools
sdist = stdenv.mkDerivation rec {
name = "${pname}-${version}-sdist.tar.gz";
src = fetchFromGitHub {
owner = "pypa";
repo = pname;
rev = "v${version}";
sha256 = "0z3q0qinyp1rmnxkw3y5f6nbsxhqlfq5k7skfrqa6ymb3zr009y1";
name = "${pname}-${version}-source";
};
patches = [
./tag-date.patch
];
buildPhase = ''
${python.pythonOnBuildForHost.interpreter} bootstrap.py
${python.pythonOnBuildForHost.interpreter} setup.py sdist --formats=gztar
# Here we untar the sdist and retar it in order to control the timestamps
# of all the files included
tar -xzf dist/${pname}-${version}.post0.tar.gz -C dist/
tar -czf dist/${name} -C dist/ --mtime="@$SOURCE_DATE_EPOCH" ${pname}-${version}.post0
'';
installPhase = ''
echo "Moving sdist..."
mv dist/${name} $out
'';
};
in
buildPythonPackage {
inherit pname version;
# Because of bootstrapping we don't use the setuptoolsBuildHook that comes with format="setuptools" directly.
# Instead, we override it to remove setuptools to avoid a circular dependency.
# The same is done for pip and the pipInstallHook.
format = "other";
src = sdist;
nativeBuildInputs = [
bootstrapped-pip
(pipInstallHook.override { pip = null; })
(setuptoolsBuildHook.override {
setuptools = null;
wheel = null;
})
];
preBuild = lib.optionalString (!stdenv.hostPlatform.isWindows) ''
export SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES=0
'';
pipInstallFlags = [ "--ignore-installed" ];
# Adds setuptools to nativeBuildInputs causing infinite recursion.
catchConflicts = false;
# Requires pytest, causing infinite recursion.
doCheck = false;
meta = with lib; {
description = "Utilities to facilitate the installation of Python packages";
homepage = "https://pypi.python.org/pypi/setuptools";
license = with licenses; [
psfl
zpl20
];
platforms = python.meta.platforms;
priority = 10;
};
}

View File

@@ -0,0 +1,12 @@
diff --git a/setup.cfg b/setup.cfg
index f23714b6..8aaeb330 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,6 +1,6 @@
[egg_info]
tag_build = .post
-tag_date = 1
+tag_date = 0
[aliases]
clean_egg_info = egg_info -Db ''

View File

@@ -0,0 +1,45 @@
{
lib,
buildPythonPackage,
fetchPypi,
pythonOlder,
isPy3k,
isPyPy,
unittestCheckHook,
pythonAtLeast,
}:
let
testDir = if isPy3k then "src" else "python2";
in
buildPythonPackage rec {
pname = "typing";
version = "3.10.0.0";
format = "setuptools";
src = fetchPypi {
inherit pname version;
sha256 = "13b4ad211f54ddbf93e5901a9967b1e07720c1d1b78d596ac6a439641aa1b130";
};
disabled = pythonAtLeast "3.5";
# Error for Python3.6: ImportError: cannot import name 'ann_module'
# See https://github.com/python/typing/pull/280
# Also, don't bother on PyPy: AssertionError: TypeError not raised
doCheck = pythonOlder "3.6" && !isPyPy;
nativeCheckInputs = [ unittestCheckHook ];
unittestFlagsArray = [
"-s"
testDir
];
meta = with lib; {
description = "Backport of typing module to Python versions older than 3.5";
homepage = "https://docs.python.org/3/library/typing.html";
license = licenses.psfl;
};
}

View File

@@ -0,0 +1,27 @@
{
backports-functools-lru-cache,
wcwidth,
lib,
}:
wcwidth.overridePythonAttrs (oldAttrs: {
propagatedBuildInputs = oldAttrs.propagatedBuildInputs or [ ] ++ [
backports-functools-lru-cache
];
/**
As of version 0.2.13 upstream still supports python2. In the future, this
package should be dropped or pinned to the last working version after the
final release for python2. See:
https://github.com/jquast/wcwidth/pull/117#issuecomment-1946609638
*/
disabled = false;
meta = oldAttrs.meta // {
/**
maintainers overridden here for python2; this makes sure that python3
maintainers are not blamed for the breakage here.
*/
maintainers = with lib.maintainers; [ bryango ];
};
})

View File

@@ -0,0 +1,37 @@
From 5879a4bbc34d1eb25e160b15b2f5a4f10eac6bd2 Mon Sep 17 00:00:00 2001
From: toonn <toonn@toonn.io>
Date: Mon, 13 Sep 2021 18:07:26 +0200
Subject: [PATCH] =?UTF-8?q?tests:=20Rename=20a=CC=8Aa=CC=88o=CC=88=5F?=
=?UTF-8?q?=E6=97=A5=E6=9C=AC=E8=AA=9E.py=20=3D>=20=C3=A6=C9=90=C3=B8=5F?=
=?UTF-8?q?=E6=97=A5=E6=9C=AC=E5=83=B9.py?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
`åäö_日本語.py` normalizes differently in NFC and NFD normal forms. This
means a hash generated for the source directory can differ depending on
whether or not the filesystem is normalizing and which normal form it
uses.
By renaming the file to `æɐø_日本價.py` we avoid this issue by using a
name that has the same encoding in each normal form.
---
tests/test_bdist_wheel.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/test_bdist_wheel.py b/tests/test_bdist_wheel.py
index 651c034..9b94ac8 100644
--- a/tests/test_bdist_wheel.py
+++ b/tests/test_bdist_wheel.py
@@ -58,7 +58,7 @@ def test_unicode_record(wheel_paths):
with ZipFile(path) as zf:
record = zf.read('unicode.dist-0.1.dist-info/RECORD')
- assert u'åäö_日本語.py'.encode('utf-8') in record
+ assert u'æɐø_日本價.py'.encode('utf-8') in record
def test_licenses_default(dummy_dist, monkeypatch, tmpdir):
--
2.17.2 (Apple Git-113)

View File

@@ -0,0 +1,58 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
bootstrapped-pip,
setuptools,
}:
buildPythonPackage rec {
pname = "wheel";
version = "0.37.1";
format = "other";
src = fetchFromGitHub {
owner = "pypa";
repo = pname;
rev = version;
sha256 = "sha256-JlTmUPY3yo/uROyd3nW1dJa23zbLhgQTwcmqZkPOrHs=";
name = "${pname}-${version}-source";
postFetch = ''
cd $out
mv tests/testdata/unicode.dist/unicodedist/åäö_.py \
tests/testdata/unicode.dist/unicodedist/æɐø_.py
patch -p1 < ${./0001-tests-Rename-a-a-o-_-.py-_-.py.patch}
'';
};
nativeBuildInputs = [
bootstrapped-pip
setuptools
];
# No tests in archive
doCheck = false;
pythonImportsCheck = [ "wheel" ];
# We add this flag to ignore the copy installed by bootstrapped-pip
pipInstallFlags = [ "--ignore-installed" ];
meta = with lib; {
homepage = "https://github.com/pypa/wheel";
description = "Built-package format for Python";
longDescription = ''
This library is the reference implementation of the Python wheel packaging standard,
as defined in PEP 427.
It has two different roles:
- A setuptools extension for building wheels that provides the bdist_wheel setuptools command
- A command line tool for working with wheel files
It should be noted that wheel is not intended to be used as a library,
and as such there is no stable, public API.
'';
license = with licenses; [ mit ];
maintainers = with maintainers; [ siriobalmelli ];
};
}

View File

@@ -0,0 +1,42 @@
{
lib,
buildPythonPackage,
fetchPypi,
setuptools-scm,
pytest,
pytest-flake8,
more-itertools,
}:
buildPythonPackage rec {
pname = "zipp";
version = "1.0.0";
format = "setuptools";
src = fetchPypi {
inherit pname version;
sha256 = "0v3qayhqv7vyzydpydwcp51bqciw8p2ajddw68x5k8zppc0vx3yk";
};
nativeBuildInputs = [ setuptools-scm ];
propagatedBuildInputs = [ more-itertools ];
nativeCheckInputs = [
pytest
pytest-flake8
];
checkPhase = ''
pytest
'';
# Prevent infinite recursion with pytest
doCheck = false;
meta = with lib; {
description = "Pathlib-compatible object wrapper for zip files";
homepage = "https://github.com/jaraco/zipp";
license = licenses.mit;
};
}