diff --git a/CHANGELOG.md b/CHANGELOG.md index 067b2df..ab0e040 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ patch-level version changes can be found in [commit messages](../../commits/mast - fix issue where onlyLicenses logic caused licensecompat to be `false` when unspecified from the command line - move `cli()` to `cli.py` - add tests for the main entry point +- update deps ## 2024 - 2024/01/27 diff --git a/documentation/reference/README.md b/documentation/reference/README.md index 89bd528..24a7955 100644 --- a/documentation/reference/README.md +++ b/documentation/reference/README.md @@ -6,6 +6,7 @@ A full list of `Licensecheck` project modules. - [Licensecheck](licensecheck/index.md#licensecheck) - [Module](licensecheck/module.md#module) + - [Cli](licensecheck/cli.md#cli) - [Formatter](licensecheck/formatter.md#formatter) - [Get Deps](licensecheck/get_deps.md#get-deps) - [License Matrix](licensecheck/license_matrix.md#license-matrix) diff --git a/documentation/reference/licensecheck/cli.md b/documentation/reference/licensecheck/cli.md new file mode 100644 index 0000000..d4c52f9 --- /dev/null +++ b/documentation/reference/licensecheck/cli.md @@ -0,0 +1,35 @@ +# Cli + +[Licensecheck Index](../README.md#licensecheck-index) / [Licensecheck](./index.md#licensecheck) / Cli + +> Auto-generated documentation for [licensecheck.cli](../../../licensecheck/cli.py) module. + +- [Cli](#cli) + - [cli](#cli) + - [main](#main) + +## cli + +[Show source in cli.py:20](../../../licensecheck/cli.py#L20) + +Cli entry point. + +#### Signature + +```python +def cli() -> None: ... +``` + + + +## main + +[Show source in cli.py:89](../../../licensecheck/cli.py#L89) + +Test entry point. + +#### Signature + +```python +def main(args: dict) -> int: ... +``` \ No newline at end of file diff --git a/documentation/reference/licensecheck/formatter.md b/documentation/reference/licensecheck/formatter.md index 11cbbb7..468fbd7 100644 --- a/documentation/reference/licensecheck/formatter.md +++ b/documentation/reference/licensecheck/formatter.md @@ -14,7 +14,7 @@ ## ansi -[Show source in formatter.py:59](../../../licensecheck/formatter.py#L59) +[Show source in formatter.py:61](../../../licensecheck/formatter.py#L61) Format to ansi. @@ -23,6 +23,7 @@ Format to ansi. ---- - `myLice` *License* - project license - `packages` *list[PackageInfo]* - list of PackageCompats to format. + - `hide_parameters` *list[str]* - list of parameters to ignore in the output. #### Returns @@ -32,7 +33,11 @@ Format to ansi. #### Signature ```python -def ansi(myLice: License, packages: list[PackageInfo]) -> str: ... +def ansi( + myLice: License, + packages: list[PackageInfo], + hide_parameters: list[ucstr] | None = None, +) -> str: ... ``` #### See also @@ -44,7 +49,7 @@ def ansi(myLice: License, packages: list[PackageInfo]) -> str: ... ## markdown -[Show source in formatter.py:123](../../../licensecheck/formatter.py#L123) +[Show source in formatter.py:151](../../../licensecheck/formatter.py#L151) Format to markdown. @@ -53,6 +58,7 @@ Format to markdown. ---- - `myLice` *License* - project license - `packages` *list[PackageInfo]* - list of PackageCompats to format. + - `hide_parameters` *list[str]* - list of parameters to ignore in the output. #### Returns @@ -62,7 +68,11 @@ Format to markdown. #### Signature ```python -def markdown(myLice: License, packages: list[PackageInfo]) -> str: ... +def markdown( + myLice: License, + packages: list[PackageInfo], + hide_parameters: list[ucstr] | None = None, +) -> str: ... ``` #### See also @@ -74,7 +84,7 @@ def markdown(myLice: License, packages: list[PackageInfo]) -> str: ... ## plainText -[Show source in formatter.py:107](../../../licensecheck/formatter.py#L107) +[Show source in formatter.py:128](../../../licensecheck/formatter.py#L128) Format to ansi. @@ -83,6 +93,7 @@ Format to ansi. ---- - `myLice` *License* - project license - `packages` *list[PackageInfo]* - list of PackageCompats to format. + - `hide_parameters` *list[str]* - list of parameters to ignore in the output. #### Returns @@ -92,7 +103,11 @@ Format to ansi. #### Signature ```python -def plainText(myLice: License, packages: list[PackageInfo]) -> str: ... +def plainText( + myLice: License, + packages: list[PackageInfo], + hide_parameters: list[ucstr] | None = None, +) -> str: ... ``` #### See also @@ -104,7 +119,7 @@ def plainText(myLice: License, packages: list[PackageInfo]) -> str: ... ## raw -[Show source in formatter.py:165](../../../licensecheck/formatter.py#L165) +[Show source in formatter.py:206](../../../licensecheck/formatter.py#L206) Format to json. @@ -113,6 +128,7 @@ Format to json. ---- - `myLice` *License* - project license - `packages` *list[PackageInfo]* - list of PackageCompats to format. + - `hide_parameters` *list[str]* - list of parameters to ignore in the output. #### Returns @@ -122,7 +138,11 @@ Format to json. #### Signature ```python -def raw(myLice: License, packages: list[PackageInfo]) -> str: ... +def raw( + myLice: License, + packages: list[PackageInfo], + hide_parameters: list[ucstr] | None = None, +) -> str: ... ``` #### See also @@ -134,7 +154,7 @@ def raw(myLice: License, packages: list[PackageInfo]) -> str: ... ## rawCsv -[Show source in formatter.py:188](../../../licensecheck/formatter.py#L188) +[Show source in formatter.py:236](../../../licensecheck/formatter.py#L236) Format to csv. @@ -143,6 +163,7 @@ Format to csv. ---- - `myLice` *License* - project license - `packages` *list[PackageInfo]* - list of PackageCompats to format. + - `hide_parameters` *list[str]* - list of parameters to ignore in the output. #### Returns @@ -152,7 +173,11 @@ Format to csv. #### Signature ```python -def rawCsv(myLice: License, packages: list[PackageInfo]) -> str: ... +def rawCsv( + myLice: License, + packages: list[PackageInfo], + hide_parameters: list[ucstr] | None = None, +) -> str: ... ``` #### See also @@ -164,7 +189,7 @@ def rawCsv(myLice: License, packages: list[PackageInfo]) -> str: ... ## stripAnsi -[Show source in formatter.py:44](../../../licensecheck/formatter.py#L44) +[Show source in formatter.py:46](../../../licensecheck/formatter.py#L46) Strip ansi codes from a given string. diff --git a/documentation/reference/licensecheck/get_deps.md b/documentation/reference/licensecheck/get_deps.md index e667f01..43b94a0 100644 --- a/documentation/reference/licensecheck/get_deps.md +++ b/documentation/reference/licensecheck/get_deps.md @@ -11,7 +11,23 @@ ## do_get_reqs -[Show source in get_deps.py:61](../../../licensecheck/get_deps.py#L61) +[Show source in get_deps.py:64](../../../licensecheck/get_deps.py#L64) + +Underlying machineary to get requirements. + +#### Arguments + +---- + - `using` *str* - use requirements, poetry or PEP631. + - `skipDependencies` *list[str]* - list of dependencies to skip. + extras (str | None): to-do + pyproject (dict[str, Any]): to-do + - `requirementsPaths` *list[Path]* - to-do + +#### Returns + +------- + - `set[str]` - set of requirement packages #### Signature @@ -19,7 +35,7 @@ def do_get_reqs( using: str, skipDependencies: list[ucstr], - extras: str | None, + extras: list[str], pyproject: dict[str, Any], requirementsPaths: list[Path], ) -> set[ucstr]: ... @@ -33,7 +49,7 @@ def do_get_reqs( ## getDepsWithLicenses -[Show source in get_deps.py:173](../../../licensecheck/get_deps.py#L173) +[Show source in get_deps.py:188](../../../licensecheck/get_deps.py#L188) Get a set of dependencies with licenses and determine license compatibility. @@ -46,6 +62,7 @@ Get a set of dependencies with licenses and determine license compatibility. - `ignoreLicenses` *list[ucstr]* - a list of licenses to ignore (skipped, compat may still be False) - `failLicenses` *list[ucstr]* - a list of licenses to fail (compat=False) + - `onlyLicenses` *list[ucstr]* - a list of allowed licenses (any other license will fail) - `skipDependencies` *list[ucstr]* - a list of dependencies to skip (compat=False) #### Returns @@ -64,6 +81,7 @@ def getDepsWithLicenses( failPackages: list[ucstr], ignoreLicenses: list[ucstr], failLicenses: list[ucstr], + onlyLicenses: list[ucstr], skipDependencies: list[ucstr], ) -> tuple[License, set[PackageInfo]]: ... ``` diff --git a/documentation/reference/licensecheck/index.md b/documentation/reference/licensecheck/index.md index ecf8355..18fe267 100644 --- a/documentation/reference/licensecheck/index.md +++ b/documentation/reference/licensecheck/index.md @@ -5,26 +5,12 @@ > Auto-generated documentation for [licensecheck](../../../licensecheck/__init__.py) module. - [Licensecheck](#licensecheck) - - [cli](#cli) - [Modules](#modules) -## cli - -[Show source in __init__.py:18](../../../licensecheck/__init__.py#L18) - -Cli entry point. - -#### Signature - -```python -def cli() -> None: ... -``` - - - ## Modules - [Module](./module.md) +- [Cli](./cli.md) - [Formatter](./formatter.md) - [Get Deps](./get_deps.md) - [License Matrix](./license_matrix.md) diff --git a/documentation/reference/licensecheck/license_matrix.md b/documentation/reference/licensecheck/license_matrix.md index 3d13737..a3b93f9 100644 --- a/documentation/reference/licensecheck/license_matrix.md +++ b/documentation/reference/licensecheck/license_matrix.md @@ -12,7 +12,7 @@ ## depCompatWMyLice -[Show source in license_matrix.py:135](../../../licensecheck/license_matrix.py#L135) +[Show source in license_matrix.py:136](../../../licensecheck/license_matrix.py#L136) Identify if the end user license is compatible with the dependency license(s). @@ -23,6 +23,7 @@ Identify if the end user license is compatible with the dependency license(s). - `depLice` *list[L]* - dependency license - `ignoreLicenses` *list[L], optional* - list of licenses to ignore. Defaults to None. - `failLicenses` *list[L], optional* - list of licenses to fail on. Defaults to None. + - `onlyLicenses` *list[L], optional* - list of allowed licenses. Defaults to None. #### Returns @@ -37,6 +38,7 @@ def depCompatWMyLice( depLice: list[L], ignoreLicenses: list[L] | None = None, failLicenses: list[L] | None = None, + onlyLicenses: list[L] | None = None, ) -> bool: ... ``` @@ -48,7 +50,7 @@ def depCompatWMyLice( ## liceCompat -[Show source in license_matrix.py:171](../../../licensecheck/license_matrix.py#L171) +[Show source in license_matrix.py:176](../../../licensecheck/license_matrix.py#L176) Identify if the end user license is compatible with the dependency license. @@ -58,6 +60,7 @@ Identify if the end user license is compatible with the dependency license. - `lice` *L* - dependency license :param list[L] ignoreLicenses: list of licenses to ignore. Defaults to None. :param list[L] failLicenses: list of licenses to fail on. Defaults to None. +:param list[L] onlyLicenses: list of allowed licenses. Defaults to None. #### Returns @@ -68,7 +71,11 @@ True if compatible, otherwise False ```python def liceCompat( - myLicense: L, lice: L, ignoreLicenses: list[L], failLicenses: list[L] + myLicense: L, + lice: L, + ignoreLicenses: list[L], + failLicenses: list[L], + onlyLicenses: list[L], ) -> bool: ... ``` @@ -80,7 +87,7 @@ def liceCompat( ## licenseLookup -[Show source in license_matrix.py:54](../../../licensecheck/license_matrix.py#L54) +[Show source in license_matrix.py:55](../../../licensecheck/license_matrix.py#L55) Identify a license from an uppercase string representation of a license. @@ -110,7 +117,7 @@ def licenseLookup(licenseStr: ucstr, ignoreLicenses: list[ucstr] | None = None) ## licenseType -[Show source in license_matrix.py:116](../../../licensecheck/license_matrix.py#L116) +[Show source in license_matrix.py:117](../../../licensecheck/license_matrix.py#L117) Return a list of license types from a license string. diff --git a/documentation/reference/licensecheck/types.md b/documentation/reference/licensecheck/types.md index b899e9f..e58008c 100644 --- a/documentation/reference/licensecheck/types.md +++ b/documentation/reference/licensecheck/types.md @@ -8,13 +8,14 @@ - [License](#license) - [PackageInfo](#packageinfo) - [PackageInfo().__post_init__](#packageinfo()__post_init__) + - [PackageInfo().get_filtered_dict](#packageinfo()get_filtered_dict) - [ucstr](#ucstr) - [ucstr().__new__](#ucstr()__new__) - [printLicense](#printlicense) ## License -[Show source in types.py:54](../../../licensecheck/types.py#L54) +[Show source in types.py:62](../../../licensecheck/types.py#L62) #### Attributes @@ -71,6 +72,25 @@ Set the namever once the object is initialised. def __post_init__(self) -> None: ... ``` +### PackageInfo().get_filtered_dict + +[Show source in types.py:53](../../../licensecheck/types.py#L53) + +Return a filtered dictionary of the object. + +:param list[str] hide_output_parameters: list of parameters to ignore + +#### Returns + +Type: *dict* +filtered dictionary + +#### Signature + +```python +def get_filtered_dict(self, hide_output_parameters: list[str]) -> dict: ... +``` + ## ucstr @@ -110,7 +130,7 @@ def __new__(cls, v: str) -> ucstr: ... ## printLicense -[Show source in types.py:97](../../../licensecheck/types.py#L97) +[Show source in types.py:105](../../../licensecheck/types.py#L105) Output a license as plain text. diff --git a/pyproject.toml b/pyproject.toml index ac04c9d..6eb0f51 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,17 +31,17 @@ python = "^3.8" requests = "<3,>=2.31.0" fhconfparser = "<2026,>=2024.1" tomli = "<3,>=2.0.1" -rich = "<14,>=13.7.0" +rich = "<14,>=13.7.1" requests-cache = "<2,>=1.2.0" -packaging = "<24,>=23.2" +packaging = "<25,>=24.0" loguru = "<2,>=0.7.2" [tool.poetry.group.dev.dependencies] -pytest = "^8.0.2" +pytest = "^8.1.1" handsdown = "^2.1.0" -coverage = "^7.4.3" +coverage = "^7.4.4" ruff = "^0.2.2" -pyright = "^1.1.351" +pyright = "^1.1.354" pytest-loguru = "^0.3.0" [build-system] diff --git a/requirements.txt b/requirements.txt index 9d37c04..11cbc9d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ fhconfparser<2026,>=2024.1 loguru<2,>=0.7.2 -packaging<24,>=23.2 +packaging<25,>=24.0 requests-cache<2,>=1.2.0 requests<3,>=2.31.0 -rich<14,>=13.7.0 +rich<14,>=13.7.1 tomli<3,>=2.0.1 diff --git a/tests/data/advanced_ignore_params.md b/tests/data/advanced_ignore_params.md index f0fe1b1..01f6dc8 100644 --- a/tests/data/advanced_ignore_params.md +++ b/tests/data/advanced_ignore_params.md @@ -23,6 +23,7 @@ Find a list of packages below - Author: example_author - License: MIT - Compatible: True +- Size: 10 ### example1-UNKNOWN @@ -30,3 +31,4 @@ Find a list of packages below - Author: example_author - License: GPL3 - Compatible: False +- Size: 10 diff --git a/tests/data/test_main_tc2.json b/tests/data/test_main_tc2.json index 66826af..28ff70f 100644 --- a/tests/data/test_main_tc2.json +++ b/tests/data/test_main_tc2.json @@ -129,14 +129,14 @@ }, { "name": "packaging", - "version": "23.2", - "size": 171055, + "version": "24.0", + "size": 172524, "homePage": "UNKNOWN", "author": "UNKNOWN", "license": "APACHE SOFTWARE LICENSE;; BSD LICENSE", "licenseCompat": true, "errorCode": 0, - "namever": "packaging-23.2" + "namever": "packaging-24.0" }, { "name": "platformdirs", @@ -173,14 +173,14 @@ }, { "name": "rich", - "version": "13.7.0", - "size": 941546, + "version": "13.7.1", + "size": 941650, "homePage": "https://github.com/Textualize/rich", "author": "Will McGugan", "license": "MIT LICENSE", "licenseCompat": true, "errorCode": 0, - "namever": "rich-13.7.0" + "namever": "rich-13.7.1" }, { "name": "tomli", diff --git a/tests/data/test_main_tc2_expected.json b/tests/data/test_main_tc2_expected.json index 66826af..28ff70f 100644 --- a/tests/data/test_main_tc2_expected.json +++ b/tests/data/test_main_tc2_expected.json @@ -129,14 +129,14 @@ }, { "name": "packaging", - "version": "23.2", - "size": 171055, + "version": "24.0", + "size": 172524, "homePage": "UNKNOWN", "author": "UNKNOWN", "license": "APACHE SOFTWARE LICENSE;; BSD LICENSE", "licenseCompat": true, "errorCode": 0, - "namever": "packaging-23.2" + "namever": "packaging-24.0" }, { "name": "platformdirs", @@ -173,14 +173,14 @@ }, { "name": "rich", - "version": "13.7.0", - "size": 941546, + "version": "13.7.1", + "size": 941650, "homePage": "https://github.com/Textualize/rich", "author": "Will McGugan", "license": "MIT LICENSE", "licenseCompat": true, "errorCode": 0, - "namever": "rich-13.7.0" + "namever": "rich-13.7.1" }, { "name": "tomli", diff --git a/tests/data/test_main_tc4.json b/tests/data/test_main_tc4.json index be823e6..1532caf 100644 --- a/tests/data/test_main_tc4.json +++ b/tests/data/test_main_tc4.json @@ -8,213 +8,171 @@ "packages": [ { "name": "Pygments", - "version": "2.17.2", "homePage": "UNKNOWN", "author": "UNKNOWN", "license": "BSD LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "Pygments-2.17.2" + "errorCode": 0 }, { "name": "aiocontextvars", - "version": "0.2.2", "homePage": "https://github.com/fantix/aiocontextvars", "author": "Fantix King", "license": "BSD LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "aiocontextvars-0.2.2" + "errorCode": 0 }, { "name": "attrs", - "version": "23.2.0", "homePage": "UNKNOWN", "author": "UNKNOWN", "license": "MIT LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "attrs-23.2.0" + "errorCode": 0 }, { "name": "cattrs", - "version": "23.2.3", "homePage": "UNKNOWN", "author": "UNKNOWN", "license": "MIT LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "cattrs-23.2.3" + "errorCode": 0 }, { "name": "certifi", - "version": "2024.2.2", "homePage": "https://github.com/certifi/python-certifi", "author": "Kenneth Reitz", "license": "MOZILLA PUBLIC LICENSE 2.0 (MPL 2.0)", "licenseCompat": true, - "errorCode": 0, - "namever": "certifi-2024.2.2" + "errorCode": 0 }, { "name": "charset-normalizer", - "version": "3.3.2", "homePage": "https://github.com/Ousret/charset_normalizer", "author": "Ahmed TAHRI", "license": "MIT LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "charset-normalizer-3.3.2" + "errorCode": 0 }, { "name": "colorama", - "version": "0.4.6", "homePage": "UNKNOWN", "author": "UNKNOWN", "license": "BSD LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "colorama-0.4.6" + "errorCode": 0 }, { "name": "fhconfparser", - "version": "2024.1", "homePage": "https://github.com/FHPythonUtils/FHConfParser", "author": "FredHappyface", "license": "MIT LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "fhconfparser-2024.1" + "errorCode": 0 }, { "name": "idna", - "version": "3.6", "homePage": "UNKNOWN", "author": "UNKNOWN", "license": "BSD LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "idna-3.6" + "errorCode": 0 }, { "name": "loguru", - "version": "0.7.2", "homePage": "https://github.com/Delgan/loguru", "author": "Delgan", "license": "MIT LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "loguru-0.7.2" + "errorCode": 0 }, { "name": "markdown-it-py", - "version": "3.0.0", "homePage": "UNKNOWN", "author": "UNKNOWN", "license": "MIT LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "markdown-it-py-3.0.0" + "errorCode": 0 }, { "name": "packaging", - "version": "23.2", "homePage": "UNKNOWN", "author": "UNKNOWN", "license": "APACHE SOFTWARE LICENSE;; BSD LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "packaging-23.2" + "errorCode": 0 }, { "name": "platformdirs", - "version": "4.2.0", "homePage": "UNKNOWN", "author": "UNKNOWN", "license": "MIT LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "platformdirs-4.2.0" + "errorCode": 0 }, { "name": "requests", - "version": "2.31.0", "homePage": "https://requests.readthedocs.io", "author": "Kenneth Reitz", "license": "APACHE SOFTWARE LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "requests-2.31.0" + "errorCode": 0 }, { "name": "requests-cache", - "version": "1.2.0", "homePage": "https://github.com/requests-cache/requests-cache", "author": "Roman Haritonov", "license": "BSD LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "requests-cache-1.2.0" + "errorCode": 0 }, { "name": "rich", - "version": "13.7.0", "homePage": "https://github.com/Textualize/rich", "author": "Will McGugan", "license": "MIT LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "rich-13.7.0" + "errorCode": 0 }, { "name": "tomli", - "version": "2.0.1", "homePage": "UNKNOWN", "author": "UNKNOWN", "license": "MIT LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "tomli-2.0.1" + "errorCode": 0 }, { "name": "typing-extensions", - "version": "4.9.0", "homePage": "", "author": "", "license": "PYTHON SOFTWARE FOUNDATION LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "typing-extensions-4.9.0" + "errorCode": 0 }, { "name": "url-normalize", - "version": "1.4.3", "homePage": "https://github.com/niksite/url-normalize", "author": "Nikolay Panov", "license": "MIT LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "url-normalize-1.4.3" + "errorCode": 0 }, { "name": "urllib3", - "version": "2.2.1", "homePage": "UNKNOWN", "author": "UNKNOWN", "license": "MIT LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "urllib3-2.2.1" + "errorCode": 0 }, { "name": "win32-setctime", - "version": "1.1.0", "homePage": "https://github.com/Delgan/win32-setctime", "author": "Delgan", "license": "MIT LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "win32-setctime-1.1.0" + "errorCode": 0 } ] } diff --git a/tests/data/test_main_tc4_expected.json b/tests/data/test_main_tc4_expected.json index be823e6..1532caf 100644 --- a/tests/data/test_main_tc4_expected.json +++ b/tests/data/test_main_tc4_expected.json @@ -8,213 +8,171 @@ "packages": [ { "name": "Pygments", - "version": "2.17.2", "homePage": "UNKNOWN", "author": "UNKNOWN", "license": "BSD LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "Pygments-2.17.2" + "errorCode": 0 }, { "name": "aiocontextvars", - "version": "0.2.2", "homePage": "https://github.com/fantix/aiocontextvars", "author": "Fantix King", "license": "BSD LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "aiocontextvars-0.2.2" + "errorCode": 0 }, { "name": "attrs", - "version": "23.2.0", "homePage": "UNKNOWN", "author": "UNKNOWN", "license": "MIT LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "attrs-23.2.0" + "errorCode": 0 }, { "name": "cattrs", - "version": "23.2.3", "homePage": "UNKNOWN", "author": "UNKNOWN", "license": "MIT LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "cattrs-23.2.3" + "errorCode": 0 }, { "name": "certifi", - "version": "2024.2.2", "homePage": "https://github.com/certifi/python-certifi", "author": "Kenneth Reitz", "license": "MOZILLA PUBLIC LICENSE 2.0 (MPL 2.0)", "licenseCompat": true, - "errorCode": 0, - "namever": "certifi-2024.2.2" + "errorCode": 0 }, { "name": "charset-normalizer", - "version": "3.3.2", "homePage": "https://github.com/Ousret/charset_normalizer", "author": "Ahmed TAHRI", "license": "MIT LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "charset-normalizer-3.3.2" + "errorCode": 0 }, { "name": "colorama", - "version": "0.4.6", "homePage": "UNKNOWN", "author": "UNKNOWN", "license": "BSD LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "colorama-0.4.6" + "errorCode": 0 }, { "name": "fhconfparser", - "version": "2024.1", "homePage": "https://github.com/FHPythonUtils/FHConfParser", "author": "FredHappyface", "license": "MIT LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "fhconfparser-2024.1" + "errorCode": 0 }, { "name": "idna", - "version": "3.6", "homePage": "UNKNOWN", "author": "UNKNOWN", "license": "BSD LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "idna-3.6" + "errorCode": 0 }, { "name": "loguru", - "version": "0.7.2", "homePage": "https://github.com/Delgan/loguru", "author": "Delgan", "license": "MIT LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "loguru-0.7.2" + "errorCode": 0 }, { "name": "markdown-it-py", - "version": "3.0.0", "homePage": "UNKNOWN", "author": "UNKNOWN", "license": "MIT LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "markdown-it-py-3.0.0" + "errorCode": 0 }, { "name": "packaging", - "version": "23.2", "homePage": "UNKNOWN", "author": "UNKNOWN", "license": "APACHE SOFTWARE LICENSE;; BSD LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "packaging-23.2" + "errorCode": 0 }, { "name": "platformdirs", - "version": "4.2.0", "homePage": "UNKNOWN", "author": "UNKNOWN", "license": "MIT LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "platformdirs-4.2.0" + "errorCode": 0 }, { "name": "requests", - "version": "2.31.0", "homePage": "https://requests.readthedocs.io", "author": "Kenneth Reitz", "license": "APACHE SOFTWARE LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "requests-2.31.0" + "errorCode": 0 }, { "name": "requests-cache", - "version": "1.2.0", "homePage": "https://github.com/requests-cache/requests-cache", "author": "Roman Haritonov", "license": "BSD LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "requests-cache-1.2.0" + "errorCode": 0 }, { "name": "rich", - "version": "13.7.0", "homePage": "https://github.com/Textualize/rich", "author": "Will McGugan", "license": "MIT LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "rich-13.7.0" + "errorCode": 0 }, { "name": "tomli", - "version": "2.0.1", "homePage": "UNKNOWN", "author": "UNKNOWN", "license": "MIT LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "tomli-2.0.1" + "errorCode": 0 }, { "name": "typing-extensions", - "version": "4.9.0", "homePage": "", "author": "", "license": "PYTHON SOFTWARE FOUNDATION LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "typing-extensions-4.9.0" + "errorCode": 0 }, { "name": "url-normalize", - "version": "1.4.3", "homePage": "https://github.com/niksite/url-normalize", "author": "Nikolay Panov", "license": "MIT LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "url-normalize-1.4.3" + "errorCode": 0 }, { "name": "urllib3", - "version": "2.2.1", "homePage": "UNKNOWN", "author": "UNKNOWN", "license": "MIT LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "urllib3-2.2.1" + "errorCode": 0 }, { "name": "win32-setctime", - "version": "1.1.0", "homePage": "https://github.com/Delgan/win32-setctime", "author": "Delgan", "license": "MIT LICENSE", "licenseCompat": true, - "errorCode": 0, - "namever": "win32-setctime-1.1.0" + "errorCode": 0 } ] } diff --git a/tests/test_cli.py b/tests/test_cli.py index a7d1ec2..9275f15 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -35,7 +35,7 @@ def aux_file(file: str) -> str: "license": "GPL", "file": aux_file("test_main_tc4.json"), "format": "json", - "hide_output_parameters": ["size"], + "hide_output_parameters": ["size", "version", "namever"], }, 0, ), diff --git a/tests/test_formatter.py b/tests/test_formatter.py index a238ec1..95d506e 100644 --- a/tests/test_formatter.py +++ b/tests/test_formatter.py @@ -46,7 +46,7 @@ def test_advancedMarkdown() -> None: def test_advancedMarkdownIgnoreParams() -> None: - fmt = formatter.markdown(myLice, complexPackages, hide_parameters=["SIZE"]) + fmt = formatter.markdown(myLice, complexPackages) # Path(f"{THISDIR}/data/advanced_ignore_params.md").write_text(fmt, "utf-8") assert fmt == Path(f"{THISDIR}/data/advanced_ignore_params.md").read_text("utf-8")