|
2 | 2 |
|
3 | 3 | ## Basic Example Use
|
4 | 4 |
|
5 |
| - |
| 5 | +Per the main README... More examples are available [here](examples.md) |
| 6 | + |
| 7 | +### Using pyproject.toml (default if not piping input) |
| 8 | + |
| 9 | +```txt |
| 10 | +>> licensecheck |
| 11 | +
|
| 12 | +... |
| 13 | + List Of Packages |
| 14 | +┏━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ |
| 15 | +┃ Compatible ┃ Package ┃ License(s) ┃ |
| 16 | +┡━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ |
| 17 | +│ ✔ │ appdirs │ MIT LICENSE │ |
| 18 | +│ ✔ │ attrs │ MIT LICENSE │ |
| 19 | +│ ✔ │ boolean-py │ BSD-2-CLAUSE │ |
| 20 | +│ ✔ │ cattrs │ MIT LICENSE │ |
| 21 | +│ ✔ │ certifi │ MOZILLA PUBLIC LICENSE 2.0 _MPL 2.0_ │ |
| 22 | +│ ✔ │ charset-normalizer │ MIT LICENSE │ |
| 23 | +│ ✔ │ colorama │ BSD LICENSE │ |
| 24 | +│ ✔ │ fhconfparser │ MIT LICENSE │ |
| 25 | +│ ✔ │ idna │ BSD LICENSE │ |
| 26 | +│ ✔ │ license-expression │ APACHE-2.0 │ |
| 27 | +│ ✔ │ loguru │ MIT LICENSE │ |
| 28 | +│ ✔ │ markdown │ BSD LICENSE │ |
| 29 | +│ ✔ │ markdown-it-py │ MIT LICENSE │ |
| 30 | +│ ✔ │ mdurl │ MIT LICENSE │ |
| 31 | +│ ✔ │ packaging │ APACHE SOFTWARE LICENSE;; BSD LICENSE │ |
| 32 | +│ ✔ │ platformdirs │ MIT LICENSE │ |
| 33 | +│ ✔ │ pygments │ BSD LICENSE │ |
| 34 | +│ ✔ │ requests │ APACHE SOFTWARE LICENSE │ |
| 35 | +│ ✔ │ requests-cache │ BSD LICENSE │ |
| 36 | +│ ✔ │ requirements-parser │ APACHE SOFTWARE LICENSE │ |
| 37 | +│ ✔ │ rich │ MIT LICENSE │ |
| 38 | +│ ✔ │ setuptools │ MIT LICENSE │ |
| 39 | +│ ✔ │ six │ MIT LICENSE │ |
| 40 | +│ ✔ │ tomli │ MIT LICENSE │ |
| 41 | +│ ✔ │ types-setuptools │ APACHE SOFTWARE LICENSE │ |
| 42 | +│ ✔ │ url-normalize │ MIT LICENSE │ |
| 43 | +│ ✔ │ urllib3 │ MIT LICENSE │ |
| 44 | +│ ✔ │ uv │ APACHE SOFTWARE LICENSE;; MIT LICENSE │ |
| 45 | +│ ✔ │ win32-setctime │ MIT LICENSE │ |
| 46 | +└────────────┴─────────────────────┴───────────────────────────────────────┘ |
| 47 | +
|
| 48 | +``` |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | +### Use csv format |
| 53 | + |
| 54 | +```csv |
| 55 | +>>> licensecheck --only-licenses mit apache --show-only-failing -f csv |
| 56 | +name,version,size,homePage,author,license,licenseCompat,errorCode,namever |
| 57 | +Markdown,3.7,361400,UNKNOWN,"Manfred Stienstra, Yuri Takhteyev",BSD LICENSE,False,0,Markdown-3.7 |
| 58 | +Pygments,2.19.1,4508396,UNKNOWN,UNKNOWN,BSD LICENSE,False,0,Pygments-2.19.1 |
| 59 | +boolean.py,4.0,109354,https://github.com/bastikr/boolean.py,Sebastian Kraemer,BSD-2-CLAUSE,False,0,boolean.py-4.0 |
| 60 | +certifi,2025.1.31,305559,https://github.com/certifi/python-certifi,Kenneth Reitz,MOZILLA PUBLIC LICENSE 2.0 _MPL 2.0_,False,0,certifi-2025.1.31 |
| 61 | +colorama,0.4.6,76299,UNKNOWN,UNKNOWN,BSD LICENSE,False,0,colorama-0.4.6 |
| 62 | +idna,3.10,349141,UNKNOWN,UNKNOWN,BSD LICENSE,False,0,idna-3.10 |
| 63 | +requests-cache,1.2.1,174099,https://github.com/requests-cache/requests-cache,Roman Haritonov,BSD LICENSE,False,0,requests-cache-1.2.1 |
| 64 | +``` |
| 65 | + |
| 66 | + |
| 67 | +### Groups |
| 68 | + |
| 69 | +```txt |
| 70 | +uv run licensecheck --only-licenses mit apache --show-only-failing -g dev |
| 71 | +
|
| 72 | +... |
| 73 | +
|
| 74 | + List Of Packages |
| 75 | +┏━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ |
| 76 | +┃ Compatible ┃ Package ┃ License(s) ┃ |
| 77 | +┡━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ |
| 78 | +│ ✖ │ authlib │ BSD LICENSE │ |
| 79 | +│ ✖ │ boolean-py │ BSD-2-CLAUSE │ |
| 80 | +│ ✖ │ certifi │ MOZILLA PUBLIC LICENSE 2.0 _MPL 2.0_ │ |
| 81 | +│ ✖ │ click │ BSD LICENSE │ |
| 82 | +│ ✖ │ colorama │ BSD LICENSE │ |
| 83 | +│ ✖ │ filelock │ THE UNLICENSE _UNLICENSE_ │ |
| 84 | +│ ✖ │ idna │ BSD LICENSE │ |
| 85 | +│ ✖ │ jinja2 │ BSD LICENSE │ |
| 86 | +│ ✖ │ joblib │ BSD LICENSE │ |
| 87 | +... |
| 88 | +``` |
6 | 89 |
|
7 | 90 |
|
8 | 91 | ## Supported tools/ standards
|
9 | 92 |
|
10 | 93 | Licensecheck supports a broad range of different tools and workflows. Though please note that
|
11 |
| -for some of these tools, behaviour may differ from what is expected |
| 94 | +for some of these tools, behaviour may differ from what is expected. We use `uv` for the dependency |
| 95 | +resolution due to the good performance across projects, with a fallback to a native parser in case of |
| 96 | +an error, which will be logged |
| 97 | + |
| 98 | +Note that `uv` supports requirements.in files. If a pyproject.toml, setup.py, or setup.cfg file is |
| 99 | +provided, `uv` will extract the requirements for the relevant project. In testing this seems to have |
| 100 | +broad support for various workflows |
| 101 | + |
| 102 | +In addition to this, `licensecheck` will attempt to determine your project license from a `pyproject.toml` or |
| 103 | +a `setup.cfg` |
12 | 104 |
|
13 | 105 | | Name of tool | Supported | Notes |
|
14 | 106 | | ------------ | --------- | ----- |
|
15 |
| -| Poetry 2.x | ✔ | ??? | |
16 |
| - |
| 107 | +| Poetry 2.x | ✔ | | |
| 108 | +| Poetry 1.x | ✔ | | |
| 109 | +| uv | ✔ | | |
| 110 | +| flit | ✔ | | |
| 111 | + |
| 112 | + |
| 113 | +### 'legacy' setup.cfg example |
| 114 | + |
| 115 | +```ini |
| 116 | +[metadata] |
| 117 | +classifiers = |
| 118 | + License :: OSI Approved :: MIT License |
| 119 | + Programming Language :: Python :: 3.8 |
| 120 | +license = MIT |
| 121 | + |
| 122 | +``` |
| 123 | + |
| 124 | +### Poetry example |
| 125 | + |
| 126 | +```toml |
| 127 | +[tool.poetry] |
| 128 | +name = "mypackage" |
| 129 | +version = "0.1.0" |
| 130 | +description = "A simple Python package" |
| 131 | +license = "MIT" |
| 132 | +authors = [ "Author <[email protected]>"] |
| 133 | +classifiers = [ |
| 134 | + "License :: OSI Approved :: MIT License", |
| 135 | + "Programming Language :: Python :: 3.8" |
| 136 | +] |
| 137 | + |
| 138 | +[tool.poetry.dependencies] |
| 139 | +python = "^3.8" |
| 140 | + |
| 141 | +``` |
| 142 | + |
| 143 | +### Flit example |
| 144 | + |
| 145 | +```toml |
| 146 | +[tool.flit.metadata] |
| 147 | +module = "mypackage" |
| 148 | +description = "A simple Python package" |
| 149 | +license = "MIT" |
| 150 | +classifiers = [ |
| 151 | + "License :: OSI Approved :: MIT License", |
| 152 | + "Programming Language :: Python :: 3.8" |
| 153 | +] |
| 154 | +``` |
17 | 155 |
|
18 | 156 | ## Resolve all deps
|
19 | 157 |
|
|
0 commit comments