Skip to content

feat: replace unmaintained netifaces dependency with psutil - #141

Open
fredrike wants to merge 2 commits into
masterfrom
drop-netifaces
Open

feat: replace unmaintained netifaces dependency with psutil#141
fredrike wants to merge 2 commits into
masterfrom
drop-netifaces

Conversation

@fredrike

@fredrike fredrike commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Closes #117

netifaces is archived and unmaintained, with open bugs against Python 3.14 and no plan to fix them. This PR replaces its only use with psutil, which is actively maintained and cross-platform.

Changes

  • pydaikin/discovery.py: enumerate IPv4 interface broadcast addresses via psutil.net_if_addrs() instead of netifaces (same resulting addresses, cross-platform).
  • pyproject.toml / requirements.txt: swap netifaces for psutil.
  • .pre-commit-config.yaml / .github/workflows/pylint.yml / bitbucket-pipelines.yml: drop the netifaces pylint extension allow-list entries.
  • tests/test_discovery.py: add unit tests for broadcast selection, ip= override, device parsing, stop-on-name, and invalid-response handling.

Verification

  • pre-commit run --all-files passes (ruff + pylint).
  • Full test suite: 215 passed, 10 skipped.

netifaces is archived and unmaintained, with no fixes for Python 3.14.
Replace its only use in the discovery module (enumerating IPv4 interface
broadcast addresses) with psutil, which is actively maintained and
cross-platform. Drop netifaces from dependencies and CI configs, and add
unit tests covering broadcast selection and discovery message handling.
@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.63%. Comparing base (788da58) to head (e033cbb).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #141      +/-   ##
==========================================
+ Coverage   85.60%   86.63%   +1.02%     
==========================================
  Files          12       12              
  Lines        1341     1339       -2     
==========================================
+ Hits         1148     1160      +12     
+ Misses        193      179      -14     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drop unmaintained netifaces dependency

1 participant