diff options
| author | Liguros - Gitlab CI/CD [develop] <gitlab@liguros.net> | 2023-02-17 07:44:03 +0000 |
|---|---|---|
| committer | Liguros - Gitlab CI/CD [develop] <gitlab@liguros.net> | 2023-02-17 07:44:03 +0000 |
| commit | b20430a929939ff90b7fdc6fdd22c6aa8b73a315 (patch) | |
| tree | cc0bb880273f85ee222ee144d26eaa1426d650f5 /dev-python/pyusb | |
| parent | 72d7b6801b0d487898486546a1a2e70130d48719 (diff) | |
| download | baldeagleos-repo-b20430a929939ff90b7fdc6fdd22c6aa8b73a315.tar.gz baldeagleos-repo-b20430a929939ff90b7fdc6fdd22c6aa8b73a315.tar.xz baldeagleos-repo-b20430a929939ff90b7fdc6fdd22c6aa8b73a315.zip | |
Adding metadata
Diffstat (limited to 'dev-python/pyusb')
| -rw-r--r-- | dev-python/pyusb/files/pyusb-1.2.1-setuptools.patch | 37 | ||||
| -rw-r--r-- | dev-python/pyusb/pyusb-1.2.1-r1.ebuild | 30 | ||||
| -rw-r--r-- | dev-python/pyusb/pyusb-1.2.1.ebuild | 7 |
3 files changed, 72 insertions, 2 deletions
diff --git a/dev-python/pyusb/files/pyusb-1.2.1-setuptools.patch b/dev-python/pyusb/files/pyusb-1.2.1-setuptools.patch new file mode 100644 index 000000000000..26b5e204d648 --- /dev/null +++ b/dev-python/pyusb/files/pyusb-1.2.1-setuptools.patch @@ -0,0 +1,37 @@ +https://github.com/pyusb/pyusb/commit/777dea9d718e70d7323c821d4497c706b35742da + +From 777dea9d718e70d7323c821d4497c706b35742da Mon Sep 17 00:00:00 2001 +From: Jonas Malaco <jonas@protocubo.io> +Date: Tue, 12 Jul 2022 03:12:50 -0300 +Subject: [PATCH] version: handle when patch component is missing + +actions/checkout@v3 (by default) no longer fetches the tags while +checking out the repository. This, combined with our use of +setuptools_scm post-release scheme, results in tox trying to run the +tests with version strings that look something like + + pyusb-0.0.post1+g3678fc1.zip + +and breaking _get_extended_version_info(). + +Make _get_extended_version_info() robust against this case. This is +preferable to configuring actions/checkout@v3 to fetch the tags as, +being related shallow clones, it might also happen in other contexts. + +Fixes: 678fc1867f4 ("github: update to actions/checkout@v3") +--- a/usb/__init__.py ++++ b/usb/__init__.py +@@ -55,9 +55,9 @@ + + def _get_extended_version_info(version): + import re +- m = re.match(r'(\d+)\.(\d+)\.(\d+)[.-]?(.*)', version) +- major, minor, patch, suffix = m.groups() +- return int(major), int(minor), int(patch), suffix ++ m = re.match(r'(\d+)\.(\d+)(\.(\d+))?[.-]?(.*)', version) ++ major, minor, _, patch, suffix = m.groups() ++ return int(major), int(minor), int(patch or "0"), suffix + + extended_version_info = _get_extended_version_info(__version__) + version_info = extended_version_info[:3] + diff --git a/dev-python/pyusb/pyusb-1.2.1-r1.ebuild b/dev-python/pyusb/pyusb-1.2.1-r1.ebuild new file mode 100644 index 000000000000..8ce078179343 --- /dev/null +++ b/dev-python/pyusb/pyusb-1.2.1-r1.ebuild @@ -0,0 +1,30 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{7,8,9,10,11} ) +inherit distutils-r1 pypi + +DESCRIPTION="USB support for Python" +HOMEPAGE="https://pyusb.github.io/pyusb/ https://pypi.org/project/pyusb/" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~riscv ~x86" + +### This version is compatible with both 0.X and 1.X versions of libusb +DEPEND="virtual/libusb:=" +RDEPEND="${DEPEND}" + +DOCS=( README.rst docs/tutorial.rst ) + +PATCHES=( + "${FILESDIR}"/${P}-setuptools.patch +) + +python_test() { + cd tests || die + "${EPYTHON}" testall.py || die "Tests failed with ${EPYTHON}" +} diff --git a/dev-python/pyusb/pyusb-1.2.1.ebuild b/dev-python/pyusb/pyusb-1.2.1.ebuild index c658b437354f..f45fb89bdca7 100644 --- a/dev-python/pyusb/pyusb-1.2.1.ebuild +++ b/dev-python/pyusb/pyusb-1.2.1.ebuild @@ -4,11 +4,10 @@ EAPI=8 PYTHON_COMPAT=( python3_{7,8,9,10,11} ) -inherit distutils-r1 +inherit distutils-r1 pypi DESCRIPTION="USB support for Python" HOMEPAGE="https://pyusb.github.io/pyusb/ https://pypi.org/project/pyusb/" -SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" LICENSE="BSD" SLOT="0" @@ -20,6 +19,10 @@ RDEPEND="${DEPEND}" DOCS=( README.rst docs/tutorial.rst ) +PATCHES=( + "${FILESDIR}"/${P}-setuptools.patch +) + python_test() { cd tests || die "${EPYTHON}" testall.py || die "Tests failed with ${EPYTHON}" |
