Check declared Python dependencies before running scripts

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

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

Research direction

Start by locating repository-manifest handling for the [dependencies] section, then trace revision validation, activation, and the execution worker entry point. Use packaging for parsing and version comparisons and importlib.metadata for installed versions; done means each stage reports valid, missing, incompatible, or invalid declarations without invoking pip, and worker mismatches fail only the run.

Written by the indexing model from the issue text.

Description

app: scripts complexity: medium status: backlog type: feature
Plugin Version

v0.0.1

Proposed functionality

Read Python requirements from the manifest's [dependencies] section and report whether each declaration is satisfied, missing, incompatible, or invalid.

Check during revision validation, before activation, and when the execution worker starts. Web and worker environments may differ.

Treat malformed requirements as source errors. Missing or incompatible installed packages should be retryable after an administrator fixes the environment, without changing source. A worker mismatch should fail that run with a useful message, not permanently invalidate the active revision.

Do not invoke pip, install packages, or shell out to inspect them. Package installation remains an administrator's responsibility.

Use case

A message naming the missing package and required version is easier to act on than an import traceback during production execution. Worker-side checks also catch differences between deployment images before the Script begins its work.

External dependencies

Use packaging for requirement parsing and version comparisons, and importlib.metadata for installed versions. Coordinate the declaration format with the repository-manifest feature. No additional service is needed.

Dominant language
Python
Stars
8
Forks
0
Avg merge
9h 56m
Merged PRs (30d)
29

Getting set up

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 netbox-community/netbox-scripts

All issues in netbox-community/netbox-scripts

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.