solve 4.0.2 → 4.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/solve.rb +1 -0
- data/lib/solve/constraint.rb +5 -5
- data/lib/solve/errors.rb +2 -2
- data/lib/solve/gecode_solver.rb +7 -4
- data/lib/solve/ruby_solver.rb +3 -1
- data/lib/solve/solver/serializer.rb +1 -1
- data/lib/solve/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad7362ff0af6c2c0fe2ad74f7e132e095711e849a5e090caa58011c3cb20202b
|
4
|
+
data.tar.gz: 1d0b9bc0ac655338c9fc5f01b2e71b84f6faea85a59a8c7fb723a1e529a63d87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ee08341dc55ef8714590e2d73210591b884e7fff470407fd0ae02948cd1727f632430023abaf681778ff6e320b5efd879d34cbc12d3cd733ab986c148a84390
|
7
|
+
data.tar.gz: f4a260fa3c8edcab43ad8e86a0bbab53bde44dad49a8c6d4ae1fa07c8a4bd81e5bd5f02222268a5174d7df82b0dcd803608c16f5733fe5213b99301429e79557
|
data/lib/solve.rb
CHANGED
data/lib/solve/constraint.rb
CHANGED
@@ -128,12 +128,12 @@ module Solve
|
|
128
128
|
|
129
129
|
OPERATOR_TYPES = {
|
130
130
|
"~>" => :approx,
|
131
|
-
"~"
|
131
|
+
"~" => :approx,
|
132
132
|
">=" => :greater_than_equal,
|
133
133
|
"<=" => :less_than_equal,
|
134
|
-
"="
|
135
|
-
">"
|
136
|
-
"<"
|
134
|
+
"=" => :equal,
|
135
|
+
">" => :greater_than,
|
136
|
+
"<" => :less_than,
|
137
137
|
}.freeze
|
138
138
|
|
139
139
|
COMPARE_FUNS = {
|
@@ -145,7 +145,7 @@ module Solve
|
|
145
145
|
equal: method(:compare_equal),
|
146
146
|
}.freeze
|
147
147
|
|
148
|
-
REGEXP = /^(#{OPERATOR_TYPES.keys.join('|')})\s?(.+)
|
148
|
+
REGEXP = /^(#{OPERATOR_TYPES.keys.join('|')})\s?(.+)$/.freeze
|
149
149
|
|
150
150
|
attr_reader :operator
|
151
151
|
attr_reader :major
|
data/lib/solve/errors.rb
CHANGED
@@ -47,14 +47,14 @@ module Solve
|
|
47
47
|
def to_s
|
48
48
|
s = ""
|
49
49
|
s << "#{@message}\n"
|
50
|
-
s << "Missing artifacts: #{missing_artifacts.join(
|
50
|
+
s << "Missing artifacts: #{missing_artifacts.join(",")}\n" unless missing_artifacts.empty?
|
51
51
|
unless constraints_excluding_all_artifacts.empty?
|
52
52
|
pretty = constraints_excluding_all_artifacts.map { |constraint| "(#{constraint[0]} #{constraint[1]})" }.join(",")
|
53
53
|
s << "Constraints that match no available version: #{pretty}\n"
|
54
54
|
end
|
55
55
|
s << "Demand that cannot be met: #{unsatisfiable_demand}\n" if unsatisfiable_demand
|
56
56
|
unless artifacts_with_no_satisfactory_version.empty?
|
57
|
-
s << "Artifacts for which there are conflicting dependencies: #{artifacts_with_no_satisfactory_version.join(
|
57
|
+
s << "Artifacts for which there are conflicting dependencies: #{artifacts_with_no_satisfactory_version.join(",")}"
|
58
58
|
end
|
59
59
|
s
|
60
60
|
end
|
data/lib/solve/gecode_solver.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require "set"
|
2
|
-
|
2
|
+
require_relative "errors"
|
3
3
|
require_relative "solver/serializer"
|
4
4
|
|
5
5
|
module Solve
|
@@ -102,12 +102,14 @@ module Solve
|
|
102
102
|
# DepSelector timed out trying to find the solution. There may or may
|
103
103
|
# not be a solution.
|
104
104
|
raise Solve::Errors::NoSolutionError.new(
|
105
|
-
"The dependency constraints could not be solved in the time allotted."
|
105
|
+
"The dependency constraints could not be solved in the time allotted."
|
106
|
+
)
|
106
107
|
rescue DepSelector::Exceptions::TimeBoundExceededNoSolution
|
107
108
|
# DepSelector determined there wasn't a solution to the problem, then
|
108
109
|
# timed out trying to determine which constraints cause the conflict.
|
109
110
|
raise Solve::Errors::NoSolutionCauseUnknown.new(
|
110
|
-
"There is a dependency conflict, but the solver could not determine the precise cause in the time allotted."
|
111
|
+
"There is a dependency conflict, but the solver could not determine the precise cause in the time allotted."
|
112
|
+
)
|
111
113
|
end
|
112
114
|
|
113
115
|
# Maps demands to corresponding DepSelector::SolutionConstraint objects.
|
@@ -123,6 +125,7 @@ module Solve
|
|
123
125
|
# already done, artifacts are added to the ds_graph as a necessary side effect.
|
124
126
|
def all_artifacts
|
125
127
|
return @all_artifacts if @all_artifacts
|
128
|
+
|
126
129
|
populate_ds_graph!
|
127
130
|
@all_artifacts
|
128
131
|
end
|
@@ -182,7 +185,7 @@ module Solve
|
|
182
185
|
end
|
183
186
|
|
184
187
|
def build_sorted_solution(unsorted_solution)
|
185
|
-
nodes =
|
188
|
+
nodes = {}
|
186
189
|
unsorted_solution.each do |name, version|
|
187
190
|
nodes[name] = @graph.artifact(name, version).dependencies.map(&:name)
|
188
191
|
end
|
data/lib/solve/ruby_solver.rb
CHANGED
@@ -171,8 +171,10 @@ module Solve
|
|
171
171
|
def requirement_satisfied_by?(requirement, activated, spec)
|
172
172
|
version = spec.version
|
173
173
|
return false unless requirement.constraint.satisfies?(version)
|
174
|
+
|
174
175
|
shared_possibility_versions = possibility_versions(requirement, activated)
|
175
176
|
return false if !shared_possibility_versions.empty? && !shared_possibility_versions.include?(version)
|
177
|
+
|
176
178
|
true
|
177
179
|
end
|
178
180
|
|
@@ -261,7 +263,7 @@ module Solve
|
|
261
263
|
end
|
262
264
|
|
263
265
|
def build_sorted_solution(unsorted_solution)
|
264
|
-
nodes =
|
266
|
+
nodes = {}
|
265
267
|
unsorted_solution.each do |name, version|
|
266
268
|
nodes[name] = @graph.artifact(name, version).dependencies.map(&:name)
|
267
269
|
end
|
data/lib/solve/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solve
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamie Winsor
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2019-12-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: semverse
|
@@ -142,8 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
142
142
|
- !ruby/object:Gem::Version
|
143
143
|
version: '0'
|
144
144
|
requirements: []
|
145
|
-
|
146
|
-
rubygems_version: 2.7.7
|
145
|
+
rubygems_version: 3.0.3
|
147
146
|
signing_key:
|
148
147
|
specification_version: 4
|
149
148
|
summary: A Ruby version constraint solver implementing Semantic Versioning 2.0.0-rc.1
|