-
Notifications
You must be signed in to change notification settings - Fork 0
Include changelog links for major release upgrades #29
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
85cd77d
Work out if it's a major or minor or patch update
nickmoreton 696ea55
Adjust helpers to calculate update type
nickmoreton 44741e8
Try to get the changes file from pypi
nickmoreton 3b47730
Links as anchor links in the html report for major updates.
nickmoreton 19d404e
Add the ability to generate AI chat requests for breaking changes in …
nickmoreton 0327e02
Fix failing test following new HTMLReporter changes
nickmoreton 53ec0cd
Fix pumpkin typo
nickmoreton e5bd3f1
Remove update_type property from Package class
nickmoreton 4e0cb8b
Update test to reflect the pumpkin color change
nickmoreton aaed2db
Remove copilot added test file
nickmoreton 8376dbe
Bump developer dependency versions
nickmoreton 9bd3365
Update docs screen capture
nickmoreton 5006aa0
Update readme
nickmoreton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,87 +1,119 @@ | ||
| # Python dependency version checker | ||
| # Dependency Checker | ||
|
|
||
|  | ||
|
|
||
| A tool to report outdated dependencies in Python projects using Poetry. | ||
|
|
||
| ## Table of Contents | ||
|
|
||
| - [Why use this tool?](#why-use-this-tool) | ||
| - [Requirements](#requirements) | ||
| - [Installation](#installation) | ||
| - [Usage](#usage) | ||
| - [Options](#options) | ||
| - [How it works](#how-it-works) | ||
| - [Limitations](#limitations) | ||
|
|
||
| ## Why use this tool? | ||
|
|
||
| If you are using Poetry for python dependency management it can help you to decide if you need to update a dependency or not. | ||
| If you're using Poetry for Python dependency management, this tool helps you decide whether you need to update dependencies. | ||
|
|
||
| e.g. your `pyproject.toml` file may have a version range specified, but it may not be clear if the version in the lock file is the latest allowed by your range in the pyproject.toml file | ||
| For example, your `pyproject.toml` file may have a version range specified, but it may not be clear if the version in the lock file is the latest allowed by your range in the `pyproject.toml` file. | ||
|
|
||
| You could run poetry show [dependency] to get the installed version, then pop over to PyPi to check the latest version but if you have a lot of dependencies, this can be time-consuming, so let this tool do it for you. | ||
| You could run `poetry show [dependency]` to get the installed version, then check PyPI for the latest version. However, if you have many dependencies, this can be time-consuming—let this tool do it for you. | ||
|
|
||
| ## Requirements | ||
|
|
||
| - Python 3.11+ | ||
| - UV https://docs.astral.sh/uv/ | ||
| - [UV](https://docs.astral.sh/uv/) - Python package manager | ||
|
|
||
| ## Installation | ||
|
|
||
| Clone this repository and run the following commands in the root of the project: | ||
| 1. Clone this repository: | ||
|
|
||
| ## Activate the virtual environment | ||
| ```bash | ||
| git clone https://github.com/nm-examples/dependency-checker.git | ||
| cd dependency-checker | ||
| ``` | ||
|
|
||
| This isn't strictly necessary but it is recommended to allow command completion for folder paths when checking a local repository. | ||
| 2. Create and activate a virtual environment (optional but recommended): | ||
|
|
||
| ``` | ||
| uv venv | ||
| source .venv/bin/activate | ||
| ``` | ||
| ```bash | ||
| uv venv | ||
| source .venv/bin/activate | ||
| ``` | ||
|
|
||
| This step isn't strictly necessary but is recommended to enable command completion for folder paths when checking local repositories. | ||
|
|
||
| ## Usage | ||
|
|
||
| ### Basic Commands | ||
|
|
||
| Without activating the virtual environment: | ||
|
|
||
| ``` | ||
| ```bash | ||
| uv run check [-r] [local or remote] | ||
| ``` | ||
|
|
||
| With the virtual environment activated: | ||
|
|
||
| ``` | ||
| ```bash | ||
| check [-r] [local or remote] | ||
| ``` | ||
|
|
||
| If you run `uv check` without any arguments, it will display the help docs. | ||
| If you run the command without any arguments, it will display the help documentation. | ||
|
|
||
| Steps: | ||
| ### Workflow | ||
|
|
||
| - Enter the url for your remote repository or the path to your local repository | ||
| - Choose the branch to checkout and run the report on | ||
| - If multiple Dockerfiles are found, choose the one to inspect | ||
| 1. Enter the URL for your remote repository or the path to your local repository | ||
| 2. Choose the branch to checkout and run the report on | ||
| 3. If multiple Dockerfiles are found, choose the one to inspect | ||
|
|
||
| ## Options | ||
|
|
||
| `-r` - Output a printable report to a file (report.html) View with `open report.html` | ||
|
|
||
| `local` - Check a local repository (a folder relative to the directory this script is run from) | ||
| | Option | Description | | ||
| |--------|-------------| | ||
| | `-r` | Output a printable report to a file (`report.html`). View with `open report.html` | | ||
| | `local` | Check a local repository (a folder relative to the directory this script is run from) | | ||
| | `remote` | Check a remote repository | | ||
|
|
||
| `remote` - Check a remote repository | ||
| ### Getting Help | ||
|
|
||
| Command help is available: | ||
| Command help is available for all commands: | ||
|
|
||
| ``` | ||
| ```bash | ||
| uv run check --help | ||
| uv run check remote --help | ||
| uv run check local --help | ||
| ``` | ||
|
|
||
| ## Limitations | ||
| ## How it works | ||
|
|
||
| - Only works if the Dockerfile uses poetry to install dependencies | ||
| The tool performs the following steps: | ||
|
|
||
| ## How it works | ||
| 1. **Repository handling**: | ||
| - Clones the repository and checks out the specified branch (for remote repositories) | ||
| - Analyzes the local folder (for local repositories) | ||
|
|
||
| 2. **Docker analysis**: | ||
| - Finds and inspects the Dockerfile to identify the Docker image version and Poetry version used | ||
|
|
||
| It will do the following: | ||
| 3. **Dependency extraction**: | ||
| - Builds a new image based on the Dockerfile | ||
| - Exports the dependency list using `poetry export` to `requirements-frozen.txt` | ||
|
|
||
| - clone the repository and checkout the specified branch for a remote repository | ||
| - analyse the local folder if running against a local repository | ||
| - find & inspect the Dockerfile to find the docker image version and poetry version used | ||
| - build a new image based on the Dockerfile image and export the dependency list using poetry export -> requirements-frozen.txt | ||
| - compare each dependency version in requirements-frozen.txt with the latest version on PyPi if it is listed in the pyproject.toml file | ||
| - output the results in the console and indicate if there are any outdated dependencies and/or manual checks required | ||
| - optionally output a report to a file | ||
| 4. **Version comparison**: | ||
| - Compares each dependency version in `requirements-frozen.txt` with the latest version on PyPI | ||
| - Only checks dependencies listed in the `pyproject.toml` file | ||
|
|
||
| e.g. Console output | ||
| 5. **Reporting**: | ||
| - Outputs results in the console indicating outdated dependencies and manual checks required | ||
| - Optionally generates an HTML report file | ||
|
|
||
| ### Example Console Output | ||
|
|
||
|  | ||
|
|
||
| ## Limitations | ||
|
|
||
|  | ||
| - Only works if the Dockerfile uses Poetry to install dependencies |
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.