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

Use python to expand the cwd instead of environment variables #4882

Merged
merged 5 commits into from Nov 8, 2018

Conversation

ericholscher
Copy link
Member

No description provided.

@@ -218,7 +218,7 @@ def setup_base(self):
# Don't use virtualenv bin that doesn't exist yet
bin_path=None,
# Don't use the project's root, some config files can interfere
cwd='$HOME',
cwd=os.path.expanduser("~"),
Copy link
Member

Choose a reason for hiding this comment

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

I believe this will pass to the docker container the home from outside rather than the one inside docker

Copy link
Member Author

Choose a reason for hiding this comment

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

I wonder if we should just do /, since it doesn't matter what the cwd is, but we just don't want it to be the users directory?

Copy link
Member

Choose a reason for hiding this comment

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

That probably will raise some permission issues #4808 (comment)

I think we just need to edit the LocalBuilder class to allow shell expansions in cwd

Copy link
Member Author

Choose a reason for hiding this comment

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

Good call, updated.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hrm, this still will break on docker though, eh?

Copy link
Member

Choose a reason for hiding this comment

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

If we do the expansion inside the run method it shouldn't, docker overrides all the run command I think

@codecov
Copy link

codecov bot commented Nov 8, 2018

Codecov Report

Merging #4882 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #4882   +/-   ##
=======================================
  Coverage   76.64%   76.64%           
=======================================
  Files         158      158           
  Lines       10054    10054           
  Branches     1271     1271           
=======================================
  Hits         7706     7706           
  Misses       2007     2007           
  Partials      341      341
Impacted Files Coverage Δ
readthedocs/doc_builder/environments.py 87.33% <ø> (ø) ⬆️

Copy link
Contributor

@davidfischer davidfischer left a comment

Choose a reason for hiding this comment

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

This did fix the issue in my testing.

Copy link
Member

@stsewd stsewd left a comment

Choose a reason for hiding this comment

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

Tested this, it doesn't break docker

@ericholscher ericholscher merged commit 3930383 into master Nov 8, 2018
@stsewd stsewd deleted the fix-path-extension branch November 8, 2018 22:54
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