Skip to content

Commit 02f0c38

Browse files
committed
fix: depend on licensedcode data package
Signed-off-by: macayu17 <anayush1406@gmail.com>
1 parent f209798 commit 02f0c38

6 files changed

Lines changed: 60 additions & 3 deletions

File tree

AUTHORS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ The following organizations or individuals have contributed to ScanCode:
1515
- Aryan Kenchappagol @aryanxk02
1616
- Avi Aryan @aviaryan
1717
- Aviral Verma @avirlrma
18+
- Ayush @macayu17
1819
- Ayan Sinha Mahapatra @AyanSinhaMahapatra
1920
- Ayush Jain @aj4ayushjain
2021
- Bruno Oliveira @nicoddemus

CHANGELOG.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ Changelog
44
Next release
55
--------------
66

7+
- Fix the ``scancode-toolkit`` wheel dependencies so the
8+
``licensedcode-data`` package is installed with default installs.
9+
https://github.com/aboutcode-org/scancode-toolkit/issues/5053
10+
711
v33.0.0rc1 - 2026-05-14
812
------------------------
913

pyproject-scancode-toolkit-mini.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ classifiers = [
4747
]
4848

4949
dependencies = [
50+
"licensedcode-data",
5051
"licensedcode-index",
5152
"attrs >= 18.1,!=20.1.0;python_version<'3.11'",
5253
"attrs >= 22.1.0;python_version>='3.11'",
@@ -111,7 +112,7 @@ Homepage = "https://github.com/nexB/scancode-toolkit"
111112

112113
[project.optional-dependencies]
113114
licenses = [
114-
"licensecode-data",
115+
"licensedcode-data",
115116
]
116117

117118
# no impact but added for symmetry with the mini config

pyproject-scancode-toolkit.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ classifiers = [
4747
]
4848

4949
dependencies = [
50+
"licensedcode-data",
5051
"licensedcode-index",
5152
"attrs >= 18.1,!=20.1.0;python_version<'3.11'",
5253
"attrs >= 22.1.0;python_version>='3.11'",
@@ -111,7 +112,7 @@ Homepage = "https://github.com/nexB/scancode-toolkit"
111112

112113
[project.optional-dependencies]
113114
licenses = [
114-
"licensecode-data",
115+
"licensedcode-data",
115116
]
116117

117118
# no impact but added for symmetry with the other pyproject.toml

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Homepage = "https://github.com/nexB/scancode-toolkit"
114114
[project.optional-dependencies]
115115
# no impact but added for symmetry with the other pyproject.toml
116116
licenses = [
117-
"licensecode-data",
117+
"licensedcode-data",
118118
"licensedcode-index",
119119
]
120120

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#
2+
# Copyright (c) nexB Inc. and others. All rights reserved.
3+
# ScanCode is a trademark of nexB Inc.
4+
# SPDX-License-Identifier: Apache-2.0
5+
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
6+
# See https://github.com/nexB/scancode-toolkit for support or download.
7+
# See https://aboutcode.org for more information about nexB OSS projects.
8+
#
9+
10+
from os.path import dirname
11+
from os.path import join
12+
13+
try:
14+
import tomli as tomllib
15+
except ImportError:
16+
import tomllib
17+
18+
19+
root_dir = dirname(dirname(dirname(__file__)))
20+
21+
release_pyprojects = (
22+
"pyproject-scancode-toolkit.toml",
23+
"pyproject-scancode-toolkit-mini.toml",
24+
)
25+
26+
scancode_pyprojects = release_pyprojects + ("pyproject.toml",)
27+
28+
29+
def load_project(pyproject):
30+
with open(join(root_dir, pyproject), "rb") as inp:
31+
pyproject_data = tomllib.load(inp)
32+
return pyproject_data["project"]
33+
34+
35+
def test_scancode_release_wheels_depend_on_license_data_package():
36+
for pyproject in release_pyprojects:
37+
dependencies = load_project(pyproject)["dependencies"]
38+
39+
assert "licensedcode-data" in dependencies
40+
assert "licensedcode-index" in dependencies
41+
42+
43+
def test_scancode_license_extra_uses_licensedcode_data_package():
44+
for pyproject in scancode_pyprojects:
45+
license_dependencies = load_project(pyproject)["optional-dependencies"][
46+
"licenses"
47+
]
48+
49+
assert "licensedcode-data" in license_dependencies
50+
assert "licensecode-data" not in license_dependencies

0 commit comments

Comments
 (0)