Support PEP 561 Distributing and Packaging Type Information (py.typed marker)

Open
#29 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

  • #32 by @Anurag-S1ngh — closed without merging

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
60/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
tooling

Research direction

Start by reading the current pip_requirements_parser.py layout and the PEP 561 requirements for distributing py.typed. Check how the package is built and imported before evaluating the module-to-package rewrite; done means the installed package exposes its type information while preserving existing imports, with Mypy coverage considered separately.

Written by the indexing model from the issue text.

Description

Package maintainers who wish to support type checking of their code MUST add a marker file named py.typed to their package supporting typing.

The package already has type annotations correctly in most places. In order for users of the package to have seamless type-checking, a py.typed marker is required.

Optionally, type checking using Mypy can be introduced to verify correctness of the public API.

There's a minor note in the PEP:

This PEP does not support distributing typing information as part of module-only distributions or single-file modules within namespace packages.

Which means the module will need to be rewritten from pip_requirements_parser.py to pip_requirements_parser/__init__.py.

I'm open to submit a PR; in case there's some budget to review/release.

Dominant language
Python
Stars
20
Forks
17
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aboutcode-org/pip-requirements-parser

All issues in aboutcode-org/pip-requirements-parser

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.