semantic_puppet 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: cc232fb3f2d16e77531d2a52282d78b6e2c020c0
4
- data.tar.gz: 2692a3f0c579ea9ddc068ea79a973d8765b3c407
2
+ SHA256:
3
+ metadata.gz: f3c25c681bbdc25c5314544df8ef06c0ddbd3757af6a5de7fd7b4999bce88c17
4
+ data.tar.gz: e930096e61ccc839c6ccdf11a1b93e34db1446cc12f3c1bce5b352a307aced4b
5
5
  SHA512:
6
- metadata.gz: 913af8f7fa2657363468237d267f2f4de79246f285273a2aaf328038f1f2ff11488001c8bee281ad989ded8401227c878c422963ed208aa14a178084e904cd7a
7
- data.tar.gz: e32a58891d6b026a47dce06b5cd9eec259c3706cf4b30a3ba34345e4ec887df2e04041929c3df8dbc34607b32396fdafee0388350b3adc9fa82147399818ec68
6
+ metadata.gz: 13fed0e5b789b80a9ed8cb2f1f739d9f77e5d5ebe72a73acd53466c969513f165508c1bd7ce62bfea05cd0f19369f5041992c9e0cf86f17cae3199ec32739fb1
7
+ data.tar.gz: e6b4d574369a2f8b82fda07e2ba1847d8bece8665f191e92027121a07d81d01c2bd8e6bb273a71eef435c39e86baa75ab204590c3910061f737d14ef81cf5aa4
@@ -19,11 +19,10 @@ notifications:
19
19
  sudo: false
20
20
 
21
21
  rvm:
22
- - "2.4.1"
23
- - "2.1.9"
24
- - "2.0.0"
25
- - "1.9.3"
22
+ - "2.5.8"
23
+ - "2.6.6"
24
+ - "2.7.2"
26
25
  - "jruby-19mode"
27
26
 
28
27
  jdk:
29
- - oraclejdk8
28
+ - openjdk8
@@ -2,6 +2,10 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
+ ## 1.0.3 - 2021-01-12
6
+ - List failed module install dependencies
7
+ - Add Ruby 2.7 to Travis and AppVeyor
8
+
5
9
  ## 1.0.2 - 2018-03-13
6
10
  - Removed i18n/gettext configuration and string externalization. After further consideration we have decided that
7
11
  as a library, semantic_puppet should not be attempting to configure global localization state and the localization
@@ -0,0 +1 @@
1
+ * @puppetlabs/forge-team @puppetlabs/platform-core
data/README.md CHANGED
@@ -62,10 +62,5 @@ for a list of contributors.
62
62
 
63
63
  ## Maintenance
64
64
 
65
- Maintainers:
66
-
67
- * Jesse Scott, jesse@puppet.com
68
- * Anderson Mills, anderson@puppet.com
69
-
70
65
  Tickets: File at
71
66
  [https://tickets.puppet.com/browse/FORGE](https://tickets.puppet.com/browse/FORGE)
@@ -1,10 +1,11 @@
1
1
  version: 1.0.1.{build}
2
2
  clone_depth: 10
3
+ image: Visual Studio 2019
3
4
  environment:
4
5
  matrix:
5
- - RUBY_VERSION: 193
6
- - RUBY_VERSION: 23-x64
7
- - RUBY_VERSION: 21-x64
6
+ - RUBY_VERSION: 25-x64
7
+ - RUBY_VERSION: 26-x64
8
+ - RUBY_VERSION: 27-x64
8
9
  matrix:
9
10
  fast_finish: true
10
11
  install:
@@ -37,6 +37,15 @@ module SemanticPuppet
37
37
 
38
38
  # @!endgroup
39
39
 
40
+ # Returns the unsatisfiable dependency, if any.
41
+ # @return String
42
+ def unsatisfiable
43
+ @module_dependencies ||= []
44
+ @satisfieds ||= []
45
+
46
+ (@module_dependencies - @satisfieds).first
47
+ end
48
+
40
49
  # Fetches a graph of modules and their dependencies from the currently
41
50
  # configured list of {Source}s.
42
51
  #
@@ -64,10 +73,12 @@ module SemanticPuppet
64
73
  # @param graph [Graph] the root of a dependency graph
65
74
  # @return [Array<ModuleRelease>] the list of releases to act on
66
75
  def resolve(graph)
76
+ @module_dependencies, @satisfieds = nil
77
+
67
78
  catch :next do
68
79
  return walk(graph, graph.dependencies.dup)
69
80
  end
70
- raise UnsatisfiableGraph.new(graph)
81
+ raise UnsatisfiableGraph.new(graph, unsatisfiable)
71
82
  end
72
83
 
73
84
  # Fetches all available releases for the given module name.
@@ -100,6 +111,9 @@ module SemanticPuppet
100
111
  # @param considering [Array<GraphNode>] the set of releases being tested
101
112
  # @return [Array<GraphNode>] the list of releases to use, if successful
102
113
  def walk(graph, dependencies, *considering)
114
+ @satisfieds ||= []
115
+ @module_dependencies ||= []
116
+
103
117
  return considering if dependencies.empty?
104
118
 
105
119
  # Selecting a dependency from the collection...
@@ -113,6 +127,7 @@ module SemanticPuppet
113
127
 
114
128
  # ... we'll iterate through the list of possible versions in order.
115
129
  preferred_releases(deps).reverse_each do |dep|
130
+ @module_dependencies |= [name]
116
131
 
117
132
  # We should skip any releases that violate any module's constraints.
118
133
  unless [graph, *considering].all? { |x| x.satisfies_constraints?(dep) }
@@ -125,6 +140,8 @@ module SemanticPuppet
125
140
  next
126
141
  end
127
142
 
143
+ @satisfieds |= [name]
144
+
128
145
  catch :next do
129
146
  # After adding any new dependencies and imposing our own constraints
130
147
  # on existing dependencies, we'll mark ourselves as "under
@@ -3,13 +3,19 @@ require 'semantic_puppet/dependency'
3
3
  module SemanticPuppet
4
4
  module Dependency
5
5
  class UnsatisfiableGraph < StandardError
6
- attr_reader :graph
6
+ attr_reader :graph, :unsatisfied
7
7
 
8
- def initialize(graph)
8
+ def initialize(graph, unsatisfied = nil)
9
9
  @graph = graph
10
10
 
11
11
  deps = sentence_from_list(graph.modules)
12
- super "Could not find satisfying releases for #{deps}"
12
+
13
+ if unsatisfied
14
+ @unsatisfied = unsatisfied
15
+ super "Could not find satisfying releases of #{unsatisfied} for #{deps}"
16
+ else
17
+ super "Could not find satisfying releases for #{deps}"
18
+ end
13
19
  end
14
20
 
15
21
  private
@@ -1,3 +1,3 @@
1
1
  module SemanticPuppet
2
- VERSION = '1.0.2'
2
+ VERSION = '1.0.3'
3
3
  end
@@ -5,7 +5,7 @@ describe SemanticPuppet::Dependency::UnsatisfiableGraph do
5
5
 
6
6
  let(:modules) { %w[ foo bar baz ] }
7
7
  let(:graph) { double('Graph', :modules => modules) }
8
- let(:instance) { described_class.new(graph) }
8
+ let(:instance) { described_class.new(graph, ['a']) }
9
9
 
10
10
  subject { instance }
11
11
 
@@ -40,7 +40,7 @@ describe SemanticPuppet::Dependency do
40
40
  end
41
41
 
42
42
  context 'with one source' do
43
- let(:source) { double('Source') }
43
+ let(:source) { double('Source', :priority => 0) }
44
44
 
45
45
  before { SemanticPuppet::Dependency.add_source(source) }
46
46
 
@@ -109,9 +109,9 @@ describe SemanticPuppet::Dependency do
109
109
  end
110
110
 
111
111
  context 'with multiple sources' do
112
- let(:source1) { double('SourceOne') }
113
- let(:source2) { double('SourceTwo') }
114
- let(:source3) { double('SourceThree') }
112
+ let(:source1) { double('SourceOne', :priority => 0) }
113
+ let(:source2) { double('SourceTwo', :priority => 0) }
114
+ let(:source3) { double('SourceThree', :priority => 0) }
115
115
 
116
116
  before do
117
117
  SemanticPuppet::Dependency.add_source(source1)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semantic_puppet
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet Labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-13 00:00:00.000000000 Z
11
+ date: 2021-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -107,6 +107,7 @@ files:
107
107
  - ".travis.yml"
108
108
  - ".yardopts"
109
109
  - CHANGELOG.md
110
+ - CODEOWNERS
110
111
  - Gemfile
111
112
  - LICENSE
112
113
  - README.md
@@ -151,8 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
152
  - !ruby/object:Gem::Version
152
153
  version: '0'
153
154
  requirements: []
154
- rubyforge_project:
155
- rubygems_version: 2.6.8
155
+ rubygems_version: 3.0.8
156
156
  signing_key:
157
157
  specification_version: 4
158
158
  summary: Useful tools for working with Semantic Versions.