Skip to content

Commit 39c4566

Browse files
committed
packagedcode: remove unrelated changes from publiccode PR
1 parent ce55547 commit 39c4566

20 files changed

Lines changed: 30 additions & 407 deletions

src/licensedcode/data/rules/ibpp_intro.RULE

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/licensedcode/data/rules/ibpp_ref.RULE

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/packagedcode/rubygems.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,6 @@ def party_mapper(role, names=[], emails=[]):
706706
models.Party(type=models.party_person, email=email, role=role)
707707
for email in emails
708708
)
709-
return ()
710709

711710

712711
def get_parties(gem_data):

src/packagedcode/spec.py

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -133,40 +133,6 @@ def get_authors(line):
133133
}
134134

135135

136-
def is_ruby_version_constant(value):
137-
"""
138-
Return True if value looks like a Ruby constant expression
139-
that cannot be resolved statically, such as:
140-
Elasticsearch::API::VERSION or MyGem::VERSION
141-
142-
These are dynamic values that reference Ruby constants
143-
and cannot be determined without executing the Ruby code.
144-
145-
For example:
146-
>>> is_ruby_version_constant('Elasticsearch::API::VERSION')
147-
True
148-
>>> is_ruby_version_constant('MyGem::VERSION')
149-
True
150-
>>> is_ruby_version_constant('1.0.0')
151-
False
152-
>>> is_ruby_version_constant("'2.3.4'")
153-
False
154-
>>> is_ruby_version_constant(None)
155-
False
156-
"""
157-
if not value:
158-
return False
159-
# Ruby constants use :: as namespace separator
160-
if '::' in value:
161-
return True
162-
# A bare constant starts with uppercase and has no dots/quotes
163-
# e.g. VERSION (unlikely but possible)
164-
stripped = value.strip('\'"')
165-
if stripped and stripped[0].isupper() and '.' not in stripped:
166-
return True
167-
return False
168-
169-
170136
def parse_spec(location, package_type):
171137
"""
172138
Return a mapping of data parsed from a podspec/gemspec/Pofile/Gemfile file
@@ -185,10 +151,6 @@ def parse_spec(location, package_type):
185151
parsed = parser(line=line)
186152
if parsed:
187153
spec_data[attribute_name] = parsed
188-
189-
version = spec_data.get('version')
190-
if is_ruby_version_constant(version):
191-
spec_data['version'] = None
192154

193155
# description can be in single or multi-lines
194156
# There are many different ways to write description.

tests/licensedcode/data/datadriven/lic1/ibpp.txt

Lines changed: 0 additions & 22 deletions
This file was deleted.

tests/licensedcode/data/datadriven/lic1/ibpp.txt.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

tests/licensedcode/data/datadriven/lic1/wt_ibpp_interference.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

tests/licensedcode/data/datadriven/lic1/wt_ibpp_interference.md.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

tests/licensedcode/test_plugin_license_detection.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -374,30 +374,3 @@ def test_match_reference_license():
374374
must_exist=False,
375375
)
376376
check_json_scan(expected_loc, result_file, regen=REGEN_TEST_FIXTURES)
377-
378-
379-
def test_wt_ibpp_interference_is_detected_in_scan_output():
380-
test_file = test_env.get_test_loc('datadriven/lic1/wt_ibpp_interference.md')
381-
result_file = test_env.get_temp_file('json')
382-
args = [
383-
'--license',
384-
'--license-text',
385-
'--license-text-diagnostics',
386-
'--license-diagnostics',
387-
'--strip-root',
388-
'--json', result_file,
389-
test_file,
390-
]
391-
run_scan_click(args, processes='1')
392-
393-
from commoncode.resource import VirtualCodebase
394-
395-
codebase = VirtualCodebase(result_file)
396-
resource = codebase.get_resource(path='wt_ibpp_interference.md')
397-
398-
assert resource.detected_license_expression == 'bsd-1-clause AND ibpp'
399-
assert any(
400-
match['license_expression'] == 'ibpp'
401-
for detection in resource.license_detections
402-
for match in detection['matches']
403-
)

tests/packagedcode/data/rubygems/gemspec/github.gemspec.expected.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type": "gem",
44
"namespace": null,
55
"name": "github",
6-
"version": null,
6+
"version": "GitHub::VERSION",
77
"qualifiers": {},
88
"subpath": null,
99
"primary_language": "Ruby",
@@ -48,7 +48,7 @@
4848
],
4949
"keywords": [],
5050
"homepage_url": "https://github.com/defunkt/github-gem",
51-
"download_url": null,
51+
"download_url": "https://rubygems.org/downloads/github-GitHub::VERSION.gem",
5252
"size": null,
5353
"sha1": null,
5454
"md5": null,
@@ -162,10 +162,10 @@
162162
"extra_data": {}
163163
}
164164
],
165-
"repository_homepage_url": "https://rubygems.org/gems/github",
166-
"repository_download_url": null,
167-
"api_data_url": "https://rubygems.org/api/v1/versions/github.json",
165+
"repository_homepage_url": "https://rubygems.org/gems/github/versions/GitHub::VERSION",
166+
"repository_download_url": "https://rubygems.org/downloads/github-GitHub::VERSION.gem",
167+
"api_data_url": "https://rubygems.org/api/v2/rubygems/github/versions/GitHub::VERSION.json",
168168
"datasource_id": "gemspec",
169-
"purl": "pkg:gem/github"
169+
"purl": "pkg:gem/github@GitHub::VERSION"
170170
}
171171
]

0 commit comments

Comments
 (0)