licensed 3.7.3 → 3.7.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e919e2ec9a285b628baa46bf6688d7ec0c996d799abd776fde4f3edb8b80fe7d
4
- data.tar.gz: 5eb688ce8bf9416b61be54ce32a721afeda344602c649de68c58e415e727da5f
3
+ metadata.gz: 2c460f79af039dfcd0059dafa8c1ce9ea096f5fc869c05ed374a61e9d1504520
4
+ data.tar.gz: 98729cb3117d5642fe1bb6b81a8b5f9781578751407f0425ea2ed0c5842ae0ac
5
5
  SHA512:
6
- metadata.gz: aeee74cfa46d80c77a6a13d41106f6e7f94b9e5e440b9d75e5aea8ef5955a860da3c220bdd5214196cbab425fb29059a174ab97a20881872e0f05efc569adfaf
7
- data.tar.gz: f91d94a0a7a28c5804515f5988a82c87e68257428f042d483fd436d596ce219ec35649e7b2c57cf2e52b44d2d97f6479d57df32d4c4aab40bf2cf51935dedb49
6
+ metadata.gz: 3f5bd011838dc17f8bb74da74b0799da181419718bf96f55ac097af2a077546bba007a1efa2ec8613bd03f345c1f82bf5b97fcad64ebb140ef06a99210ee45db
7
+ data.tar.gz: 79b667beb6bde2a62ec1c53c706a5379f761bc9189f2fd6caf4da10e7e2ca51216f44816fc06721c023f81446c7f1a480ca482cc6b77f53af92dcb1943a535b5
data/CHANGELOG.md CHANGED
@@ -6,6 +6,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## 3.7.5
10
+
11
+ ### Fixed
12
+
13
+ - Python dependency metadata will be correctly parsed from the ouput of `pip show` (https://github.com/github/licensed/pull/555)
14
+
15
+ ## 3.7.4
16
+
17
+ ### Fixed
18
+
19
+ - Licenses for Python dependencies built with Hatchling are correctly found (https://github.com/github/licensed/pull/547)
20
+
9
21
  ## 3.7.3
10
22
 
11
23
  ### Fixed
@@ -631,4 +643,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
631
643
 
632
644
  Initial release :tada:
633
645
 
634
- [Unreleased]: https://github.com/github/licensed/compare/3.7.3...HEAD
646
+ [Unreleased]: https://github.com/github/licensed/compare/3.7.5...HEAD
@@ -42,8 +42,12 @@ module Licensed
42
42
  # folder per https://peps.python.org/pep-0639/
43
43
  def package_license_location(package)
44
44
  dist_info = File.join(package["Location"], package["Name"].gsub("-", "_") + "-" + package["Version"] + ".dist-info")
45
- license_files = File.join(dist_info, "license_files")
46
- return File.exist?(license_files) ? license_files : dist_info
45
+
46
+ license_path = ["license_files", "licenses"]
47
+ .map { |directory| File.join(dist_info, directory) }
48
+ .find { |path| File.exist?(path) }
49
+
50
+ license_path || dist_info
47
51
  end
48
52
 
49
53
  # Returns parsed information for all packages used by the project,
@@ -70,11 +74,13 @@ module Licensed
70
74
  # Returns a hash filled with package info parsed from the email-header formatted output
71
75
  # returned by `pip show`
72
76
  def parse_package_info(package_info)
73
- package_info.lines.each_with_object(Hash.new(0)) { |pkg, a|
77
+ package_info.lines.each_with_object(Hash.new(0)) do |pkg, a|
78
+ next if pkg.start_with?(/^\s/)
79
+
74
80
  k, v = pkg.split(":", 2)
75
81
  next if k.nil? || k.empty?
76
82
  a[k.strip] = v&.strip
77
- }
83
+ end
78
84
  end
79
85
 
80
86
  # Returns the output from `pip list --format=json`
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module Licensed
3
- VERSION = "3.7.3".freeze
3
+ VERSION = "3.7.5".freeze
4
4
 
5
5
  def self.previous_major_versions
6
6
  major_version = Gem::Version.new(Licensed::VERSION).segments.first
data/licensed.gemspec CHANGED
@@ -36,7 +36,6 @@ Gem::Specification.new do |spec|
36
36
  spec.add_development_dependency "rake", ">= 12.3.3"
37
37
  spec.add_development_dependency "minitest", "~> 5.8"
38
38
  spec.add_development_dependency "mocha", "~> 1.0"
39
- spec.add_development_dependency "rubocop", "~> 1.26", "< 1.27"
40
39
  spec.add_development_dependency "rubocop-github", "~> 0.6"
41
40
  spec.add_development_dependency "byebug", "~> 11.1.3"
42
41
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: licensed
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.3
4
+ version: 3.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-17 00:00:00.000000000 Z
11
+ date: 2022-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: licensee
@@ -196,26 +196,6 @@ dependencies:
196
196
  - - "~>"
197
197
  - !ruby/object:Gem::Version
198
198
  version: '1.0'
199
- - !ruby/object:Gem::Dependency
200
- name: rubocop
201
- requirement: !ruby/object:Gem::Requirement
202
- requirements:
203
- - - "~>"
204
- - !ruby/object:Gem::Version
205
- version: '1.26'
206
- - - "<"
207
- - !ruby/object:Gem::Version
208
- version: '1.27'
209
- type: :development
210
- prerelease: false
211
- version_requirements: !ruby/object:Gem::Requirement
212
- requirements:
213
- - - "~>"
214
- - !ruby/object:Gem::Version
215
- version: '1.26'
216
- - - "<"
217
- - !ruby/object:Gem::Version
218
- version: '1.27'
219
199
  - !ruby/object:Gem::Dependency
220
200
  name: rubocop-github
221
201
  requirement: !ruby/object:Gem::Requirement