镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ The following organizations or individuals have contributed to ScanCode:
- Shrijal Acharya @OctoPie23
- Shivam Chauhan @chashiv
- Shivam Sandbhor @sbs2001
- Shubham Padkonde @Shubham-Padkonde
- Steven Esser @majurg
- Sushant Gupta @susg
- Theodore Aptekarev @piiq
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Changelog
Next release
--------------

- Stop author detections at ``Project-URL`` fields in Python package metadata.
https://github.com/aboutcode-org/scancode-toolkit/issues/5303

- Fix the optional ``licenses`` extra dependency typo to install
``licensedcode-data``.
https://github.com/aboutcode-org/scancode-toolkit/pull/5056
Expand Down
3 changes: 3 additions & 0 deletions src/cluecode/copyrights.py
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,9 @@ def build_detection_from_node(
(r'^Upstream-Author:?$', 'JUNK'),
(r'^Packaged-By:?$', 'JUNK'),

# Python package metadata fields must not extend an author name.
(r'^Project-URL:?$', 'JUNK'),

# Windows XP
(r'^Windows$', 'JUNK'),
(r'^XP$', 'JUNK'),
Expand Down
12 changes: 12 additions & 0 deletions tests/cluecode/data/copyrights_basic/pkg-info-project-urls.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Metadata-Version: 2.4
Name: ansible-core
Version: 2.19.13
Summary: Radically simple IT automation
Author: Ansible Project
Project-URL: Homepage, https://ansible.com/
Project-URL: Source Code, https://github.com/ansible/ansible/
Project-URL: Bug Tracker, https://github.com/ansible/ansible/issues/
Project-URL: CI Azure Pipelines, https://dev.azure.com/ansible/ansible/
Project-URL: Documentation, https://docs.ansible.com/ansible-core

Author: Michael DeHaan (https://github.com/mpdehaan)
8 changes: 8 additions & 0 deletions tests/cluecode/test_copyrights_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,14 @@ def test_is_candidate_should_not_select_lines_made_only_of_punct_and_digits(self
class TestCopyrightDetector(FileBasedTesting):
test_data_dir = os.path.join(os.path.dirname(__file__), 'data')

def test_detect_author_before_project_urls(self):
location = self.get_test_loc('copyrights_basic/pkg-info-project-urls.txt')
expected = [
copyrights.AuthorDetection('Ansible Project', 5, 5),
copyrights.AuthorDetection('Michael DeHaan (https://github.com/mpdehaan)', 12, 12),
]
assert list(copyrights.detect_copyrights(location)) == expected

def test_detect(self):
location = self.get_test_loc('copyrights_basic/essential_smoke-ibm_c.c')
expected = [
Expand Down
Loading