Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/flit_core/files/, dev-python/flit_core/
Date: Wed, 23 Feb 2022 21:30:21
Message-Id: 1645651808.9ab08bfd9470c338cc42714a60af1f0fc84205dc.mgorny@gentoo
1 commit: 9ab08bfd9470c338cc42714a60af1f0fc84205dc
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 23 20:55:10 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 23 21:30:08 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9ab08bfd
7
8 dev-python/flit_core: Remove old
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/flit_core/Manifest | 1 -
13 ...e-3.7.0-fix-relative-imports-init-version.patch | 107 ---------------------
14 dev-python/flit_core/flit_core-3.7.0-r1.ebuild | 38 --------
15 3 files changed, 146 deletions(-)
16
17 diff --git a/dev-python/flit_core/Manifest b/dev-python/flit_core/Manifest
18 index 7096b6450862..c748767a964a 100644
19 --- a/dev-python/flit_core/Manifest
20 +++ b/dev-python/flit_core/Manifest
21 @@ -1,4 +1,3 @@
22 DIST flit_core-3.5.1.tar.gz 27497 BLAKE2B 0e47576a05afa306a17e0fe64bd48e4a141fa51df225365495692aeae1c693635f1ea13ba23fdd93543c9b152dcfc2424bd8101a544ad25be2c4561964a8a8bb SHA512 c83b5bd54ffdf2d7dbea340939cb5f0210ffd36aa0f61b02519837843ebbab206a2456a007f76cbae45c2133ef3d21949d1834083c8dddb505ed5bb127a5fdba
23 DIST flit_core-3.6.0.tar.gz 37534 BLAKE2B 7450dcddc0719e17b79b82a07fbfee3116ea9eface5cba8f7d6fa27011f6b20822f8f5c02633ac75456b30327328ef60e05e15ca78a26935dfac5a66e2538a1e SHA512 6a217a6e7d8c4f81491314987ff1510f1cede233213982d9f7b2705ab5b1a7fb4b337ad9daa5ff824ed00034ba1d53215d56def86909240d49265e628ffb83b2
24 -DIST flit_core-3.7.0.tar.gz 39892 BLAKE2B 19521ea85d72986dc532618bc13bd646178c10caf012bdae7a5a1d6a45d233228aaa16ac1096170bf88074272078202fa340e1d4aa88dd998868c730209e3060 SHA512 13059aeda4694a110a8777ddf13458723cec6ab9f8eeeff6ed237e7a1c2c1873128553d33e605704ef7b5ffc9438087f0f5cf52d9c3208fedafcecbe5ebfa67c
25 DIST flit_core-3.7.1.tar.gz 40330 BLAKE2B 67a938ef576a70ce1bfe1f1bf996f1d2e468ea46f76ed2a363b278cebc42602b38fbf44a6bc45294996549d673d3145e2db2293780b8d157fd4f3b3876dc88cd SHA512 8c477bcd2924a93b51e6f3d8bbc3599929663c8d5addf16062e8e1b6c5acd740a4e4905b144092efb6e38e9700479525013831a53e055438f94c1e53ff5c6f8d
26
27 diff --git a/dev-python/flit_core/files/flit_core-3.7.0-fix-relative-imports-init-version.patch b/dev-python/flit_core/files/flit_core-3.7.0-fix-relative-imports-init-version.patch
28 deleted file mode 100644
29 index 858e66aee0b0..000000000000
30 --- a/dev-python/flit_core/files/flit_core-3.7.0-fix-relative-imports-init-version.patch
31 +++ /dev/null
32 @@ -1,107 +0,0 @@
33 -https://github.com/pypa/flit/issues/530
34 -https://github.com/pypa/flit/pull/531
35 -
36 -From c7c79459b61fe11ff0179d0ca7a72e8a90c0ee7b Mon Sep 17 00:00:00 2001
37 -From: Thomas Kluyver <thomas@××××××××××.uk>
38 -Date: Tue, 22 Feb 2022 16:21:11 +0000
39 -Subject: [PATCH 1/2] Add failing test for issue gh-530
40 -
41 ----
42 - .../samples/imported_version/package1/__init__.py | 3 +++
43 - .../samples/imported_version/package1/_version.py | 1 +
44 - .../tests/samples/imported_version/pyproject.toml | 10 ++++++++++
45 - flit_core/flit_core/tests/test_common.py | 5 +++++
46 - 4 files changed, 19 insertions(+)
47 - create mode 100644 flit_core/flit_core/tests/samples/imported_version/package1/__init__.py
48 - create mode 100644 flit_core/flit_core/tests/samples/imported_version/package1/_version.py
49 - create mode 100644 flit_core/flit_core/tests/samples/imported_version/pyproject.toml
50 -
51 -diff --git a/flit_core/tests/samples/imported_version/package1/__init__.py b/flit_core/tests/samples/imported_version/package1/__init__.py
52 -new file mode 100644
53 -index 0000000..49adc42
54 ---- /dev/null
55 -+++ b/flit_core/tests/samples/imported_version/package1/__init__.py
56 -@@ -0,0 +1,3 @@
57 -+"""This module has a __version__ that requires a relative import"""
58 -+
59 -+from ._version import __version__
60 -diff --git a/flit_core/tests/samples/imported_version/package1/_version.py b/flit_core/tests/samples/imported_version/package1/_version.py
61 -new file mode 100644
62 -index 0000000..91201fc
63 ---- /dev/null
64 -+++ b/flit_core/tests/samples/imported_version/package1/_version.py
65 -@@ -0,0 +1 @@
66 -+__version__ = '0.5.8'
67 -diff --git a/flit_core/tests/samples/imported_version/pyproject.toml b/flit_core/tests/samples/imported_version/pyproject.toml
68 -new file mode 100644
69 -index 0000000..b6d44e1
70 ---- /dev/null
71 -+++ b/flit_core/tests/samples/imported_version/pyproject.toml
72 -@@ -0,0 +1,10 @@
73 -+[build-system]
74 -+requires = ["flit_core >=3.2,<4"]
75 -+build-backend = "flit_core.buildapi"
76 -+
77 -+[project]
78 -+name = "package1"
79 -+authors = [
80 -+ {name = "Sir Röbin", email = "robin@×××××××.uk"}
81 -+]
82 -+dynamic = ["version", "description"]
83 -diff --git a/flit_core/tests/test_common.py b/flit_core/tests/test_common.py
84 -index 02cfab7..bd0995b 100644
85 ---- a/flit_core/tests/test_common.py
86 -+++ b/flit_core/tests/test_common.py
87 -@@ -75,6 +75,11 @@ def test_get_info_from_module(self):
88 - 'version': '1.2.3'}
89 - )
90 -
91 -+ info = get_info_from_module(Module('package1', samples_dir / 'imported_version'))
92 -+ self.assertEqual(info, {'summary': 'This module has a __version__ that requires a relative import',
93 -+ 'version': '0.5.8'}
94 -+ )
95 -+
96 - with self.assertRaises(InvalidVersion):
97 - get_info_from_module(Module('invalid_version1', samples_dir))
98 -
99 -
100 -From 8a0ce8897a743dde3b82cca02f1d82516ad393fd Mon Sep 17 00:00:00 2001
101 -From: Thomas Kluyver <thomas@××××××××××.uk>
102 -Date: Tue, 22 Feb 2022 16:49:46 +0000
103 -Subject: [PATCH 2/2] Fix relative imports in __init__.py when exec-ing to get
104 - __version__
105 -
106 ----
107 - flit_core/flit_core/common.py | 11 ++++++++++-
108 - 1 file changed, 10 insertions(+), 1 deletion(-)
109 -
110 -diff --git a/flit_core/common.py b/flit_core/common.py
111 -index 0d6716c..ce69c95 100644
112 ---- a/flit_core/common.py
113 -+++ b/flit_core/common.py
114 -@@ -3,6 +3,7 @@
115 - import hashlib
116 - import logging
117 - import os
118 -+import sys
119 -
120 - from pathlib import Path
121 - import re
122 -@@ -168,7 +169,15 @@ def get_docstring_and_version_via_import(target):
123 - spec = spec_from_file_location(mod_name, target.file)
124 - with _module_load_ctx():
125 - m = module_from_spec(spec)
126 -- spec.loader.exec_module(m)
127 -+ # Add the module to sys.modules to allow relative imports to work.
128 -+ # importlib has more code around this to handle the case where two
129 -+ # threads are trying to load the same module at the same time, but Flit
130 -+ # should always be running a single thread, so we won't duplicate that.
131 -+ sys.modules[mod_name] = m
132 -+ try:
133 -+ spec.loader.exec_module(m)
134 -+ finally:
135 -+ sys.modules.pop(mod_name, None)
136 -
137 - docstring = m.__dict__.get('__doc__', None)
138 - version = m.__dict__.get('__version__', None)
139 -
140
141 diff --git a/dev-python/flit_core/flit_core-3.7.0-r1.ebuild b/dev-python/flit_core/flit_core-3.7.0-r1.ebuild
142 deleted file mode 100644
143 index 65fd6ed76f45..000000000000
144 --- a/dev-python/flit_core/flit_core-3.7.0-r1.ebuild
145 +++ /dev/null
146 @@ -1,38 +0,0 @@
147 -# Copyright 2019-2022 Gentoo Authors
148 -# Distributed under the terms of the GNU General Public License v2
149 -
150 -# please keep this ebuild at EAPI 7 -- sys-apps/portage dep
151 -EAPI=7
152 -
153 -DISTUTILS_USE_PEP517=standalone
154 -PYTHON_COMPAT=( python3_{8..10} pypy3 )
155 -inherit distutils-r1
156 -
157 -DESCRIPTION="Simplified packaging of Python modules (core module)"
158 -HOMEPAGE="
159 - https://pypi.org/project/flit_core/
160 - https://github.com/pypa/flit/"
161 -SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
162 -
163 -LICENSE="BSD"
164 -SLOT="0"
165 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
166 -
167 -RDEPEND="
168 - dev-python/tomli[${PYTHON_USEDEP}]
169 -"
170 -BDEPEND="
171 - test? ( dev-python/testpath[${PYTHON_USEDEP}] )
172 -"
173 -
174 -PATCHES=(
175 - "${FILESDIR}"/${P}-fix-relative-imports-init-version.patch
176 -)
177 -
178 -distutils_enable_tests pytest
179 -
180 -src_prepare() {
181 - rm -r flit_core/vendor || die
182 - sed -i -e 's:from \.vendor ::' flit_core/*.py || die
183 - distutils-r1_src_prepare
184 -}