dev-python/pyusb: new package, add 1.2.1-r2

Signed-off-by: Andreas Billmeier <b@edevau.net>
This commit is contained in:
2024-02-25 13:35:54 +01:00
parent 39a44cc7b1
commit da0b7ca474
5 changed files with 89 additions and 3 deletions
+4
View File
@@ -0,0 +1,4 @@
AUX pyusb-1.2.1-setuptools.patch 1457 BLAKE2B a60b6f4bb8abb3a4d59b325b8eff9af7c88fb093913ea9e8c81ada6bb70d303bc225ddadf2a7ee6308f3fade136d843b7c8d07dc139cd3c04352520a060cb515 SHA512 769e734d60224a2ee58e6192fc7dded8ab821df8360fb9cf0cd2cec0135f68b1aa6a1d996e42847300ca9ca9b00ef318124c53bddb2cf5e5b25523f24bb39cb8
DIST pyusb-1.2.1.tar.gz 75292 BLAKE2B c1b99f22919ab4beb8e96d664147dc51001c4a48b3acf9ba3961f7f53a9d13277c622e891481fd00b9d34d2ed8a2a0932b7949c13396ea4d76b36f36fcc4cdb0 SHA512 51d0c1165540afa21d6d0ab7315ac77b08083d1cb8e502173dfb1766bc542173f9d7b0070fd14bc71d147e31c3f0780b277093791a7c82485962a04ec62bf0f1
EBUILD pyusb-1.2.1-r2.ebuild 680 BLAKE2B 9246a2c93af411947315e63fc2da49e47e7c578671674e7fcb38386414defb7e325f9940d267ec1aaa59259763db29c84dec4d899386498dc44ee27f34ea2ea1 SHA512 d50342441b651e59f8d93897f4fbe086a94a6331fab81d162a340945f6549dc82412456e36e1c7238747ccc676505d3a939f5e175ce5f1b1ec08cc7542a836c7
MISC metadata.xml 448 BLAKE2B 70b16d080cc3a347271918976d702496f66ac71758e94e89c31cbc3cad62e42bcb622740092d6de83d8b5d9437b0c3e23d921581f378bd84b205fe2cc539bb58 SHA512 371238adaee58cf0239827f5bde3a2a9b9e634a1c3f59f7f877d73b2a4e1f116f020e2a5d937c18c137903ed35c70103cd7c0f42f1fe46df0cc83eec4a5f01b7
@@ -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]
+15
View File
@@ -0,0 +1,15 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>b@edevau.net</email>
<name>Andreas Billmeier</name>
</maintainer>
<upstream>
<remote-id type="pypi">pyusb</remote-id>
<maintainer status="unknown">
<email>me@jonasmalaco.com</email>
<name>Jonas Malaco</name>
</maintainer>
</upstream>
</pkgmetadata>
+30
View File
@@ -0,0 +1,30 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{10..12} )
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 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}"
}