Skip to content
Merged

2.0 #52

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
6908ae2
Update ci
Oct 1, 2025
a022d72
Update ci
spacemanspiff2007 Oct 1, 2025
c0111a8
Update ci
spacemanspiff2007 Oct 1, 2025
c78ea4c
Update ci
spacemanspiff2007 Oct 1, 2025
2f4e012
try uv
spacemanspiff2007 Oct 1, 2025
e212ace
try uv
spacemanspiff2007 Oct 1, 2025
066df08
try uv
spacemanspiff2007 Oct 1, 2025
d182186
try uv
spacemanspiff2007 Oct 1, 2025
6249f32
try uv
spacemanspiff2007 Oct 1, 2025
2ccee73
pre-commit
spacemanspiff2007 Oct 1, 2025
ffd9806
Sync universes (#50)
bofh69 Oct 2, 2025
2524763
small changes
spacemanspiff2007 Oct 2, 2025
29ea566
.
spacemanspiff2007 Oct 2, 2025
d9122ff
.
spacemanspiff2007 Oct 2, 2025
5ecbd29
.
spacemanspiff2007 Oct 6, 2025
ae402e2
.
spacemanspiff2007 Oct 7, 2025
80c9fb5
removed double quotes
spacemanspiff2007 Oct 7, 2025
4c7ce9b
sorted imports
spacemanspiff2007 Oct 7, 2025
78fa5e6
.
spacemanspiff2007 Oct 7, 2025
830834a
.
spacemanspiff2007 Oct 7, 2025
2cf3353
.
spacemanspiff2007 Oct 7, 2025
13ba65d
.
spacemanspiff2007 Oct 7, 2025
1e24b26
.
spacemanspiff2007 Oct 7, 2025
c31c694
.
spacemanspiff2007 Oct 7, 2025
0a67f16
.
spacemanspiff2007 Oct 7, 2025
11e7949
.
spacemanspiff2007 Oct 7, 2025
8f992c7
.
spacemanspiff2007 Oct 7, 2025
1739204
.
spacemanspiff2007 Oct 15, 2025
cec3bcf
fix IPv6 multicast
spacemanspiff2007 Oct 20, 2025
37453bb
fix multicast
spacemanspiff2007 Oct 21, 2025
683b532
.
spacemanspiff2007 Oct 21, 2025
aecc293
.
spacemanspiff2007 Oct 23, 2025
29916ee
implement network interface
spacemanspiff2007 Oct 27, 2025
0b82e23
implement class factory
spacemanspiff2007 Oct 27, 2025
eb34586
.
spacemanspiff2007 Oct 27, 2025
35df31b
.
spacemanspiff2007 Oct 27, 2025
bd7706d
.
spacemanspiff2007 Oct 27, 2025
26c97ce
.
spacemanspiff2007 Oct 28, 2025
8c6a556
.
spacemanspiff2007 Oct 28, 2025
b705298
.
spacemanspiff2007 Oct 28, 2025
8575bb1
.
spacemanspiff2007 Oct 28, 2025
7581d33
.
spacemanspiff2007 Oct 28, 2025
5e7aab2
.
spacemanspiff2007 Oct 28, 2025
b45f418
.
spacemanspiff2007 Oct 31, 2025
8074f5b
detect ip version earlier
spacemanspiff2007 Oct 31, 2025
31ffee8
.
spacemanspiff2007 Nov 3, 2025
11e5c64
.
spacemanspiff2007 Nov 3, 2025
7ed9be8
.
spacemanspiff2007 Nov 3, 2025
b2c2757
2.0
spacemanspiff2007 Nov 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions .github/workflows/pre-commit.yml

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5
with:
ref: master
- name: Set up Python 3.10
uses: actions/setup-python@v4
- name: Set up Python 3.12
uses: actions/setup-python@v6
with:
python-version: '3.10'
python-version: '3.12'

- name: Install setuptools
run: |
Expand All @@ -27,7 +27,7 @@ jobs:
python setup.py sdist bdist_wheel

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_api_key }}
48 changes: 37 additions & 11 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,50 @@
name: Tests

on: [push]
on: [push, pull_request]

jobs:
pre-commit:
name: pre-commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: '3.12'
- uses: pre-commit/action@v3.0.1

test:
needs: pre-commit
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- uses: actions/checkout@v5
- name: Install the latest version of uv and set the python version
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
run: tox
activate-environment: true
- name: Install Packages
run: uv sync --frozen
- name: Test with python ${{ matrix.python-version }}
run: uv run --frozen pytest


docs:
needs: pre-commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install the latest version of uv and set the python version
uses: astral-sh/setup-uv@v7
with:
python-version: '3.12'
activate-environment: true
- name: Install Packages
run: uv sync --frozen
- name: Build docs
run: uv run --frozen sphinx-build docs build_docs --color -b html -E -W -n --keep-going
42 changes: 27 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,38 +1,50 @@
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v6.0.0
hooks:
- id: check-ast
- id: check-builtin-literals
- id: check-docstring-first
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
exclude: \.(?:pdf|svg)$
- id: trailing-whitespace


- repo: https://github.com/pycqa/isort
rev: 5.12.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.3
hooks:
- id: isort
name: isort (python)
- id: ruff
name: ruff unused imports
# F401 [*] {name} imported but unused
args: [ "--select", "F401", "--extend-exclude", "__init__.py", "--fix"]

- id: ruff
# I001 [*] Import block is un-sorted or un-formatted
# UP035 [*] Import from {target} instead: {names}
# Q000 [*] Double quote found but single quotes preferred
# Q001 [*] Double quote multiline found but single quotes preferred
args: [ "--select", "I001,UP035,Q000,Q001", "--fix"]

- repo: https://github.com/PyCQA/flake8
rev: '6.0.0'
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear==23.1.20
- flake8-comprehensions==3.10.1
- flake8-pytest-style==1.6
- flake8-noqa==1.3
- pep8-naming==0.13.3

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: rst-backticks


- repo: https://github.com/JelleZijlstra/autotyping
rev: 24.9.0
hooks:
- id: autotyping
types: [python]
args: [--safe]


- repo: meta
hooks:
- id: check-hooks-apply
Expand Down
113 changes: 113 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
indent-width = 4
line-length = 120

target-version = "py38"

src = [
"src",
"tests"
]


[lint]
select = ["ALL"]

ignore = [
"D", # https://docs.astral.sh/ruff/rules/#pydocstyle-d
"T20", # https://docs.astral.sh/ruff/rules/#flake8-print-t20
"DTZ", # https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz
"SLF", # https://docs.astral.sh/ruff/rules/#flake8-self-slf

"RET501", # https://docs.astral.sh/ruff/rules/unnecessary-return-none/#unnecessary-return-none-ret501
"TRY400", # https://docs.astral.sh/ruff/rules/error-instead-of-exception/

# https://docs.astral.sh/ruff/rules/#flake8-builtins-a
"A003", # Python builtin is shadowed by class attribute {name} from {row}

# https://docs.astral.sh/ruff/rules/#pyflakes-f
"F401", # {name} imported but unused; consider using importlib.util.find_spec to test for availability

# https://docs.astral.sh/ruff/rules/#flake8-bandit-s
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes

# https://docs.astral.sh/ruff/rules/#flake8-annotations-ann
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed in {name}

# https://docs.astral.sh/ruff/rules/#flake8-blind-except-ble
"BLE001", # Do not catch blind exception: {name}

# https://docs.astral.sh/ruff/rules/#flake8-raise-rse
"RSE102", # Unnecessary parentheses on raised exception

# https://docs.astral.sh/ruff/rules/#flake8-commas-com
"COM812", # Trailing comma missing
"COM819", # Trailing comma prohibited

# https://docs.astral.sh/ruff/rules/#warning-w_1
"PLW0603", # Using the global statement to update {name} is discouraged

# https://docs.astral.sh/ruff/rules/#flake8-logging-format-g
"G004", # Logging statement uses f-string

# https://docs.astral.sh/ruff/rules/#refactor-r
"PLR1711", # Useless return statement at end of function

# https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
"RUF005", # Consider {expression} instead of concatenation

# https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt
"PT007", # Wrong values type in @pytest.mark.parametrize expected {values} of {row}
]


[format]
quote-style = "single"


# https://docs.astral.sh/ruff/settings/#lintflake8-quotes
[lint.flake8-quotes]
inline-quotes = "single"
multiline-quotes = "single"


[lint.flake8-builtins]
builtins-ignorelist = ["id", "input"]


# https://docs.astral.sh/ruff/settings/#lintisort
[lint.isort]
lines-after-imports = 2 # https://docs.astral.sh/ruff/settings/#lint_isort_lines-after-imports


[lint.per-file-ignores]
"docs/conf.py" = [
"INP001", # File `conf.py` is part of an implicit namespace package. Add an `__init__.py`.
"A001", # Variable `copyright` is shadowing a Python builtin
"PTH118", # `os.path.join()` should be replaced by `Path` with `/` operator
"PTH100", # `os.path.abspath()` should be replaced by `Path.resolve()`
]

"tests/*" = [
"ANN", # https://docs.astral.sh/ruff/rules/#flake8-annotations-ann

# https://docs.astral.sh/ruff/rules/#flake8-bandit-s
"S101", # Use of assert detected

# https://docs.astral.sh/ruff/rules/#refactor-r
"PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable
"PLR0913", # Too many arguments in function definition ({c_args} > {max_args})

# https://docs.astral.sh/ruff/rules/#flake8-boolean-trap-fbt
"FBT003", # Boolean positional value in function call

# https://docs.astral.sh/ruff/rules/#flake8-unused-arguments-arg
"ARG001", # Unused function argument {name}
"ARG002", # Unused method argument {name}
"ARG003", # Unused class method argument: {name}
"ARG004", # Unused static method argument: {name}
"ARG005", # Unused lambda argument: {name}
]

"src/pyartnet/*" = [
"PLR2004" # Magic value used in comparison, consider replacing `0.01` with a constant variable
]
7 changes: 5 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import re
import sys


RTD_BUILD = os.environ.get('READTHEDOCS') == 'True'

# Configuration file for the Sphinx documentation builder.
Expand All @@ -14,7 +15,7 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'PyArtNet'
copyright = '2023, spacemanspiff2007'
copyright = '2025, spacemanspiff2007'
author = 'spacemanspiff2007'


Expand All @@ -36,7 +37,6 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']


# -- Options for exec code -------------------------------------------------
Expand Down Expand Up @@ -70,3 +70,6 @@
nitpick_ignore_regex.append(
(re.compile(r'py:data|py:class'), re.compile(r'typing\..+'))
)
nitpick_ignore_regex.append(
(re.compile(r'py:class'), re.compile(r'collections\.abc\..+'))
)
Loading