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

Do a small builder refactor. #1924

Merged
merged 11 commits into from
Jan 15, 2016
Merged

Do a small builder refactor. #1924

merged 11 commits into from
Jan 15, 2016

Conversation

ericholscher
Copy link
Member

This adds:

  • A Local environment for checkout & config reading (Host)
  • A Build environment for pip/conda & doc building (Docker)
  • Refactors how we pass Bash environments around
  • Cleans up the python environment to use internal state

@@ -180,7 +180,6 @@ def setup_base(self):
'--name',
self.version.slug,
'python={python_version}'.format(python_version=self.config.python_version),
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably can lose this comma, but it's not a big deal.

@jakirkham
Copy link
Contributor

Looks cool. Should there be something for virtualenv, as well? Not sure if that's being used. It seems to just add to the correct python to the path so would be simple. ( https://github.com/pypa/virtualenv/blob/18b374dc3eeb0e37aa3ad1b22c442712d9dca103/virtualenv_embedded/activate.sh )

@ericholscher
Copy link
Member Author

True. We're still injecting the bin_path manually, because it varies by command, and we don't want to override the default $PATH -- so bin path's will still be there. We should be setting the Virtualenv default PATH though, +1

@@ -229,6 +222,43 @@ def setup_vcs(self):
raise BuildEnvironmentError('Failed to import project',
status_code=404)

def get_bash_env(self):
"""
Get bash environment variables used for all builder commands.
Copy link
Contributor

Choose a reason for hiding this comment

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

BuildCommand defaults to shell=False, which should be what we're using for almost all commands. Naming/referencing bash here is misleading, these are just env variables as far as subprocess is concerned.

Copy link
Member Author

Choose a reason for hiding this comment

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

We need some way to name them different than the 2 other types of environments we use. Any suggestions?

Copy link
Contributor

Choose a reason for hiding this comment

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

env_vars + get_environment_variables would make sense here

@agjohnson
Copy link
Contributor

It might be good to include a test to ensure how we're settings PATH now. Besides my other notes, this looks good though.

@agjohnson agjohnson added this to the Conda milestone Jan 14, 2016
@jakirkham jakirkham mentioned this pull request Jan 14, 2016
8 tasks
@jakirkham
Copy link
Contributor

The only other point I would raise is the same one we already discussed, @ericholscher. That is we now may have an environment active before it is created. I'm not sure what this will do for virtualenv. With conda, I don't think it will be an issue as long as all conda commands before the environment explicitly exist use the option -n to specify the environment name. Though it would be good to check just to be sure.

@ericholscher
Copy link
Member Author

@jakirkham I went ahead and fixed this by passing an explicit bin_path=None to the environment creation commands. Nice catch.

ericholscher added a commit that referenced this pull request Jan 15, 2016
Do a small builder refactor.
@ericholscher ericholscher merged commit 3185ed0 into master Jan 15, 2016
@stsewd stsewd deleted the fix-conda-env branch August 15, 2018 22:19
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.

None yet

3 participants