Skip to Content

Runtime requirement collection

Run with an Odoo-supported Python and packaging available (the suite virtual environment already provides both):

/srv/pmiverse/_pmisuite18/venv/bin/python /srv/pmiverse/_pmiconfig/scripts/fetch/fetch_requirements.py

The script reads local checkouts recursively below /srv/pmiverse/_pmisuite18/repos and writes next to itself:

Output Source directories
requirements-ocb.txt OCB
requirements-oca.txt OCA and OCA-l10n
requirements-pmiverse.txt pmiverse, plus tool repository root requirements below

Use --repos-root PATH or --output-dir PATH to override these locations. Existing output files are replaced. All sources are parsed before writing.

The PMIVerse output also includes existing root requirements.txt files from _pmiconfig, _pmiguidelines, and _pmiregistry below /srv/pmiverse. Use --tools-root PATH to select another parent directory independently of --repos-root. Missing tool requirement files are skipped. Tool repositories are not scanned recursively: historical catalogs, generated outputs, and development requirements are excluded unless explicitly included by a root requirement file and permitted by the usual filtering rules. Local includes remain confined to their owning tool repository.

Maintain module-specific Python dependencies in each PMIVerse repository's root requirements.txt, including dependencies used by migration scripts. Existing files such as pmiverse/pmis-beta/requirements.txt and pmiverse/stock-accounting/requirements.txt are collected automatically into requirements-pmiverse.txt, subject to the exclusions and group precedence below. No collector configuration is needed when adding another repository's file.

The collector discovers requirements.txt, requirement-named .txt/.in files, and .txt/.in files inside requirements/ directories. Local -r and --requirement includes are expanded recursively, with cycle protection. Hidden directories, virtual environments, build outputs, and dev/test/docs/CI paths are skipped. Directory and filename tokens such as test, tests, dev, and development identify non-runtime files. Symlink directories are not followed and includes cannot escape their source tree.

stash, archive, archives, and _to_migrate paths are excluded unless --include-archived is given. Known test packages in TEST_PACKAGES (including freezegun, mock, odoo-test-helper, and unittest-xml-reporting) are excluded even from runtime files; --include-test-packages retains them. Extend the exclusions for a run with repeatable --exclude-package NAME. Classification uses these explicit rules, not inference about arbitrary package names.

Package names and extras are normalized. Within each output, requirements with the same package name and environment marker are combined: extras are united and version constraints are intersected. Thus example plus example==2 becomes example==2; a package without source constraints stays unpinned. Python/platform markers are preserved without evaluating the current machine. Different markers remain separate lines within the owning file.

Across files, OCB supplies the common baseline. A normalized package name present in OCB is omitted from OCA and PMIVerse, even when those groups declare different constraints, extras, or markers. OCA and PMIVerse each retain their own additional requirements, including packages shared between them. For example, PMIVerse's suds-py3 remains in its output even when OCA's optional Spain repository also declares it. Each addon output supplements OCB without assuming the other addon group is installed. Constraints shared between OCA and PMIVerse are not reconciled.

Conflicting exact pins fail instead of selecting an arbitrary version. This is an inventory of declared requirements, not a dependency resolver or lockfile: transitive PyPI dependencies, addon manifest dependencies without requirement files, and conflicts across different markers or output files are not resolved. No network requests, installations, or Git fetches are performed. Constraint files (-c), installer options, editable installs, direct URLs, and other unsupported syntax fail explicitly rather than being silently discarded.

Focused checks from the _pmiconfig root:

PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 /srv/pmiverse/_pmisuite18/venv/bin/python -m pytest -q tests/test_fetch_requirements.py