LicenseCheck icon indicating copy to clipboard operation
LicenseCheck copied to clipboard

Bug: --using doesn't seem to work (always uses requirements.txt)

Open flodolo opened this issue 1 year ago • 2 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

I have a folder with multiple requirement files:

  • default.txt
  • dev.txt
  • lint.txt
  • test.txt

licensecheck --using 'requirements:dev.txt' fails with RuntimeError: Could not find specification of requirements (requirements.txt). It looks like licensecheck always searches for requirements.txt.

~On a side note, the documentation in README seems inconsistent around the formatting of multiple requirement files: is it requirements:requirements.txt;requirements_optional.txt or requirements:requirements.txt;requirements:requirements_optional.txt (with requirements: repeated after the semicolon)? Both are used in the explanation.~

System Information

Please provide the following additional information about your system or environment:

  • Operating System (OS): macOS
  • OS Version: 14.6.1

flodolo avatar Sep 27 '24 10:09 flodolo

Should this line be the other way around?

requirementsPaths = extras if len(extras) > 0 else ["requirements.txt"]

UPDATE: double-check the README, can't find the double requirements:, so I must have misread it.

flodolo avatar Sep 27 '24 12:09 flodolo

Hi thanks for opening the issue. Going to take a look at this asap. There is absolutely a logic error there that I did not pick up during a recent refactor!

FredHappyface avatar Oct 08 '24 21:10 FredHappyface

In upcoming versions, I plan to remove the --using argument to improve clarity (and replace it with --requirements-paths and --groups as appropriate). However, some additional testing is required before I release a new version to ensure a smooth transition and provide a clear migration path.

FredHappyface avatar Dec 01 '24 19:12 FredHappyface

The cli interface has been changed in https://github.com/FHPythonUtils/LicenseCheck/releases/tag/2025, hopefully this makes things a little clearer. I'm halfway through writing some better documentation for using the lib. Note that you now need to specify the path to your requirments file such as reqs.txt, pyproject.toml etc

Thanks for your patience on this one :)

FredHappyface avatar Mar 16 '25 16:03 FredHappyface