Skip to content

Commit 7f2df4d

Browse files
Fix sphinx build and CI tests
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
1 parent 330ce34 commit 7f2df4d

File tree

9 files changed

+28
-9
lines changed

9 files changed

+28
-9
lines changed

docs/source/reference/available_package_parsers.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ parsers in scancode-toolkit during documentation builds.
1414

1515

1616
.. list-table:: Supported Package Parsers
17-
:widths: 10 10 20 10 10 2
17+
:widths: 10 10 20 10 10 10 2
1818
:header-rows: 1
1919

2020
* - Description
@@ -140,6 +140,13 @@ parsers in scancode-toolkit during documentation builds.
140140
- ``cargo_toml``
141141
- Rust
142142
- https://doc.rust-lang.org/cargo/reference/manifest.html
143+
* - Rust binary
144+
- None
145+
- ``cargo``
146+
- ``linux``, ``win``, ``mac``
147+
- ``rust_binary``
148+
- Rust
149+
- https://github.com/rust-secure-code/cargo-auditable/blob/master/PARSING.md
143150
* - Chef cookbook metadata.json
144151
- ``*/metadata.json``
145152
- ``chef``
@@ -1008,4 +1015,3 @@ parsers in scancode-toolkit during documentation builds.
10081015
- ``windows_executable``
10091016
- None
10101017
- https://en.wikipedia.org/wiki/Portable_Executable
1011-

setup-mini.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ install_requires =
6767
Beautifulsoup4 >= 4.0.0
6868
boolean.py >= 4.0
6969
chardet >= 3.0.0
70-
click >= 6.7, !=7.0
70+
click >= 6.7, !=7.0, !=8.1.8
7171
colorama >= 0.3.9
7272
commoncode >= 32.0.0
7373
container-inspector >= 31.0.0

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ install_requires =
6767
Beautifulsoup4 >= 4.0.0
6868
boolean.py >= 4.0
6969
chardet >= 3.0.0
70-
click >= 6.7, !=7.0
70+
click >= 6.7, !=7.0, !=8.1.8
7171
colorama >= 0.3.9
7272
commoncode >= 32.0.0
7373
container-inspector >= 31.0.0

src/packagedcode/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ class DatafileHandler:
10451045

10461046
# tuple of operating systems where getting package data using this DatafileHandler is supported.
10471047
# If None or empty, all platforms are supported, possible values are win, mac, linux, freebsd
1048-
supported_oses = ('linux', 'win', 'mac')
1048+
supported_oses = None
10491049

10501050
# Sequence of known fnmatch-style case-insensitive glob patterns (e.g., Unix
10511051
# shell style patterns) that apply on the whole POSIX path for package

src/packagedcode/plugin_package.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ def get_available_package_parsers(docs=False):
8989
if cls.datasource_id is None:
9090
raise Exception(cls)
9191

92+
if not cls.supported_oses:
93+
supported_oses = ('linux', 'win', 'mac')
94+
else:
95+
supported_oses = cls.supported_oses
96+
9297
data_packages = {}
9398
if docs:
9499
path_patterns = '\n '.join(f"``{p}``" for p in cls.path_patterns)
@@ -97,11 +102,11 @@ def get_available_package_parsers(docs=False):
97102
else:
98103
data_packages['package_type'] = cls.default_package_type
99104
data_packages['datasource_id'] = f"``{cls.datasource_id}``"
100-
supported_oses = ', '.join(f"``{os_type}``" for os_type in cls.supported_oses)
105+
supported_oses = ', '.join(f"``{os_type}``" for os_type in supported_oses)
101106

102107
else:
103108
path_patterns = ', '.join(repr(p) for p in cls.path_patterns)
104-
supported_oses = ', '.join(repr(os_type) for os_type in cls.supported_oses)
109+
supported_oses = ', '.join(repr(os_type) for os_type in supported_oses)
105110
data_packages['package_type'] = cls.default_package_type
106111
data_packages['datasource_id'] = cls.datasource_id
107112

src/packagedcode/templates/available_package_parsers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ parsers in scancode-toolkit during documentation builds.
1414

1515

1616
.. list-table:: Supported Package Parsers
17-
:widths: 10 10 20 10 10 2
17+
:widths: 10 10 20 10 10 10 2
1818
:header-rows: 1
1919

2020
* - Description

tests/packagedcode/data/plugin/plugins_list_linux.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,13 @@ Package type: cargo
111111
description: Rust Cargo.toml package manifest
112112
path_patterns: '*/Cargo.toml', '*/cargo.toml'
113113
--------------------------------------------
114+
Package type: cargo
115+
datasource_id: rust_binary
116+
documentation URL: https://github.com/rust-secure-code/cargo-auditable/blob/master/PARSING.md
117+
primary language: Rust
118+
description: Rust binary
119+
path_patterns:
120+
--------------------------------------------
114121
Package type: chef
115122
datasource_id: chef_cookbook_metadata_json
116123
documentation URL: https://docs.chef.io/config_rb_metadata/

tests/scancode/data/help/help_linux.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Options:
1616
license/copyright detection and top-level package creation.
1717
-c, --copyright Scan <input> for copyrights.
1818
--go-symbol Collect Go symbols.
19+
--rust-symbol Collect Rust symbols from rust binaries.
1920

2021
other scans:
2122
-i, --info Scan <input> for file information (size, checksums, etc).

tests/scancode/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def test_no_version_check_run_is_successful():
128128

129129

130130
def test_usage_and_help_return_a_correct_script_name_on_all_platforms():
131-
result = run_scan_click(['--help'])
131+
result = run_scan_click(options=['--help'], test_mode=False, retry=False)
132132
assert 'Usage: scancode [OPTIONS]' in result.output
133133
# this was showing up on Windows
134134
assert 'scancode-script.py' not in result.output

0 commit comments

Comments
 (0)