Skip to content

design: write down what belongs in the all extra, and why #910

Description

@JarryShaw

Is your feature request related to a problem? Please describe.

The all extra has no written inclusion criterion. It began, in the maintainer's words on #899, as "originally for all deps (when we only had 3 3p engines and crawler deps)", and the library has since grown past that. Today it is a curated list of eight requirements whose three exclusions each rest on a different ad-hoc justification, so a contributor adding a new extra has nothing to check their decision against.

Measured on origin/main:

ALL       DPKT         ['dpkt']
ALL       PyPCAPFile   ['pypcapfile']
ALL       PyShark      ['pyshark']
ALL       Scapy        ['scapy']
ALL       cli          ['emoji']
ALL       crypto       ['cryptography>=3.4']
ALL       vendor       ['requests', 'beautifulsoup4']
EXCLUDED  NGAP         ['pycrate']                        -- size (~238 MB) + LGPL-2.1+ vs BSD-3-Clause
EXCLUDED  PCAP_CT      ['pcap-ct', 'libpcap']             -- published only as pre-releases
EXCLUDED  PyPCAP       ['pypcap']                         -- sdist-only C extension, needs a compiler
EXCLUDED  docs         [Sphinx, furo, ...]                -- not a runtime feature
partial   test         [pytest, pytest-xdist, isort, ...] -- only requests/beautifulsoup4 reach `all`

Three different reasons for three exclusions, and no rule that predicts them. Size, licence, release maturity and build-toolchain requirements are all cited somewhere in pyproject.toml's comments, each argued locally and at length. Nothing says which of those disqualify an extra in general.

Describe the solution you'd like

Decide and write down the criterion — not merely a revised list. The list follows from the rule; a list without one drifts again the next time an extra is added. Candidate axes the current comments already appeal to:

  • Licence — should all ever pull something less permissive than this package's BSD-3-Clause? pycrate is excluded partly for being LGPL-2.1+.
  • Size — is there a threshold? pycrate lands ~238 MB for one 4.9 MB module, a 50x multiplier over the useful part.
  • Release maturity — pcap-ct and libpcap are excluded for being pre-release only.
  • Build requirements — pypcap needs a compiler and libpcap headers, and fails where only the header is present.
  • Audience — is all "every runtime feature an end user might want", or "everything"? vendor (crawler deps) is in, test tooling is mostly out, docs is out. That boundary is real but unstated.

Then reconcile two specific things the audit will surface:

  1. all duplicates other extras' contents inline rather than referencing them. requests[socks]/beautifulsoup4[html5lib] appear in both vendor and all as literals, so the two drift independently — exactly what happened on fix(ngap): source ProcedureCode/ProtocolIE from pycrate, stop the shared -1 mint (#880) #899, where adding pycrate to vendor did not put it in all and the workflow had to ask for both.
  2. test is partial, which is almost certainly right but is currently an accident of which names happen to overlap rather than a decision.

Describe alternatives you've considered

Leaving it and deciding case by case. That is the status quo and it is what produced three incompatible justifications; it also means each new extra costs a fresh argument.

Additional context

Raised by the maintainer on #899: "I think that extra might need some revisit to determine what should fit in and what not … Now that the library grew, a new audit on it should be done."

Answering the narrower question he asked there: cryptography>=3.4 is already fully in all via the crypto extra, so crypto needs no change. pycrate is the live question, and its documented exclusion reasons still hold — adding it would make pip install pypcapkit[all] pull an LGPL-2.1+ dependency silently, which is the specific hazard pyproject.toml's own comment names.

#899 itself is unaffected and needs no change for this: it only touched vendor, and all still excludes pycrate as intended.

No activity

Activity on this issue will appear here.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    choreMaintenance work: tooling, repo hygiene, no library behaviour changedesignA design or decision issue: a pattern being decided rather than a defect or a request

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions