Comments (3)
I solved this by adding the flag pass_filenames: false
- repo: https://github.com/dhatim/python-license-check
rev: '0.6.2'
hooks:
- id: liccheck
pass_filenames: false
from python-license-check.
I solved this by adding the flag
pass_filenames: false
- repo: https://github.com/dhatim/python-license-check rev: '0.6.2' hooks: - id: liccheck pass_filenames: false
I have strategy file as name strategy.ini
and liccheck.ini
so it need to see them. Unfortunately liccheck can't. I also tried configure pyproject.toml
:
[tool.liccheck]
authorized_licenses = [
"BSD",
"new bsd",
"bsd license",
"new bsd license",
"simplified bsd",
"apache",
"apache 2.0",
"apache software license",
"gnu lgpl",
"lgpl with exceptions or zpl",
"isc license",
"isc license (iscl)",
"mit",
"mit license",
"python software foundation license",
"zpl 2.1",
"Apache Software",
"GNU Library or Lesser General Public License (LGPL)",
"Mozilla Public License 2.0 (MPL 2.0)",
"Historical Permission Notice and Disclaimer (HPND)",
"Python Software Foundation",
"3-Clause BSD",
"Apache-2.0",
]
unauthorized_licenses = [
"gpl v3"
]
[tool.liccheck.authorized_packages]
test = "1.0.0"
both give us error.
$ pre-commit run --all-files liccheck
Run Python License Checker...............................................Failed
- hook id: liccheck
- exit code: 1
Need to either configure pyproject.toml or provide an existing strategy file
from python-license-check.
As @commonlawfeature pointed out, it's also working for me with the pass_filenames: false
Another tweak I had to do was use language: system
, since this hook requires to be running in the virtual env that contains all the libraries
- repo: https://github.com/dhatim/python-license-check
rev: master
hooks:
- id: liccheck
pass_filenames: false
language: system
pass_filenames: false
should be set in the .pre-commit-hooks.yaml file contained in this repo
If we don't set that flag, pre-commit will provide the liccheck entry point with any of the files filtered by files: ^(.*requirements.*\.txt|setup\.cfg|setup\.py|pyproject\.toml|liccheck\.ini)$
Thus, it will try to call liccheck requirements.txt setup.py
if you have these 2 files in the repository but liccheck isn't setup to work with positional argument like that so that's why it fails with liccheck: error: unrecognized arguments: pyproject.toml requirements.txt setup.cfg
I'll open a PR shortly with that fix
from python-license-check.
Related Issues (20)
- `or`-ed license check breaks on licenses with "or" in the name HOT 6
- specifying a non-existant strategy file produces no error or warning
- liccheck doesn't notice project licenses in pyproject.toml HOT 1
- DeprecationWarning: pkg_resources is deprecated as an API HOT 1
- Support Python 3.12
- pyproject configuration is not included in readme HOT 3
- Allow use on libraries built with Windows line endings. HOT 2
- Editable requirements (-e) raises "DistributionNotFound: The 'None' distribution was not found"
- support pre-commit hook HOT 1
- pkg_resources.VersionConflict: (pandas 1.3.5 (~/miniconda3/envs/myenv/lib/python3.8/site-packages), Requirement.parse('pandas==1.3.3')) HOT 1
- Normalized package names HOT 2
- Order licenses alphabetically
- Feature Request: Option To Specify Where To Look for License Information
- authorized_packages doesn't work in pyproject.toml HOT 1
- Improve error message in case a requirement is not installed.
- DistributionNotFound: The 'greenlet==1.1.3' distribution was not found and is required by the application HOT 3
- Allow matching with regex
- Dependency Dashboard
- Action Required: Fix Renovate Configuration
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-license-check.