Think Build Implement Repeat
London, UK +44 7367 067226
WhatsApp FOLLOW f in X
Python & Django

Reproducible Environments

Last updated:

Reproducibility is the point

The same code with different dependency versions is different software. Without pinning, a deployment six months later installs different packages and behaves differently.

“It works on my machine” is nearly always a dependency problem, and a lock file eliminates the whole category.

What good practice looks like

  1. Isolated environments per project, always
  2. A lock file with exact versions of everything, including transitive dependencies
  3. Committed to version control, so builds are reproducible
  4. Vulnerability auditing on every build
  5. Scheduled updates, with tests

Update regularly or pay later

Dependencies left for two years cannot be updated individually, because everything has moved several major versions and they depend on each other.

  • Security updates within days
  • Minor updates monthly, with tests
  • Major updates deliberately, one at a time
  • Never all at once after a long gap

Python version too

Python releases have defined support periods. Running an unsupported version means no security fixes and increasing incompatibility with current libraries.

Plan the upgrade before support ends rather than after, when it becomes urgent and everything else has moved on too.

Be selective about what you add

Before adding a packageAsk
Is it maintained?Recent releases, responsive issues
How many dependencies does it bring?Each is more surface
Could we write this?Sometimes twenty lines is better
What is the licence?Occasionally matters commercially
Is it widely used?Abandonment risk

Frequently asked questions

Which tool should we use?

The established options all produce lock files and isolated environments. Pick one and use it consistently across the team.

Should the lock file be committed?

Yes, for applications. It is what makes builds reproducible.

How often should we update?

Security immediately, others monthly. Regular small updates are far cheaper than infrequent large ones.

What about containers?

They pin the environment, and you still need a lock file for the Python packages inside it.

Keep reading

Dependencies untouched for two years?

That is the point at which updates become a project. Worth addressing before it gets worse.

Book a free 30-minute call Get a project estimate WhatsApp us

Related services

What we build for problems like this one

Custom Software DevelopmentWeb DevelopmentMachine Learning