Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Unified Diff: vpython/options.go

Issue 2971403002: [vpython] Enable base wheels, spec merging. (Closed)
Patch Set: fix comment Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « vpython/application/application.go ('k') | vpython/spec/spec.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vpython/options.go
diff --git a/vpython/options.go b/vpython/options.go
index 597b3d904fd40027d30a7a5fcba77b867ded0c57..6367d9f0cbaf431d3f0257122a6ee995a451e49f 100644
--- a/vpython/options.go
+++ b/vpython/options.go
@@ -30,6 +30,11 @@ type Options struct {
// supplied or probed.
DefaultSpec vpython.Spec
+ // BaseWheels is the set of wheels to include in the spec. These will always
+ // be merged into the runtime spec and normalized, such that any duplicate
+ // wheels will be deduplicated.
+ BaseWheels []*vpython.Spec_Package
+
// SpecLoader is the spec.Loader to use to load a specification file for a
// given script.
//
@@ -72,6 +77,10 @@ func (o *Options) resolve(c context.Context) error {
if err := o.ResolveSpec(c); err != nil {
return errors.Annotate(err, "failed to resolve Python script").Err()
}
+ if len(o.BaseWheels) > 0 {
+ o.EnvConfig.Spec = o.EnvConfig.Spec.Clone()
+ o.EnvConfig.Spec.Wheel = append(o.EnvConfig.Spec.Wheel, o.BaseWheels...)
+ }
// If no environment base directory was supplied, create one under the current
// working directory.
« no previous file with comments | « vpython/application/application.go ('k') | vpython/spec/spec.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698