From 5959c8510d12e770f9320c71e55b4419e49154ee Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 17 Dec 2023 14:57:38 +0000 Subject: gentoo auto-resync : 17:12:2023 - 14:57:38 --- dev-python/Manifest.gz | Bin 268376 -> 268533 bytes dev-python/colorful/Manifest | 3 + dev-python/colorful/colorful-0.5.5.ebuild | 41 +++++++ dev-python/colorful/metadata.xml | 25 +++++ dev-python/setuptools-gettext/Manifest | 3 +- .../files/setuptools-gettext-0.1.8-wheel.patch | 123 +++++++++++++++++++++ .../setuptools-gettext-0.1.8-r1.ebuild | 42 +++++++ .../setuptools-gettext-0.1.8.ebuild | 37 ------- 8 files changed, 236 insertions(+), 38 deletions(-) create mode 100644 dev-python/colorful/Manifest create mode 100644 dev-python/colorful/colorful-0.5.5.ebuild create mode 100644 dev-python/colorful/metadata.xml create mode 100644 dev-python/setuptools-gettext/files/setuptools-gettext-0.1.8-wheel.patch create mode 100644 dev-python/setuptools-gettext/setuptools-gettext-0.1.8-r1.ebuild delete mode 100644 dev-python/setuptools-gettext/setuptools-gettext-0.1.8.ebuild (limited to 'dev-python') diff --git a/dev-python/Manifest.gz b/dev-python/Manifest.gz index 4f37ff6b6713..e89655caa1dd 100644 Binary files a/dev-python/Manifest.gz and b/dev-python/Manifest.gz differ diff --git a/dev-python/colorful/Manifest b/dev-python/colorful/Manifest new file mode 100644 index 000000000000..6ce32b11c6a4 --- /dev/null +++ b/dev-python/colorful/Manifest @@ -0,0 +1,3 @@ +DIST colorful-0.5.5.gh.tar.gz 366498 BLAKE2B a7ab5dfb7ddfbf6682b75d2ed35f3f4cb7c3826918742316d877a17cb58e639b5fa86d7906be4879e89a5a0e78a16ede7535ade3f9f890c67bfcf42a0d1c9d9c SHA512 dc5e372261bd308a82bd0446a885b4c63a5a5781540731407f1a364d2c5397fe950f96fef3be8ffeab80cf02010be9551ba5b8550930e3fed5173cdc28a69306 +EBUILD colorful-0.5.5.ebuild 938 BLAKE2B 4278e1209cda1abdc590e37c1e760eef3c6ae06dda36ea8e21740a6c4d3a13727d4d6201205ae4cfec9e4115767e9e49c1bccb3f1590ebe5a0c53dc1021bfcba SHA512 34ce08bf61439b997229d5add59574699d5e43fd18dc69959e33c2a7c058846dd80460c817f86d8d1688d94856027dc0f06703c252da2aadcc02f74314477dea +MISC metadata.xml 828 BLAKE2B 68b782b4eca8e5c0bc591081526933afad4d81d53fb0af3d1b1edf0bb9df8ae59f6448da15fc82abe83906db8a76ea69b898d04767fd0d98730d0dafaf65c4c9 SHA512 4ffb104301f58d5ce9a9ea2614b74f1b3caf28f37f319738a9f1ddb1c1da4537b82c95de5fb7ba77a39c54ba96125d9d1b3dd11e0e98bc6b7c802e5cd5057339 diff --git a/dev-python/colorful/colorful-0.5.5.ebuild b/dev-python/colorful/colorful-0.5.5.ebuild new file mode 100644 index 000000000000..35e9e56ee19c --- /dev/null +++ b/dev-python/colorful/colorful-0.5.5.ebuild @@ -0,0 +1,41 @@ +# Copyright 2019-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{10..12} pypy3 ) + +inherit distutils-r1 + +DESCRIPTION="Terminal string styling done right, in Python" +HOMEPAGE=" + https://pypi.org/project/colorful/ + https://github.com/timofurrer/colorful/ +" +SRC_URI=" + https://github.com/timofurrer/colorful/archive/v${PV}.tar.gz + -> ${P}.gh.tar.gz +" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +distutils_enable_tests pytest + +src_prepare() { + # Fix QA_issue python package discovery + # https://github.com/timofurrer/colorful/pull/53 + sed -i \ + -e "s/find_packages/find_namespace_packages/" \ + -e "s/(exclude=\['\*tests\*'\])/(exclude=\['\*tests\*'\, '\*examples\*'\])/" \ + setup.py || die "Error fixing setup.py for >=PEP420" + + distutils-r1_src_prepare +} + +python_test() { + local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 + epytest -s +} diff --git a/dev-python/colorful/metadata.xml b/dev-python/colorful/metadata.xml new file mode 100644 index 000000000000..be5dd72ee646 --- /dev/null +++ b/dev-python/colorful/metadata.xml @@ -0,0 +1,25 @@ + + + + + foti.giuseppe@gmail.com + Giuseppe Foti + + + proxy-maint@gentoo.org + Proxy Maintainers + + + python@gentoo.org + Python + + + Package used for styling terminal strings in Python scripts. + This package is used as a dependency in net-analyzer/pontos. + + + + timofurrer/colorful + colorful + + diff --git a/dev-python/setuptools-gettext/Manifest b/dev-python/setuptools-gettext/Manifest index 7ae3eb41ebe7..356c32f5c05d 100644 --- a/dev-python/setuptools-gettext/Manifest +++ b/dev-python/setuptools-gettext/Manifest @@ -1,5 +1,6 @@ +AUX setuptools-gettext-0.1.8-wheel.patch 4374 BLAKE2B 646d4fc15558eb873578e7dda7bd8ff1b65e0cc5a8172e6fdbdc833b58f259b4a197b8cfcc1abc1eead7936ef0a24ab8218fdb40a52527422ea60fd5f2c1db19 SHA512 585f04bfa9b97db8738a3e9eaadc8cf3e1234cb4ab295c2151a12fbb6121897c7ad0a17befc2a4f6f448f7623092db14b4a7e3a212f9e018be63f6fbc31035c9 DIST setuptools-gettext-0.1.3.tar.gz 10654 BLAKE2B 801adc5f09facff215009ee61cef6996866efced51424a9dbcc6ace76e132b75d3cc8293eecbe0958372966e9faa64c73d7f743d2bb6187b448d9becf6106c8c SHA512 786e9f9280013759e96fe16551ba2dafef033d7d1faadc9bf9306c6442ba242d638778b45c8c228a2ff04038903958bc1db435c4982b665d73ba15fcc4bd9eee DIST setuptools-gettext-0.1.8.tar.gz 15548 BLAKE2B 4e1dcd219fca132e859a44e7ab86f0c81ac2dfccf5d2aca89ac05a2a3a50fec715a5e23e44173e741330d874d1f721ac8ec9d73d79b586ab605fb281aba8aafe SHA512 55b6512061565f210596972db3033d3d4f555428d23d1cac93feb3ea540461e908585d13157bcf97335f07b5a86e0b823b15457fe2f107ffc49e2e1b0c7a0c1e EBUILD setuptools-gettext-0.1.3.ebuild 517 BLAKE2B 60ca4f4fa0163fe39fdb7b9283c1c16a2d78c375d17b5305a51230b8f0bae6fb76a35e3d1167912c0bfbdb09279f5e86ad24186f960282943962f0a6287d0b65 SHA512 53323d5e513ca190a873d1cca56e015bfdc927dfbc9ab4fbef21adcdb15054ffa531db0e53765d96dd2e017d350d8b41715060cccdb6687feacf47987491a61f -EBUILD setuptools-gettext-0.1.8.ebuild 797 BLAKE2B 64a475c2edb3b67fbe24ba3ce78d81da6bfff390e8af7494afedbefddce7fdea1c710f055969f53d69cd387fbfc42328acfe657a8e2cfa3a0cfb87f403111dc5 SHA512 b569359c813234c25787529a5669500e1326f4746ddec0deb208a1fec6dc1ddc7ddf1bfbc71d46e49edd27dfe786eb49731cfb7ce4754b321771f82fbf313a81 +EBUILD setuptools-gettext-0.1.8-r1.ebuild 903 BLAKE2B 7317dcf59f5f228f0f7e91e5ee8f6b029f66fea9ef8ea3dbbdf50a0c57c5855838c0a2326e3b57b6850b92b0747c629964d42c6a40418b7710ec1c946f7d9a18 SHA512 c1f36d932ea33011443e971ddb2a13e2177a98b240c6e69125ed7786188726007a6a55c491a1b51f87abdcb1bc6cc5ce8fdae88f98eecf7eb94180b75d829226 MISC metadata.xml 416 BLAKE2B 23190f0b876ad7c5d8e0bf7ee48a9a5f8b0acfad89720261cfa2641846c68b6566106295028f0e62cfdf946f5dc31c566eaf0875796c706ac70e4acd5f1cd2ab SHA512 95a4bc35002104a6d4edcf3009e0b1d3182b6cc15146bb6e69592e5f49ab7784746e71faf438496abad9666f29cc301ff31d68469e25ee23efbae016fd46211c 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 new file mode 100644 index 000000000000..aab0158cd698 --- /dev/null +++ b/dev-python/setuptools-gettext/files/setuptools-gettext-0.1.8-wheel.patch @@ -0,0 +1,123 @@ +From a793c1d9938da1c7c962feff13dc948523fcc774 Mon Sep 17 00:00:00 2001 +From: Eli Schwartz +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 new file mode 100644 index 000000000000..e02ba96a24c3 --- /dev/null +++ b/dev-python/setuptools-gettext/setuptools-gettext-0.1.8-r1.ebuild @@ -0,0 +1,42 @@ +# 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.8.ebuild b/dev-python/setuptools-gettext/setuptools-gettext-0.1.8.ebuild deleted file mode 100644 index 71b027b2d6e3..000000000000 --- a/dev-python/setuptools-gettext/setuptools-gettext-0.1.8.ebuild +++ /dev/null @@ -1,37 +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) -" - -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 -} -- cgit v1.2.3