python313Packages.flit: 3.9.0 -> 3.10.0

https://github.com/pypa/flit/blob/3.10.0/doc/history.rst
This commit is contained in:
Martin Weinelt
2024-11-18 18:36:41 +01:00
parent 987b804367
commit 53a6655f72
2 changed files with 15 additions and 53 deletions
@@ -2,13 +2,20 @@
lib,
buildPythonPackage,
fetchFromGitHub,
# build-system
flit-core,
# dependencies
docutils,
pip,
requests,
tomli-w,
# tests
pytestCheckHook,
testpath,
responses,
flit-core,
tomli-w,
}:
# Flit is actually an application to build universal wheels.
@@ -18,27 +25,23 @@
buildPythonPackage rec {
pname = "flit";
version = "3.9.0";
version = "3.10.0";
format = "pyproject";
src = fetchFromGitHub {
owner = "takluyver";
repo = "flit";
rev = version;
hash = "sha256-yl2+PcKr7xRW4oIBWl+gzh/nKhSNu5GH9fWKRGgaNHU=";
hash = "sha256-4JMoK1UxYcHoSvKDF7Yn4iqMXokyCPCswQknK0a070k=";
};
patches = [
# https://github.com/pypa/flit/commit/6ab62c91d0db451b5e9ab000f0dba5471550b442.patch
./python314-compat.patch
];
build-system = [ flit-core ];
nativeBuildInputs = [ flit-core ];
propagatedBuildInputs = [
dependencies = [
docutils
requests
flit-core
pip
requests
tomli-w
];
@@ -1,41 +0,0 @@
From 6ab62c91d0db451b5e9ab000f0dba5471550b442 Mon Sep 17 00:00:00 2001
From: Thomas A Caswell <tcaswell@gmail.com>
Date: Tue, 28 May 2024 10:25:13 -0400
Subject: [PATCH] MNT: fix compatibility with Python 3.14
The ast.Str class was deprecated in 3.8 and will be removed in 3.14
---
flit_core/flit_core/common.py | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/flit_core/flit_core/common.py b/flit_core/flit_core/common.py
index 6625224b..8bcda3fb 100644
--- a/flit_core/flit_core/common.py
+++ b/flit_core/flit_core/common.py
@@ -148,6 +148,10 @@ def get_docstring_and_version_via_ast(target):
with target_path.open('rb') as f:
node = ast.parse(f.read())
for child in node.body:
+ if sys.version_info >= (3, 8):
+ target_type = ast.Constant
+ else:
+ target_type = ast.Str
# Only use the version from the given module if it's a simple
# string assignment to __version__
is_version_str = (
@@ -157,10 +161,13 @@ def get_docstring_and_version_via_ast(target):
and target.id == "__version__"
for target in child.targets
)
- and isinstance(child.value, ast.Str)
+ and isinstance(child.value, target_type)
)
if is_version_str:
- version = child.value.s
+ if sys.version_info >= (3, 8):
+ version = child.value.value
+ else:
+ version = child.value.s
break
return ast.get_docstring(node), version