Skip to content

Commit

Permalink
1.0.26rc3 (2024-01-25)
Browse files Browse the repository at this point in the history
----------------------
- Setup update (now based on tox >= 4.0).
- Cleanup.
  • Loading branch information
Adam Karpierz committed Jan 26, 2024
1 parent 02dcd5a commit 44369fe
Show file tree
Hide file tree
Showing 28 changed files with 129 additions and 105 deletions.
12 changes: 9 additions & 3 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
version: 2
build:
image: latest
os: "ubuntu-22.04"
tools:
python: "3.11"
python:
version: 3.11
install:
- method: pip
path: .
extra_requirements: [doc]
extra_requirements:
- doc
sphinx:
builder: html
configuration: docs/conf.py
fail_on_warning: true
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelog
=========

1.0.26rc3 (2024-01-25)
----------------------
- Setup update (now based on tox >= 4.0).
- Cleanup.

1.0.26rc2 (2023-12-20)
----------------------
- Add linux aarch64 support.
Expand Down
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2016-2024 Adam Karpierz
# Copyright (c) 2016 Adam Karpierz
# Licensed under the zlib/libpng License
# https://opensource.org/licenses/Zlib
# https://opensource.org/license/zlib

include README.rst
include CHANGES.rst
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ License

| Copyright (c) 2016-2024 Adam Karpierz
| Licensed under the zlib/libpng License
| https://opensource.org/licenses/Zlib
| https://opensource.org/license/zlib
| Please refer to the accompanying LICENSE file.
Authors
Expand Down
4 changes: 2 additions & 2 deletions examples/dpfp.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2016-2024 Adam Karpierz
# Copyright (c) 2016 Adam Karpierz
# Licensed under the zlib/libpng License
# https://opensource.org/licenses/Zlib
# https://opensource.org/license/zlib

# libusb example program to manipulate U.are.U 4000B fingerprint scanner.
# Copyright © 2007 Daniel Drake <dsd@gentoo.org>
Expand Down
4 changes: 2 additions & 2 deletions examples/dpfp_threaded.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2016-2024 Adam Karpierz
# Copyright (c) 2016 Adam Karpierz
# Licensed under the zlib/libpng License
# https://opensource.org/licenses/Zlib
# https://opensource.org/license/zlib

# libusb example program to manipulate U.are.U 4000B fingerprint scanner.
# Copyright © 2007 Daniel Drake <dsd@gentoo.org>
Expand Down
4 changes: 2 additions & 2 deletions examples/ezusb.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2016-2024 Adam Karpierz
# Copyright (c) 2016 Adam Karpierz
# Licensed under the zlib/libpng License
# https://opensource.org/licenses/Zlib
# https://opensource.org/license/zlib

# Copyright © 2001 Stephen Williams (steve@icarus.com)
# Copyright © 2001-2002 David Brownell (dbrownell@users.sourceforge.net)
Expand Down
4 changes: 2 additions & 2 deletions examples/fxload.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2016-2024 Adam Karpierz
# Copyright (c) 2016 Adam Karpierz
# Licensed under the zlib/libpng License
# https://opensource.org/licenses/Zlib
# https://opensource.org/license/zlib

# Copyright © 2001 Stephen Williams (steve@icarus.com)
# Copyright © 2001-2002 David Brownell (dbrownell@users.sourceforge.net)
Expand Down
4 changes: 2 additions & 2 deletions examples/hotplugtest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2016-2024 Adam Karpierz
# Copyright (c) 2016 Adam Karpierz
# Licensed under the zlib/libpng License
# https://opensource.org/licenses/Zlib
# https://opensource.org/license/zlib

# libusb example program for hotplug API
# Copyright © 2012-2013 Nathan Hjelm <hjelmn@mac.com>
Expand Down
4 changes: 2 additions & 2 deletions examples/listdevs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2016-2024 Adam Karpierz
# Copyright (c) 2016 Adam Karpierz
# Licensed under the zlib/libpng License
# https://opensource.org/licenses/Zlib
# https://opensource.org/license/zlib

# libusb example program to list devices on the bus
# Copyright © 2007 Daniel Drake <dsd@gentoo.org>
Expand Down
4 changes: 2 additions & 2 deletions examples/testlibusb.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2016-2024 Adam Karpierz
# Copyright (c) 2016 Adam Karpierz
# Licensed under the zlib/libpng License
# https://opensource.org/licenses/Zlib
# https://opensource.org/license/zlib

# Test suite program based of libusb-0.1-compat testlibusb
# Copyright (c) 2013 Nathan Hjelm <hjelmn@mac.ccom>
Expand Down
4 changes: 2 additions & 2 deletions examples/win32.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2016-2024 Adam Karpierz
# Copyright (c) 2016 Adam Karpierz
# Licensed under the zlib/libpng License
# https://opensource.org/licenses/Zlib
# https://opensource.org/license/zlib

from libusb._platform import is_windows

Expand Down
4 changes: 2 additions & 2 deletions examples/xusb.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2016-2024 Adam Karpierz
# Copyright (c) 2016 Adam Karpierz
# Licensed under the zlib/libpng License
# https://opensource.org/licenses/Zlib
# https://opensource.org/license/zlib

# xusb: Generic USB test program
# Copyright © 2009-2012 Pete Batard <pete@akeo.ie>
Expand Down
116 changes: 63 additions & 53 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# Copyright (c) 2016-2024 Adam Karpierz
# Copyright (c) 2016 Adam Karpierz
# Licensed under the zlib/libpng License
# https://opensource.org/licenses/Zlib
# https://opensource.org/license/zlib

[build-system]
build-backend = 'setuptools.build_meta'
requires = ['setuptools>=68.2.2', 'wheel>=0.41.3', 'packaging>=23.2.0', 'tox>=3.28.0,<4']
requires = ['setuptools>=68.2.2', 'wheel>=0.42.0', 'packaging>=23.2.0', 'tox>=4.11.3']

[project]
name = 'libusb'
version = '1.0.26rc2'
version = '1.0.26rc3'
description = 'Python binding for the libusb C library.'
urls.Homepage = 'https://pypi.org/project/libusb/'
urls.Documentation = 'https://libusb.readthedocs.io/'
urls.Download = 'https://pypi.org/project/libusb/'
urls.Source = 'https://github.com/karpierz/libusb'
urls.Issues = 'https://github.com/karpierz/libusb/issues'
license = { text = 'zlib/libpng License ; https://opensource.org/licenses/Zlib' }
license = { text = 'zlib/libpng License ; https://opensource.org/license/zlib' }
authors = [
{ name = 'Adam Karpierz' },
{ email = 'adam@karpierz.net' },
Expand Down Expand Up @@ -47,13 +47,12 @@ requires-python = '>=3.8.1,<4.0.0'
dependencies = [
# mandatory
'setuptools>=68.2.2',
'pkg_about>=1.1.0',
'pkg-about>=1.1.3',
# others
]
dynamic = ['readme']
[project.optional-dependencies]
doc = [
'docutils>=0.18.1,<0.20',
'Sphinx>=7.1.2',
'sphinx-toolbox>=3.5.0',
'sphinx-tabs>=3.4.1',
Expand Down Expand Up @@ -106,6 +105,11 @@ libusb = [
'*/*/.keep',
]

[tool.setuptools.exclude-package-data]
'*' = ['*.c','*.h','*.cpp','*.hpp','*.cxx','*.hxx','*.pyx','*.pxd']
libusb = [
]

[tool.coverage.run]
source = [
'libusb',
Expand All @@ -114,19 +118,16 @@ source = [
omit = [
]
data_file = '.tox/coverage/.coverage'
plugins = ['covdefaults']

[tool.coverage.report]
exclude_lines = [
# Regexes
# Have to re-enable the standard pragma
'pragma: no cover',
'pragma: nocover',
'if\s+self\.debug\s+:',
'if\s+__debug__\s+:',
'raise (AssertionError|NotImplementedError)',
'if\s+(0|False)\s*:',
'''if\s+__name__.*\s*==\s*'__main__'\s*:''',
'if\s+__name__.*\s*==\s*"__main__"\s*:',
'^\s*if\s+self\.debug\s*:',
'^\s*if\s+__debug__\s*:',
'^\s*if\s+(0|False)\s*:',
'''if\s+__name__.*\s*==\s*['"]__main__['"]\s*:''',
'^\s*@unittest\.skip\(',
'^\s*@unittest\.skipIf\(sys\.platform\.startswith\("win"\)',
]
Expand Down Expand Up @@ -173,35 +174,50 @@ count = true
[tool.tox]
legacy_tox_ini = """
[tox]
envlist = py{38,39,310,311,312}, pypy{39,310}, docs
minversion = 3.28.0,<4
isolated_build = true
envlist = py{38,39,310,311,312}, pypy{39,310}win, docs
labels =
py = py{38,39,310,311,312}, pypy{39,310}win
prepare = prepare
coverage = coverage
lint = lint
docs = docs
build = py{38,39,310,311,312}, pypy{39,310}win, docs, build
deploy = py{38,39,310,311,312}, pypy{39,310}win, docs, build, publish
minversion = 4.11.3
skip_missing_interpreters = true
requires =
{[base]setup_requires}
tox-venv>=0.4.0
tox-backticks>=0.3.0
{[base]deps}
virtualenv>=20.25.0
tox-backtick>=0.4.3
tox-tags>=0.2.0
tox-run-before>=0.1.0
[base]
setup_requires =
pip>=23.3.1
basepython = python3.11
deps =
pip>=23.3.2
setuptools>=68.2.2
wheel>=0.41.3
wheel>=0.42.0
packagesubdir = libusb
[testenv]
passenv = WINDIR
setenv =
PYTHONDONTWRITEBYTECODE = 1
commands =
{envpython} --version
{envpython} -B -m tests {posargs}
{envpython} -m tests {posargs}
extras = test
deps =
{[base]setup_requires}
{[base]deps}
[testenv:pypy39win]
basepython = C:\\PyPy39\\pypy.exe
[testenv:pypy310win]
basepython = C:\\PyPy310\\pypy.exe
[testenv:prepare]
basepython = python3.11
basepython = {[base]basepython}
skip_install = true
allowlist_externals =
cmd
Expand All @@ -210,19 +226,20 @@ commands =
cmd /C if exist .build.cmd .build.cmd
[testenv:coverage]
basepython = python3.11
basepython = {[base]basepython}
commands =
{envpython} -m coverage erase
-{envpython} -B -m coverage run -m tests {posargs}
-{envpython} -m coverage run -m tests {posargs}
{envpython} -m coverage report
{envpython} -m coverage html
deps =
{[testenv]deps}
coverage>=7.3.2
diff-cover>=7.6.0
coverage>=7.4.0
covdefaults>=2.3.0
diff-cover>=7.7.0
[testenv:docs]
basepython = python3.11
basepython = {[base]basepython}
commands =
{envpython} -m sphinxlint --ignore .tox --ignore build --ignore dist
#{envpython} -m sphinx.apidoc -f {envsitepackagesdir}/{[base]packagesubdir}
Expand All @@ -233,48 +250,41 @@ extras = doc
deps =
[testenv:build]
basepython = python3.11
depends = py{38,39,310,311,312}, pypy{39,310}win, docs
basepython = {[base]basepython}
setenv =
PKG_PVER=`{envpython} -c "import platform ; print(''.join(platform.python_version_tuple()[:2]), end='')" 2> nul`
PKG_NAME=`{envpython} -c "import warnings ; warnings.filterwarnings('ignore') ; import setuptools ; setuptools._distutils.core._setup_stop_after='config' ; print(setuptools.setup().metadata.get_name(), end='')" 2> nul`
PKG_DIST=`{envpython} -c "import warnings ; warnings.filterwarnings('ignore') ; import setuptools ; setuptools._distutils.core._setup_stop_after='config' ; print(setuptools.setup().metadata.get_fullname(), end='')" 2> nul`
{[testenv]setenv}
PKG_PVER=`{envpython} -W ignore -c "import platform ; print(''.join(platform.python_version_tuple()[:2]), end='')" 2> nul`
PKG_NAME=`{envpython} -W ignore -c "import setuptools ; setuptools._distutils.core._setup_stop_after='config' ; print(setuptools.setup().metadata.get_name(), end='')" 2> nul`
PKG_DIST=`{envpython} -W ignore -c "import setuptools ; setuptools._distutils.core._setup_stop_after='config' ; print(setuptools.setup().metadata.get_fullname(), end='')" 2> nul`
commands =
{[testenv]commands}
{[testenv:docs]commands}
{envpython} -c "import warnings ; warnings.filterwarnings('ignore') ; from setuptools import setup ; setup()" --quiet sdist --formats=zip
{envpython} -c "import warnings ; warnings.filterwarnings('ignore') ; from setuptools import setup ; setup()" --quiet bdist_wheel
{envpython} -W ignore -c "from setuptools import setup ; setup()" --quiet sdist --formats=zip
{envpython} -W ignore -c "from setuptools import setup ; setup()" --quiet bdist_wheel
# check out for PyPi
{envpython} -m twine check dist/*
extras =
{[testenv]extras}
{[testenv:docs]extras}
deps =
{[testenv]deps}
{[testenv:docs]deps}
twine>=4.0.2
[testenv:publish]
basepython = python3.11
setenv =
{[testenv:build]setenv}
depends = build
basepython = {[base]basepython}
skip_install = true
commands =
{[testenv:build]commands}
# publish on PyPi
{envpython} -m twine upload dist/*
extras =
{[testenv:build]extras}
deps =
{[testenv:build]deps}
twine>=4.0.2
[testenv:lint]
basepython = python3.11
basepython = {[base]basepython}
commands =
{envpython} -m flake8 {envsitepackagesdir}/{[base]packagesubdir}/
extras =
deps =
{[testenv]deps}
flake8>=6.1.0
flake8>=7.0.0
flake8-pyproject>=1.2.3
flake8-docstrings>=1.7.0
pep8-naming>=0.13.3
Expand Down
4 changes: 2 additions & 2 deletions src/libusb/__about__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2016-2024 Adam Karpierz
# Copyright (c) 2016 Adam Karpierz
# Licensed under the zlib/libpng License
# https://opensource.org/licenses/Zlib
# https://opensource.org/license/zlib

__import__("pkg_about").about()
__copyright__ = f"Copyright (c) 2016-2024 {__author__}" # noqa
4 changes: 2 additions & 2 deletions src/libusb/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2016-2024 Adam Karpierz
# Copyright (c) 2016 Adam Karpierz
# Licensed under the zlib/libpng License
# https://opensource.org/licenses/Zlib
# https://opensource.org/license/zlib

from .__about__ import * ; del __about__ # noqa
from . import __config__ ; del __config__
Expand Down
4 changes: 2 additions & 2 deletions src/libusb/_config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2016-2024 Adam Karpierz
# Copyright (c) 2016 Adam Karpierz
# Licensed under the zlib/libpng License
# https://opensource.org/licenses/Zlib
# https://opensource.org/license/zlib

__all__ = ('make_config',)

Expand Down
4 changes: 2 additions & 2 deletions src/libusb/_dll.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2016-2024 Adam Karpierz
# Copyright (c) 2016 Adam Karpierz
# Licensed under the zlib/libpng License
# https://opensource.org/licenses/Zlib
# https://opensource.org/license/zlib

from ._platform import DLL_PATH, DLL, dlclose

Expand Down

0 comments on commit 44369fe

Please sign in to comment.