question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fully automate updates in pinned requirements file

See original GitHub issue

Description of issue or feature request:

TUF has a requirements-pinned.txt, which pins all direct and transitive dependencies for all supported Python versions. The file is created from the direct, unpinned dependencies listed in requirements.txt, using some shell commands (pip-compile for each Python version, etc.) plus manual dressing (combining files, adding per-version environment markers, etc.): https://github.com/theupdateframework/tuf/blob/f7695dace85444041489b83d5a66cd39c761bbd6/requirements.txt#L26-L42

If a new version becomes available for any of the dependencies listed in requirements-pinned.txt it is usually detected by Dependabot, which automatically bumps the version in a PR and triggers tests, allowing us to immediately detect any breaking updates in direct and transitive dependencies.

However, Dependabot does not patch requirements-pinned.txt upon removal or addition of any direct or transitive dependency, or if any environment markers would need a change, e.g. because Python version support is removed or added. Thus re-running above routine on a regular basis is required, albeit easily missed.

Current behavior: Semi-automatic update of pinned requirements

Expected behavior: Fully-automatic update of pinned requirements.

Available options:

  • Schedule regular run of above routine E.g. in a GitHub cron-style Action. Note that this also requires automation of the manual part, i.e. adding environment makers. Or alternatively, we could add one file per supported Python version, which is what the authors of pip-compile recommend (see jazzband/pip-tools#651).
  • Use state-of-the-art tooling pipenv? poetry?? Do they solve this issue? cc @trishankatdatadog who seems to know about “hypermodern” Python 😃

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
lukpuehcommented, Mar 30, 2021

FYI: I recently did this for in-toto: https://github.com/in-toto/in-toto/pull/438/commits/4ce69eaa45fbc569baa80cef76c5bcd64f2bc685

I think we can do the same here and go back to just using pip-compile without any postediting. Regardless, we should consider pip-compileing automatically on a regular basis to account for changes (addition/removal) in transitive dependencies.

1reaction
trishankatdatadogcommented, Dec 17, 2020
  • Use state-of-the-art tooling pipenv? poetry?? Do they solve this issue? cc @trishankatdatadog who seems to know about “hypermodern” Python 😃

They have their own set of problems: for example

Read more comments on GitHub >

github_iconTop Results From Across the Web

Automated Dependency Updates for Pip_requirements
Renovate supports updating Pip_requirements dependencies. ... Supports requirements.txt and requirements.pip files. The default file pattern is fairly ...
Read more >
How to Update All Python Packages - ActiveState
Pip can be used to upgrade all packages on either Windows or Linux: Output a list of installed packages into a requirements file...
Read more >
Generating a Fully-Qualified and Hashed Python ...
A discussion and script showing how to generate a fully-qualified and hashed requirements file using python.
Read more >
How to Update Requirements Files - PyNWB - Read the Docs
The different requirements files introduced in Software Process section are the ... in installed packages pip check # Update list of pinned requirements...
Read more >
Managing Python Dependencies with Requirements.txt
Requirements.txt files ensure predictable builds, but they don't eliminate dependency problems completely. Watch out for New Vulnerabilities.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found