Skip to content

Conversation

@Mic92
Copy link
Owner

@Mic92 Mic92 commented Sep 29, 2025

Summary by CodeRabbit

  • New Features
    • Added a configurable module logger for the library.
    • Introduced a thread-safe client example (LockableMPDClient) for serialized access.
  • Documentation
    • Docs now display the project version sourced from the package.
  • Chores
    • Migrated packaging to pyproject.toml; removed setup.py/setup.cfg directives.
    • Updated build and release flow (python -m build, wheel targets).
    • Raised baseline to Python 3.10; test matrix up to 3.14; Makefile defaults to 3.13.
    • Enhanced Nix dev environment with treefmt, ruff, mypy, and multi-Python shells.

@coderabbitai
Copy link

coderabbitai bot commented Sep 29, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This PR migrates packaging to pyproject/setuptools, removes setup.py/setup.cfg directives, updates Makefile and tox targets, adjusts bors and Nix flake config, adds Sphinx versioning from mpd.VERSION, tightens lxml import handling in a doc script, formats examples/tests, adds a logger in mpd.base, and introduces an example LockableMPDClient.

Changes

Cohort / File(s) Summary of changes
Build & packaging migration
pyproject.toml, setup.py, setup.cfg, Makefile, MANIFEST.in, tox.ini, bors.toml, flake.nix
Adopt pyproject/setuptools; remove setup.py and legacy cfg sections; switch build to python -m build; update wheel/twine targets; Python/tooling matrix updates (tox, Nix, dev shells, treefmt/ruff/mypy); adjust MANIFEST exclusion; modify bors settings.
Documentation configuration
doc/conf.py, doc/generate_command_reference.py
Sphinx now derives version/release from mpd.VERSION; import mpd; formatting updates; guarded lxml import with error/exit on missing dependency.
Core library updates
mpd/base.py, mpd/__init__.py, mpd/asyncio.py, mpd/twisted.py
Add module-level logger with NullHandler; minor message/annotation formatting; explicit re-export aliases in init; style-only tweaks in asyncio/twisted modules.
Examples
examples/*
Mostly quoting/import formatting; explicit Exception in errorhandling; new LockableMPDClient class providing serialized access via threading.Lock; no API changes outside example script.
Tests
mpd/tests.py
Formatting, annotation spacing, and literal layout adjustments; no behavioral test changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant L as LockableMPDClient
  participant T as Lock (threading.Lock)
  participant C as MPDClient

  User->>L: with LockableMPDClient() as client
  activate L
  L->>T: acquire()
  note right of T: Serialize access

  User->>L: client.command(args)
  L->>C: delegate command(args)
  C-->>L: result
  L-->>User: result

  User-->>L: exit context
  L->>T: release()
  deactivate L
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

I nibbled through the build vines, neat and light,
Pyproject blooms where setup took its flight.
A hush of logs in base now softly sing,
Docs learn their version from the spring.
With gentle locks, examples glide—
Tests and quotes aligned with pride. 🐇✨

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch new-packaging

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1a2106a and 6f6e543.

⛔ Files ignored due to path filters (1)
  • flake.lock is excluded by !**/*.lock
📒 Files selected for processing (25)
  • MANIFEST.in (0 hunks)
  • Makefile (2 hunks)
  • bors.toml (0 hunks)
  • doc/conf.py (4 hunks)
  • doc/generate_command_reference.py (5 hunks)
  • examples/asyncio_example.py (4 hunks)
  • examples/coverart.py (2 hunks)
  • examples/errorhandling.py (4 hunks)
  • examples/locking.py (2 hunks)
  • examples/logger.py (1 hunks)
  • examples/multitags.py (1 hunks)
  • examples/randomqueue.py (2 hunks)
  • examples/stats.py (3 hunks)
  • examples/stickers.py (3 hunks)
  • examples/twisted_example.py (1 hunks)
  • flake.nix (1 hunks)
  • mpd/__init__.py (1 hunks)
  • mpd/asyncio.py (3 hunks)
  • mpd/base.py (8 hunks)
  • mpd/tests.py (43 hunks)
  • mpd/twisted.py (1 hunks)
  • pyproject.toml (2 hunks)
  • setup.cfg (0 hunks)
  • setup.py (0 hunks)
  • tox.ini (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Mic92 Mic92 merged commit d2ef453 into master Sep 29, 2025
3 of 4 checks passed
@Mic92 Mic92 deleted the new-packaging branch September 29, 2025 13:03
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.

2 participants