Skip to content

Commit fc4272c

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 5cc4faf + 7374513 commit fc4272c

24 files changed

+1454
-117
lines changed

.github/workflows/workflow.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: unit_tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
# Run automatically every monday
9+
schedule:
10+
- cron: 1 12 * * 1
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
max-parallel: 5
17+
matrix:
18+
python-version:
19+
- '3.8'
20+
- '3.9'
21+
- '3.10'
22+
- '3.11'
23+
- '3.12'
24+
25+
name: test (${{ matrix.python-version }})
26+
steps:
27+
- uses: actions/checkout@v1
28+
- name: Set up PDM
29+
uses: pdm-project/setup-pdm@v4
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
- name: Install dependencies
33+
run: |
34+
pdm install
35+
- name: Run tests
36+
run: pdm run test

.readthedocs.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# .readthedocs.yaml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Set the OS, Python version and other tools
9+
build:
10+
os: ubuntu-22.04
11+
tools:
12+
python: "3.12"
13+
14+
# Build documentation in the "docs/" directory with Sphinx
15+
sphinx:
16+
configuration: docs/source/conf.py
17+
18+
# Build PDF for docs
19+
formats:
20+
- pdf
21+
22+
python:
23+
install:
24+
- requirements: docs/requirements.txt

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
<!--
9+
## [Unreleased]
10+
-->
11+
12+
## [0.9.1] - 2024-06-21
13+
### Added
14+
- USB Standard Feature Selectors per [USB 2.0: Table 9-6]
15+
16+
17+
## [0.9.0] - 2024-06-04
18+
### Added
19+
- Initial release
20+
21+
[Unreleased]: https://github.com/greatscottgadgets/python-usb-protocol/compare/0.9.0...HEAD
22+
[0.9.1]: https://github.com/greatscottgadgets/python-usb-protocol/compare/0.9.0...0.9.1
23+
[0.9.0]: https://github.com/greatscottgadgets/python-usb-protocol/releases/tag/0.9.0

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 3-Clause License
22

3-
Copyright (c) 2020, Great Scott Gadgets <[email protected]>
3+
Copyright (c) 2020-2024, Great Scott Gadgets <[email protected]>
44
Copyright (c) 2020, Katherine J. Temkin <[email protected]>
55

66
Redistribution and use in source and binary forms, with or without

docs/Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
SOURCEDIR = source
8+
BUILDDIR = build
9+
10+
# Put it first so that "make" without argument is like "make help".
11+
help:
12+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
13+
14+
.PHONY: help Makefile
15+
16+
# Catch-all target: route all unknown targets to Sphinx using the new
17+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
18+
%: Makefile
19+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.http://sphinx-doc.org/
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
33+
34+
:end
35+
popd

docs/requirements.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
sphinx==7.2.6
2+
sphinx_rtd_theme==2.0.0
3+
sphinxcontrib-apidoc
4+
readthedocs-sphinx-search==0.3.2
5+
recommonmark==0.7.1
6+
jinja2==3.1.4
7+
8+
# needed for sphinxcontrib-apidoc to do its thing
9+
usb_protocol @ git+https://github.com/greatscottgadgets/python-usb-protocol.git

docs/source/conf.py

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import os, pkg_resources, sys, time
2+
sys.path.insert(0, os.path.abspath('../../'))
3+
sys.path.insert(0, os.path.abspath('../../usb_protocol'))
4+
5+
import sphinx_rtd_theme
6+
7+
extensions = [
8+
'sphinx_rtd_theme'
9+
]
10+
11+
# -- Project information -----------------------------------------------------
12+
13+
project = 'usb_protocol'
14+
copyright = time.strftime('2021-%Y, Great Scott Gadgets')
15+
author = 'Great Scott Gadgets'
16+
17+
version = pkg_resources.get_distribution('usb_protocol').version
18+
release = ''
19+
20+
21+
# -- General configuration ---------------------------------------------------
22+
23+
templates_path = ['_templates']
24+
exclude_patterns = ['build']
25+
source_suffix = '.rst'
26+
master_doc = 'index'
27+
language = 'en'
28+
exclude_patterns = []
29+
pygments_style = None
30+
31+
extensions = [
32+
'recommonmark',
33+
'sphinx.ext.autodoc',
34+
'sphinx.ext.coverage',
35+
'sphinx.ext.doctest',
36+
'sphinx.ext.extlinks',
37+
'sphinx.ext.napoleon',
38+
'sphinx.ext.todo',
39+
'sphinx.ext.viewcode',
40+
'sphinxcontrib.apidoc',
41+
]
42+
43+
# configure extension: sphinxcontrib.apidoc
44+
apidoc_module_dir = '../../usb_protocol'
45+
apidoc_output_dir = 'api_docs'
46+
apidoc_excluded_paths = ['test']
47+
apidoc_separate_modules = True
48+
49+
# configure extension: extlinks
50+
extlinks = {
51+
'repo': ('https://github.com/greatscottgadgets/facedancer/blob/main/%s', '%s'),
52+
'example': ('https://github.com/greatscottgadgets/facedancer/blob/main/examples/%s', '%s'),
53+
}
54+
55+
# configure extension: napoleon
56+
napoleon_google_docstring = True
57+
napoleon_numpy_docstring = False
58+
napoleon_include_init_with_doc = True
59+
napoleon_use_ivar = True
60+
napoleon_include_private_with_doc = False
61+
napoleon_include_special_with_doc = True
62+
napoleon_use_param = False
63+
64+
65+
# -- Options for HTML output -------------------------------------------------
66+
# run pip install sphinx_rtd_theme if you get sphinx_rtd_theme errors
67+
html_theme = 'sphinx_rtd_theme'
68+
html_css_files = ['status.css']

docs/source/index.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
==========================
2+
usb_protocol documentation
3+
==========================
4+
5+
.. toctree::
6+
:maxdepth: 4
7+
:caption: API Documentation
8+
9+
api_docs/modules
10+
11+
* :ref:`genindex`
12+
* :ref:`modindex`

pyproject.toml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
[build-system]
2+
requires = ["setuptools>=64", "setuptools-git-versioning<2"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "usb-protocol"
7+
description = "Python library providing utilities, data structures, constants, parsers, and tools for working with the USB protocol."
8+
license = { text = "BSD" }
9+
readme = "README.md"
10+
requires-python = ">=3.8"
11+
authors = [
12+
{name = "Great Scott Gadgets", email = "[email protected]"},
13+
]
14+
15+
classifiers = [
16+
"Development Status :: 4 - Beta",
17+
"Programming Language :: Python :: 3",
18+
"Programming Language :: Python :: 3.8",
19+
"Programming Language :: Python :: 3.9",
20+
"Programming Language :: Python :: 3.10",
21+
"Programming Language :: Python :: 3.11",
22+
"Programming Language :: Python :: 3.12",
23+
"License :: OSI Approved :: BSD License",
24+
"Operating System :: OS Independent",
25+
"Natural Language :: English",
26+
"Environment :: Console",
27+
"Environment :: Plugins",
28+
"Intended Audience :: Developers",
29+
"Intended Audience :: Science/Research",
30+
"Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)",
31+
"Topic :: Security",
32+
"Topic :: System :: Hardware :: Universal Serial Bus (USB)",
33+
]
34+
35+
dependencies = [
36+
"construct~=2.10"
37+
]
38+
39+
dynamic = ["version"]
40+
41+
[project.urls]
42+
Documentation = "https://python-usb-protocol.readthedocs.io"
43+
Repository = "https://github.com/greatscottgadgets/python-usb-protocol"
44+
Issues = "https://github.com/greatscottgadgets/python-usb-protocol/issues"
45+
46+
[tool.setuptools.package-dir]
47+
usb_protocol = "usb_protocol"
48+
49+
[tool.setuptools-git-versioning]
50+
enabled = true
51+
starting_version = "0.9.0"
52+
53+
[tool.pdm.scripts]
54+
test.cmd = "python -m unittest discover -t . -v"

0 commit comments

Comments
 (0)