LicenseCheck icon indicating copy to clipboard operation
LicenseCheck copied to clipboard

Bug: Using requirements file ignores versions specified inside file

Open kyleromero98 opened this issue 1 year ago • 0 comments

Before You Begin

Before proceeding, please make sure to follow these steps:

  • [x] I have checked for similar issues in the project's issue tracker.
  • [x] I have searched closed issues to see if a similar problem was reported before.

Issue Details

Bug: Using requirements file ignores versions specified inside file

Description

Reproduction steps:

EITHER 1 - Activate a virtual environment with some dependency version x.x 2 - Run licensecheck specifying --using on a requirements file in project with versions specified of form ==, ensure that the same dependency with different version y.y is specified 3 - Observe that licensecheck will use version in the virtual environment instead of version in requirements.txt OR 1 - Activate a virtual environment without a dependency x inside of requirements file 2 - Run licensecheck specifying --using on a requirements file which contains dependency x with a version of the form ==, ensure that version is not the latest version of dependency x 3 - Observe that licensecheck uses the latest version scraped from pypi to provide license info

Appears related to the strategy used for loading metadata (using metadata package loads the information from currently running Python environment) or using Pypi if metadata is not found using metadata package. Since this is kind of a large change in strategy, it might be more of a feature than bug.

Workaround

Existing functionality kind of requires that users are inside of a virtual environment created with their requirements file that they are running licensecheck on in order to get proper version information.

Expected Behavior

licensecheck should honor the frozen version inside of requirements.txt regardless of Python environment

Actual Behavior

Described in reproduction steps.

System Information

  • Operating System (OS): Windows
  • OS Version: 11

kyleromero98 avatar Jun 19 '24 17:06 kyleromero98