Skip to content

Commit 1759891

Browse files
committed
Merge branch 'RISC_DSE-348-add-license-checking' into 'main'
Risc dse 348 add license checking See merge request common/python-package-template!1
2 parents f7bf419 + 2a4bf56 commit 1759891

3 files changed

Lines changed: 47 additions & 3 deletions

File tree

‎LICENSE‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright © 2023
3+
Copyright © 2024
44

55

66
Permission is hereby granted, free of charge, to any person obtaining a copy

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ A simple [Cookiecutter](https://github.com/cookiecutter/cookiecutter) template f
3838
2. Run:
3939
```sh
4040
cruft create -f https://gitdma.risc-software.at/common/python-package-template
41+
# add for testing: --checkout <BRANCH_NAME>
4142
```
4243
3. Install the environment with `poetry install` and create a container using `docker build -f Dockerfile-test .`
4344
4. [Optional] Update your project template by running `cruft update`

‎{{ cookiecutter.__package_name_kebab_case }}/pyproject.toml‎

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ priority = "explicit"
3131
python = "^{{ cookiecutter.python_version }}"
3232

3333
# https://python-poetry.org/docs/master/managing-dependencies/
34-
[tool.poetry.group.dev.dependencies]
34+
[tool.poetry.group.dev.dependencies]
3535
poethepoet = "^0.20.0"
3636
black = { version = "^23.3.0", extras = ["jupyter"] }
3737
ruff = "^0.0.272"
@@ -43,6 +43,7 @@ pytest-xdist = "^3.3.1"
4343
mkdocs = "^1.4.3"
4444
mkdocs-material = "^9.1.15"
4545
mkdocstrings = {extras = ["python"], version = "^0.22.0"}
46+
liccheck = "^0.9.2"
4647

4748
# https://github.com/nat-n/poethepoet
4849
[tool.poe.tasks]
@@ -77,7 +78,7 @@ testpaths = ["{{ cookiecutter.__package_name_snake_case }}", "tests"]
7778
norecursedirs = [ ]
7879

7980
# https://github.com/charliermarsh/ruff
80-
[tool.ruff]
81+
[tool.ruff]
8182
fix = true
8283
ignore-init-module-imports = true
8384
line-length = 120
@@ -88,3 +89,45 @@ max-doc-length = 120
8889

8990
[tool.ruff.pydocstyle]
9091
convention = "{{ cookiecutter.docstring_style|lower }}"
92+
93+
94+
[tool.liccheck]
95+
# see also: https://pypi.org/project/liccheck/
96+
# Authorized and unauthorized licenses in LOWER CASE
97+
authorized_licenses = [
98+
"bsd",
99+
"new bsd",
100+
"bsd 3-clause",
101+
"bsd license",
102+
"isc license",
103+
"isc license (iscl)",
104+
"apache",
105+
"apache 2.0",
106+
"apache software",
107+
"apache software license",
108+
"apache license, version 2.0",
109+
"gnu lgpl",
110+
"historical permission notice and disclaimer (hpnd)",
111+
"lgpl with exceptions or zpl",
112+
"mozilla public license 2.0 (mpl 2.0)",
113+
"mit",
114+
"mit license",
115+
"new bsd license",
116+
"python software foundation license",
117+
"python software foundation",
118+
"simplified bsd",
119+
"the unlicense (unlicense)",
120+
]
121+
# as_regex = true -> e.g. '\bgpl'
122+
unauthorized_licenses = [
123+
"gpl v3",
124+
"gnu general public license v2 or later (gplv2+)",
125+
]
126+
level = "standard" # alternatives: "cautious", "paranoid"
127+
requirement_txt_file = "./requirements.txt"
128+
reporting_txt_file = "./liccheck_reporting.txt" # by default is None
129+
130+
[tool.liccheck.authorized_packages]
131+
# Python software license (see http://zesty.ca/python/uuid.README.txt)
132+
uuid = "1.30"
133+

0 commit comments

Comments
 (0)