semantic_puppet 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +4 -5
- data/CHANGELOG.md +4 -0
- data/CODEOWNERS +1 -0
- data/README.md +0 -5
- data/appveyor.yml +4 -3
- data/lib/semantic_puppet/dependency.rb +18 -1
- data/lib/semantic_puppet/dependency/unsatisfiable_graph.rb +9 -3
- data/lib/semantic_puppet/gem_version.rb +1 -1
- data/spec/unit/semantic_puppet/dependency/unsatisfiable_graph_spec.rb +1 -1
- data/spec/unit/semantic_puppet/dependency_spec.rb +4 -4
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f3c25c681bbdc25c5314544df8ef06c0ddbd3757af6a5de7fd7b4999bce88c17
|
4
|
+
data.tar.gz: e930096e61ccc839c6ccdf11a1b93e34db1446cc12f3c1bce5b352a307aced4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13fed0e5b789b80a9ed8cb2f1f739d9f77e5d5ebe72a73acd53466c969513f165508c1bd7ce62bfea05cd0f19369f5041992c9e0cf86f17cae3199ec32739fb1
|
7
|
+
data.tar.gz: e6b4d574369a2f8b82fda07e2ba1847d8bece8665f191e92027121a07d81d01c2bd8e6bb273a71eef435c39e86baa75ab204590c3910061f737d14ef81cf5aa4
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -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
|
data/CODEOWNERS
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
* @puppetlabs/forge-team @puppetlabs/platform-core
|
data/README.md
CHANGED
data/appveyor.yml
CHANGED
@@ -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:
|
6
|
-
- RUBY_VERSION:
|
7
|
-
- RUBY_VERSION:
|
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
|
-
|
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
|
@@ -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.
|
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:
|
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
|
-
|
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.
|