Skip to main content

depvex

depvex generates and checks requirements.txt files from static Python imports. It is designed for a single Python application and for repositories that contain multiple independently managed services.

Core capabilities

  • AST-based detection of import and from ... import ... statements.
  • Standard-library filtering and per-import opt-out with # ignore depvex.
  • Recursive Python-file discovery with built-in ignored directories and YAML ignore_dirs support.
  • Import-module to installed-distribution mapping through importlib.metadata.
  • Version lookup from installed metadata without subprocesses, followed by an optional PyPI fallback.
  • Existing dependency pins are retained when the package remains in use; stale entries are removed during a scan.
  • One-time scan, CI-oriented check, and debounced filesystem watch mode.
  • Per-service requirements files plus a root requirements file for microservice repositories.

Install

Requires Python 3.11+.

python -m pip install depvex

Install PyYAML separately to enable depvex.yaml or depvex.yml:

python -m pip install PyYAML

Intended command interface

depvex --scan .
depvex --check .
depvex --watch .
  • --scan updates requirements files.
  • --check returns exit code 0 when requirements files match the detected imports and 1 otherwise.
  • --watch performs an initial scan and updates files after created or modified Python-file events.

Version note

The new source interface above is not compatible with the older published package, which uses positional commands such as depvex check .. The current source also needs its command dispatcher aligned with the new option-style names before those commands can execute correctly. Install and invoke one version consistently in CI.

Single application

Without configured services, scanning a directory creates or updates its single requirements.txt:

depvex --scan ./my-app

Microservices

Define direct child service folders in depvex.yaml:

micro_servi_folders:
  - api
  - worker

ignore_dirs:
  - tests

Scanning the repository produces:

repository/
├── api/requirements.txt
├── worker/requirements.txt
└── requirements.txt

The root file covers Python files outside api and worker; service-only imports are excluded from it. Watch mode rescans only the affected service when a file changes below a configured service folder.

The current key spelling is micro_servi_folders, and service configuration is read from YAML only. config.json is used for CAPTIVE_PORTAL_URLS and debounce_seconds, not service discovery.

CI

Install the target project's dependencies and the checked-out project before checking, so package metadata is available and the local code is executed:

- run: |
    python -m pip install -r requirements.txt
    python -m pip install .
- run: depvex --check .

check currently reports only an out-of-date result. Run scan, review the requirements diff, and commit expected changes.

Scope and roadmap

Depvex does not resolve dynamic imports or replace a lockfile manager. Its next goals are consistent scan/check calculations, actionable dependency diffs, a canonical microservice configuration key, and automated tests for single-project, microservice, watch, and CI scenarios.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

depvex-0.1.3.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

depvex-0.1.3-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file depvex-0.1.3.tar.gz.

File metadata

  • Download URL: depvex-0.1.3.tar.gz
  • Upload date:
  • Size: 20.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for depvex-0.1.3.tar.gz
Algorithm Hash digest
SHA256 5a1d3b801dcc5c5f6291f30f442001af4b1984f82d162721d95e058d5c95872d
MD5 9768a74076ef926b41670e24f63dc76c
BLAKE2b-256 f956d4363ce19a5885a870f5890e37f25a6352dd021d1bcb4912a7130e04cf03

See more details on using hashes here.

File details

Details for the file depvex-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: depvex-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for depvex-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ac2d8008e1aa6af82a65f8ba7e067b1bfdb57d0ebccbf4367a04877ae6433c83
MD5 f0f1fd581fdd3442649dac14b4c708d1
BLAKE2b-256 3f3730f8920e3735cfcb7ef27bd4f5120866816d0dddf7a9cce005d9b0a30c3a

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

This release

0.1.3 This release

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page