Bug: --using doesn't seem to work (always uses requirements.txt)
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
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.
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!
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.
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 :)