Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cirrus module: exposed some Starlib builtins and added an env dict #96

Merged
merged 4 commits into from
Sep 21, 2020

Conversation

edigaryev
Copy link
Contributor

See #53.

"http": starlibModules["http"],
"hash": starlibModules["hash"],
"json": starlibModules["json"],
"yaml": starlibModules["yaml"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also add zipfile, re and `base64. Can do here or in a separate PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See 40d9ac2.

return starlark.StringDict{
"fs": &starlarkstruct.Module{
Name: "fs",
Members: builtin.FS(loader.ctx, loader.fs),
},
"env": starlarkEnv,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems we can rename starlibModules to builtinModules and then do something like:

builtinModules["fs"] = ...
builtinModules["env"] = ...
return builtinModules

This way there is no need for duplicated "http", "hash", etc. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See 9645b04.

@edigaryev edigaryev requested a review from fkorotkov September 21, 2020 15:29
@edigaryev edigaryev merged commit 4097c0b into master Sep 21, 2020
@edigaryev edigaryev deleted the starlark-more-modules branch September 21, 2020 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants