Skip to content

pin *all* dependencies in requirements.txt #4198

@candlerb

Description

@candlerb

Environment

  • Python version: 3.5.2
  • NetBox version: 2.7.6

Proposed Functionality

In my opinion, netbox should pin the version of all packages it uses - not just direct dependencies but all descendant dependencies as well.

Use Case

People are repeatedly running into issues where Netbox breaks because a child or grandchild dependency package is at an unexpected version.

I personally hit it in #3460. I hit it again with PyYAML installing the wrong version under Ubuntu 16.04. However there are numerous recent cases in google groups where people have broken systems and the fixes involve upgrading or downgrading random packages (e.g. markdown, django-restframework).

I think Netbox has become unsupportable unless one of two things happen:

  1. Release an official docker container, and this is the only supported artefact - i.e. if you choose to install from pip then you are a developer and get to fix your own problems; or
  2. Netbox pins all dependencies to fixed versions in requirements.txt

There may also be some improvement by getting all users to install in a fresh virtualenv (not polluted by any packages they've already installed, or any OS-supplied python packages), but that doesn't solve the problem completely.

Database Changes

None

External Dependencies

This is to some extent caused by a long-standing bug in pip which does not handle recursive dependencies properly. If A installs B and C, and B and C both depend on D (but with different version requirements), a version of D may be installed which meets one requirements but not both, even though a suitable version which meets both is available.

However even if that bug did not exist, pip3 could still end up installing a version of D which meets the declared requirements of B and C, but for some reason does not work in the context of Netbox. This could be because of some missing dependency (Netbox actually uses D directly but doesn't declare it); or it could be because of some other unexpected interaction.

To take one specific example see this post, where the output of "pip3 list" from an end user is very different to what my own system shows - and by extension, is likely to be different to what the Netbox developers have.

If this happens, it means that (a) developers aren't going to be aware of problems; (b) end-users are going to experience these problems first; and (c) we end up trying to support people's systems with problems we haven't seen before and whose systems are in indeterminate states.

Note: Netbox pins most of its direct dependencies to specific versions, but not Django which it pins to a range.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions