Skip to content

feat: improve Python packaging with proper pyproject.toml, dependenci… - #12

Open
EclipseWraith wants to merge 1 commit into
nsb-ucsc:mainfrom
EclipseWraith:feat/python-packaging
Open

EclipseWraith wants to merge 1 commit into
nsb-ucsc:mainfrom
EclipseWraith:feat/python-packaging

Conversation

@EclipseWraith

Copy link
Copy Markdown

Problem

The current pyproject.toml is minimal and has a critical issue: the runtime
dependencies (protobuf, redis) are listed only under [build-system].requires,
which means they are not installed when a user runs pip install. This causes
import errors when attempting to use the NSB Python client.

Changes

python/pyproject.toml

  • Added protobuf and redis[hiredis] as runtime dependencies under [project].dependencies
  • Added requires-python >= 3.7
  • Added project metadata (description, license, authors, repository URLs)
  • Added optional dev dependencies (pytest, pytest-asyncio) installable via pip install -e ".[dev]"
  • Configured setuptools package discovery to include the proto subpackage

python/proto/init.py (new file)

  • Marks the proto directory as a Python package, enabling import proto.nsb_pb2

python/README.md

  • Replaced "Installable Python package coming soon" with working installation instructions
  • Documented both pip install -e . (recommended) and manual setup (alternative) methods

Testing

  • Verified pip install -e . succeeds on both Windows and Ubuntu 24.04 (WSL)
  • Confirmed pip show nsb-client displays correct metadata and dependencies
  • Confirmed protobuf and redis are automatically installed as dependencies

This branch has not been deployed

No deployments
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.

1 participant