Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script to check for outdated dependencies (GSI 371) #165

Merged
merged 9 commits into from
Oct 4, 2023

Conversation

TheByronHimes
Copy link
Member

This adds a script (scripts/list_outdated_dependencies.py) that is meant to:

  • List outdated capped dependencies based on what is specified.
  • When used with --transitive, list outdated transitive dependencies based on what is pinned in the lock file.

It works by obtaining the latest version of a package from PyPI and seeing whether that version satisfies the version range we have specified.
Uncapped dependencies should therefore always be omitted by this method.

For example, if we required hexkit like this:
hexkit ~= 0.9.0
and the latest version on PyPI is 0.10.x, then the script will see that 0.10.x is not contained within the specifier ~= 0.9.0 and flag it as outdated.
If the specifier were uncapped, e.g. hexkit >= 0.9.0, then it would not be flagged as outdated because 0.10.x also satisfies >= 0.9.0.

Originally, this functionality was proposed to be included in the update_lock.py script. Even though some of the functionality is shared (e.g. examining a modified pyproject.toml), it would have been a shoehorn job. update_lock.py serves to resolve all project dependencies and update the lock files (and it takes some time), while the purpose of this script is to:

  1. Highlight dependency specifiers that might need reconsideration
  2. Display outdated transitive dependencies so we may see if any are so outdated that they warrant a second look at the associated top-level requirement(s).

Cito
Cito previously approved these changes Sep 29, 2023
Copy link
Member

@Cito Cito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work.

Some suggestions below.

scripts/list_outdated_dependencies.py Outdated Show resolved Hide resolved
scripts/list_outdated_dependencies.py Outdated Show resolved Hide resolved
scripts/list_outdated_dependencies.py Outdated Show resolved Hide resolved
scripts/list_outdated_dependencies.py Outdated Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Sep 29, 2023

Pull Request Test Coverage Report for Build 6381922761

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 0.0%

Totals Coverage Status
Change from base Build 6336802662: 0.0%
Covered Lines: 0
Relevant Lines: 72

💛 - Coveralls

KerstenBreuer
KerstenBreuer previously approved these changes Oct 2, 2023
Copy link
Contributor

@KerstenBreuer KerstenBreuer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

scripts/list_outdated_dependencies.py Outdated Show resolved Hide resolved
scripts/list_outdated_dependencies.py Outdated Show resolved Hide resolved
scripts/list_outdated_dependencies.py Outdated Show resolved Hide resolved
scripts/list_outdated_dependencies.py Outdated Show resolved Hide resolved
Make it return Requirement objects to satisfy both use cases

Separate file prevents having to include stringcase in pre-commit-config
Accept arbitrary tuple lengths in print_table
scripts/list_outdated_dependencies.py Outdated Show resolved Hide resolved
scripts/list_outdated_dependencies.py Outdated Show resolved Hide resolved
Cito
Cito previously approved these changes Oct 2, 2023
KerstenBreuer
KerstenBreuer previously approved these changes Oct 2, 2023
@TheByronHimes TheByronHimes merged commit d0e3b0c into main Oct 4, 2023
6 checks passed
@TheByronHimes TheByronHimes deleted the feature/check_for_new_versions_GSI-371 branch October 4, 2023 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants