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,72 @@
{
lib,
asttokens,
buildPythonPackage,
executing,
hatchling,
fetchFromGitHub,
pygments,
pytest-mock,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "devtools";
version = "0.12.2";
pyproject = true;
src = fetchFromGitHub {
owner = "samuelcolvin";
repo = "python-${pname}";
tag = "v${version}";
hash = "sha256-1HFbNswdKa/9cQX0Gf6lLW1V5Kt/N4X6/5kQDdzp1Wo=";
};
patches = [
# https://github.com/samuelcolvin/python-devtools/pull/166
./fix-test-ast-expr.patch
];
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail 'asttokens>=2.0.0,<3.0.0' 'asttokens>=2.0.0' \
'';
build-system = [ hatchling ];
dependencies = [
asttokens
executing
pygments
];
nativeCheckInputs = [
pytestCheckHook
pytest-mock
];
disabledTests = [
# Test for Windows32
"test_print_subprocess"
# Sensitive to timing
"test_multiple_not_verbose"
# Sensitive to interpreter output
"test_simple"
"test_expr_render"
];
disabledTestPaths = [
# pytester_pretty is not available in Nixpkgs
"tests/test_insert_assert.py"
];
pythonImportsCheck = [ "devtools" ];
meta = with lib; {
description = "Python's missing debug print command and other development tools";
homepage = "https://python-devtools.helpmanual.io/";
changelog = "https://github.com/samuelcolvin/python-devtools/releases/tag/${src.tag}";
license = licenses.mit;
maintainers = with maintainers; [ jdahm ];
};
}

View File

@@ -0,0 +1,44 @@
From 7a95b33f8fe9b2d426c2680291ccbae2e973faa0 Mon Sep 17 00:00:00 2001
From: Tom Hunze <dev@thunze.de>
Date: Sun, 4 May 2025 00:49:57 +0200
Subject: [PATCH] Fix `test_ast_expr` for Python 3.13
---
tests/test_prettier.py | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/tests/test_prettier.py b/tests/test_prettier.py
index 298dc58..0f24756 100644
--- a/tests/test_prettier.py
+++ b/tests/test_prettier.py
@@ -486,6 +486,7 @@ class User(SQLAlchemyBase):
@pytest.mark.skipif(sys.version_info < (3, 9), reason='no indent on older versions')
+@pytest.mark.skipif(sys.version_info >= (3, 13), reason='show_empty=False on newer versions')
def test_ast_expr():
assert pformat(ast.parse('print(1, 2, round(3))', mode='eval')) == (
"Expression("
@@ -503,6 +504,22 @@ def test_ast_expr():
)
+@pytest.mark.skipif(sys.version_info < (3, 13), reason='no show_empty on older versions')
+def test_ast_expr_show_empty():
+ assert pformat(ast.parse('print(1, 2, round(3))', mode='eval')) == (
+ "Expression("
+ "\n body=Call("
+ "\n func=Name(id='print', ctx=Load()),"
+ "\n args=["
+ "\n Constant(value=1),"
+ "\n Constant(value=2),"
+ "\n Call("
+ "\n func=Name(id='round', ctx=Load()),"
+ "\n args=["
+ "\n Constant(value=3)])]))"
+ )
+
+
@pytest.mark.skipif(sys.version_info < (3, 9), reason='no indent on older versions')
def test_ast_module():
assert pformat(ast.parse('print(1, 2, round(3))')).startswith('Module(\n body=[')