diff options
author | Michał Górny <mgorny@gentoo.org> | 2024-02-26 15:12:47 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2024-02-26 15:12:47 +0100 |
commit | 33b98fef3e5f0c0e82b6262df4dfdd94499db1f9 (patch) | |
tree | 0de83feb8811d7730293feda09f17ce86886aebd /dev-python | |
parent | dev-python/segno: Remove old (diff) | |
download | gentoo-33b98fef3e5f0c0e82b6262df4dfdd94499db1f9.tar.gz gentoo-33b98fef3e5f0c0e82b6262df4dfdd94499db1f9.tar.bz2 gentoo-33b98fef3e5f0c0e82b6262df4dfdd94499db1f9.zip |
dev-python/setuptools-gettext: Remove old
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python')
4 files changed, 0 insertions, 204 deletions
diff --git a/dev-python/setuptools-gettext/Manifest b/dev-python/setuptools-gettext/Manifest index 63dae90cd46a..bf75bb7c26b2 100644 --- a/dev-python/setuptools-gettext/Manifest +++ b/dev-python/setuptools-gettext/Manifest @@ -1,3 +1 @@ DIST setuptools-gettext-0.1.11.tar.gz 15582 BLAKE2B a47e8c05683dbf8ac2db9dcbf66f8d680a6d1788ee00f1affcc356fd12ee31d92f6698c9dd1f293000ffb129d6eda2a71b90d0bee1875308f155137c9d2f7cf2 SHA512 abcb0df4604a78959365d3447112d4f74944b26ccc1e0d43771e38ee071c5915a4deda8c852eebbc58c689bcae29cd13604f8b96cea4cc0d6eb6ca4e265e34f7 -DIST setuptools-gettext-0.1.8.tar.gz 15548 BLAKE2B 4e1dcd219fca132e859a44e7ab86f0c81ac2dfccf5d2aca89ac05a2a3a50fec715a5e23e44173e741330d874d1f721ac8ec9d73d79b586ab605fb281aba8aafe SHA512 55b6512061565f210596972db3033d3d4f555428d23d1cac93feb3ea540461e908585d13157bcf97335f07b5a86e0b823b15457fe2f107ffc49e2e1b0c7a0c1e -DIST setuptools-gettext-0.1.9.tar.gz 14490 BLAKE2B a233bb41124d2e927adc24aace620e7c9cd1dfd6e0a2f39343f2d9aaded434f87f2c106ddc19446cc9f4ebf39940091a93fc1375db22c8988e63425e3a5ebdde SHA512 7995c6b980429fba69aa6da2451d1cafb5035bdc02820c6ef729683d0689df594bd66a69fe142cf9f0f70f26858414a30cd9050180f9f1fdf8e81ea53bfcbbda diff --git a/dev-python/setuptools-gettext/files/setuptools-gettext-0.1.8-wheel.patch b/dev-python/setuptools-gettext/files/setuptools-gettext-0.1.8-wheel.patch deleted file mode 100644 index aab0158cd698..000000000000 --- a/dev-python/setuptools-gettext/files/setuptools-gettext-0.1.8-wheel.patch +++ /dev/null @@ -1,123 +0,0 @@ -From a793c1d9938da1c7c962feff13dc948523fcc774 Mon Sep 17 00:00:00 2001 -From: Eli Schwartz <eschwartz93@gmail.com> -Date: Sat, 16 Dec 2023 21:53:38 -0500 -Subject: [PATCH] fix critical existence failure of install_mo - -In commit d28f5fa57eef7fa9baa28dea119b45e74145ecb5 the self.root was -added, and we ended up with this directory repeated twice and bogus -installed files - -When building a wheel, the value of self.root is internally implemented -by bdist_wheel as (build/bdist.linux-x86_64/wheel); the resulting wheel -placed files in random locations inside of the installed site-packages -directory. - -When running `python setup.py install --root=$DESTDIR`, the value of -self.root is of course `$DESTDIR`, leading to installed files that got -installed to the staging install directory, e.g. the resulting .deb file -would attempt to install files to -``` -/home/$USERNAME/projects/foobar/debian/tmp/usr/share/locale -``` -during an `apt install`. - -This is incorrect use of the setuptools API, as witnessed in -install_data which does the same task correctly: - -``` -if not os.path.isabs(dir): - dir = os.path.join(self.install_dir, dir) -elif self.root: - dir = change_root(self.root, dir) -``` - -Rather than continuing to copy-paste code around, inherit correctly from -the existing class. Update the data_files attribute of the new -install_mo implementation, and use that to drive the installation of -files using the same battle-tested logic used by `setup(data_files=[])`. - -Fixes #30 ---- - setuptools_gettext/__init__.py | 43 +++++++--------------------------- - 1 file changed, 8 insertions(+), 35 deletions(-) - -diff --git a/setuptools_gettext/__init__.py b/setuptools_gettext/__init__.py -index dc4ae73..59769b4 100644 ---- a/setuptools_gettext/__init__.py -+++ b/setuptools_gettext/__init__.py -@@ -26,6 +26,7 @@ - import sys - from typing import List, Optional, Tuple - -+from distutils.command.install_data import install_data - from setuptools import Command - from setuptools.dist import Distribution - -@@ -165,41 +166,19 @@ def run(self): - os.unlink(os.path.join(root, file_)) - - --class install_mo(Command): -+class install_mo(install_data): - - description: str = "install .mo files" - -- user_options = [ -- ( -- 'install-dir=', -- 'd', -- "base directory for installing data files " -- "(default: installation base dir)", -- ), -- ('root=', None, -- "install everything relative to this alternate root directory"), -- ('force', 'f', "force installation (overwrite existing files)"), -- ] -- -- boolean_options: List[str] = ['force'] - build_dir: Optional[str] -- install_dir: Optional[str] -- root: Optional[str] - - def initialize_options(self) -> None: -- self.install_dir = None -- self.outfiles: List[str] = [] -- self.root = None -- self.force = 0 -+ super().initialize_options() -+ self.data_files: List[str] = [] - self.build_dir = None - - def finalize_options(self) -> None: -- self.set_undefined_options( -- 'install', -- ('install_data', 'install_dir'), -- ('root', 'root'), -- ('force', 'force'), -- ) -+ super().finalize_options() - if self.build_dir is None: - self.build_dir = ( - self.distribution.gettext_build_dir) # type: ignore -@@ -207,18 +186,12 @@ def finalize_options(self) -> None: - def run(self) -> None: - assert self.install_dir is not None - assert self.build_dir is not None -- self.mkpath(self.install_dir) - import glob - for filepath in glob.glob(self.build_dir + "/*/LC_MESSAGES/*.mo"): - langfile = filepath[len(self.build_dir.rstrip('/')+'/'):] -- targetpath = os.path.join( -- self.install_dir, -- os.path.dirname(os.path.join("share/locale", langfile))) -- if self.root is not None: -- targetpath = change_root(self.root, targetpath) -- self.mkpath(targetpath) -- (out, _) = self.copy_file(filepath, targetpath) -- self.outfiles.append(out) -+ install_dir = os.path.dirname(os.path.join("share/locale", langfile)) -+ self.data_files.append((install_dir, [filepath])) -+ super().run() - - def get_inputs(self): - import glob diff --git a/dev-python/setuptools-gettext/setuptools-gettext-0.1.8-r1.ebuild b/dev-python/setuptools-gettext/setuptools-gettext-0.1.8-r1.ebuild deleted file mode 100644 index e02ba96a24c3..000000000000 --- a/dev-python/setuptools-gettext/setuptools-gettext-0.1.8-r1.ebuild +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_USE_PEP517=setuptools -PYPI_NO_NORMALIZE=1 -PYTHON_COMPAT=( python3_{10..12} ) - -inherit distutils-r1 pypi - -DESCRIPTION="Setuptools plugin for building mo files" -HOMEPAGE=" - https://pypi.org/project/setuptools-gettext/ - https://github.com/breezy-team/setuptools-gettext -" - -LICENSE="GPL-2+" -SLOT="0" -KEYWORDS="~amd64 ~arm64 ~x86" - -RDEPEND=" - dev-python/setuptools[${PYTHON_USEDEP}] - sys-devel/gettext - $(python_gen_cond_dep ' - >=dev-python/tomli-1.2.1[${PYTHON_USEDEP}] - ' 3.10) -" - -PATCHES=( - # https://github.com/breezy-team/setuptools-gettext/pull/31 - "${FILESDIR}/${P}-wheel.patch" -) - -python_test() { - cd example || die - distutils_pep517_install "${T}/${EPYTHON}" - if [[ ! -f ${T}/${EPYTHON}/usr/share/locale/nl/LC_MESSAGES/hallowereld.mo ]] - then - die ".mo file not installed" - fi -} diff --git a/dev-python/setuptools-gettext/setuptools-gettext-0.1.9.ebuild b/dev-python/setuptools-gettext/setuptools-gettext-0.1.9.ebuild deleted file mode 100644 index f984938a417c..000000000000 --- a/dev-python/setuptools-gettext/setuptools-gettext-0.1.9.ebuild +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2023-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_USE_PEP517=setuptools -PYPI_NO_NORMALIZE=1 -PYTHON_COMPAT=( python3_{10..12} ) - -inherit distutils-r1 pypi - -DESCRIPTION="Setuptools plugin for building mo files" -HOMEPAGE=" - https://pypi.org/project/setuptools-gettext/ - https://github.com/breezy-team/setuptools-gettext -" - -LICENSE="GPL-2+" -SLOT="0" -KEYWORDS="~amd64 ~arm64 ~x86" - -RDEPEND=" - dev-python/setuptools[${PYTHON_USEDEP}] - sys-devel/gettext - $(python_gen_cond_dep ' - >=dev-python/tomli-1.2.1[${PYTHON_USEDEP}] - ' 3.10) -" - -python_test() { - cd example || die - distutils_pep517_install "${T}/${EPYTHON}" - if [[ ! -f ${T}/${EPYTHON}/usr/share/locale/nl/LC_MESSAGES/hallowereld.mo ]] - then - die ".mo file not installed" - fi -} |