Skip to main content

selective-deps

Declare file dependencies for test selection and incremental tooling in any language:

pip install selective-deps

This package installs Pydantic and PyYAML. It does not depend on pytest or pytest-selective, register plugins, inspect Python imports, open a graph cache, or run Git. The full pytest-selective package uses this same implementation.

Place a sidecar next to the code that reads an input, for example web/catalog.ts.gv-dependency.yaml:

dependencies:
  - inputs: ["//fixtures/catalog/*.json"]
    kind: content
    reason: The catalog loader reads these files at runtime.

Use .gv-dependencies.yaml for several readers in one directory, adding readers: ["*.ts"] to each rule. Paths are relative to the manifest directory; // anchors a path at the repository root. relative_to: reader resolves unanchored inputs relative to each reader instead. *, ? and whole-segment ** patterns use the same validation as Python declarations.

The adapter supplies a complete tracked-file inventory and the declaration bytes from one snapshot:

from selective_deps import dependency_edges

files = {"web/catalog.ts", "web/catalog.ts.gv-dependency.yaml", "fixtures/catalog/demo.json"}
manifests = {
    "web/catalog.ts.gv-dependency.yaml": b"dependencies:\n  - inputs: ['//fixtures/catalog/*.json']\n    kind: content\n"
}
edges = dependency_edges(manifests, files, revision="checked-out-commit")

The result maps readers to dependencies. kind: import creates ordinary path nodes whose transitive imports the language adapter should follow. kind: content creates @contents:<path> leaf nodes: reading a source file as text does not execute its imports. contents_node(path) and file_of(node) expose these semantics without requiring a caller to reproduce the encoding.

Combine these edges with the native language graph before traversing it. A changed file affects both its ordinary path node and its content node. Include base and head graphs when handling removals. Manifest files themselves are dependencies of their readers, so changing a declaration also selects those readers.

Malformed YAML, duplicate keys, aliases, missing owners, unmatched patterns and an incomplete declaration inventory raise DependencyDeclarationError. Report that error rather than treating a partial graph as proof to skip work. Declaration parsing does not discover undeclared runtime reads or prove test completion.

Metadata

Release files for selective-deps 1.7.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for selective-deps 1.7.2
File Size Uploaded Provenance Actions
selective_deps-1.7.2.tar.gz 9.1 kB With provenance Details for selective_deps-1.7.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for selective-deps 1.7.2
File Interpreter ABI Platform Actions
selective_deps-1.7.2-py3-none-any.whl Python 3 none any Details for selective_deps-1.7.2-py3-none-any.whl

Total release size: 19.6 kB

Release files / selective_deps-1.7.2.tar.gz

Download URL selective_deps-1.7.2.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4650bfb75207c4a65e7eb2206a29a2ff10a392696e9d9577a2a584d834a47720
BLAKE2b-256 checksum
How to use checksums
35edc5c55de93225c82ca0832decb92eddff7cff2823bf50fbdfb8438ec7d66d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Release files / selective_deps-1.7.2-py3-none-any.whl

Download URL selective_deps-1.7.2-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb17c9831b8bb59452fd3582bd07bab05b5686e70934d2efdea983f3acce06ee
BLAKE2b-256 checksum
How to use checksums
4b53b627a7d4da74892d536847e27c23f14aa1da40a3793a5478cf3050c4480f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Security for selective-deps 1.7.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for selective_deps-1.7.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page