Skip to content

docs: add pip install quickstart to README and ship PEP 561 py.typed marker - #320

Open
n24q02m wants to merge 1 commit into
apache:mainfrom
n24q02m:docs/readme-pip-install-and-py-typed
Open

n24q02m wants to merge 1 commit into
apache:mainfrom
n24q02m:docs/readme-pip-install-and-py-typed

Conversation

@n24q02m

@n24q02m n24q02m commented Dec 1, 2026

Copy link
Copy Markdown

Problem

  • README.md jumped directly into C++/CMake build-from-source instructions (## Requirements) without showing end users how to install pre-built pulsar-client wheels via pip, what optional extras (avro, protobuf, functions, all) exist in setup.py, or a minimal producer/consumer quickstart.
  • The pulsar package includes inline type annotations across pulsar/__init__.py, pulsar/asyncio.py, pulsar/tableview.py, and pulsar/schema/schema_avro.py, but did not ship a PEP 561 pulsar/py.typed marker file, preventing type checkers such as mypy and pyright from recognizing those annotations in downstream projects.

Changes

  • README.md:
    • Added a ## Quick install section documenting pip install pulsar-client for Python 3.10–3.15 and optional extras (pulsar-client[avro], pulsar-client[protobuf], pulsar-client[functions], pulsar-client[all]) matching extras_require in setup.py.
    • Added a ## Quickstart section with minimal produce and consume examples using pulsar.Client, create_producer, send, subscribe, receive, acknowledge, and try/finally cleanup.
    • Grouped the existing C++ build prerequisites under ## Building from source -> ### Requirements.
  • pulsar/py.typed:
    • Added an empty (0-byte) PEP 561 marker file.
  • setup.py:
    • Added package_data={'pulsar': ['py.typed']} so the marker file is included in built distributions and wheels.

Verification

  • Verified pulsar/py.typed is 0 bytes.
  • Verified python3 -m py_compile setup.py and setup.py --name --version succeed cleanly.
  • Verified both Python quickstart snippets in README.md parse cleanly with ast.parse and match exported methods in pulsar/__init__.py.
  • Verified an isolated setup.py bdist_wheel build packages pulsar/py.typed (0 bytes) inside the generated .whl.
  • Verified git diff main --check is clean.

…marker

Signed-off-by: Nguyen Quang Minh <135627235+n24q02m@users.noreply.github.com>
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