Skip to content

Add keep_symlinks option and disable it by default - #22

Open
HyukjinKwon wants to merge 1 commit into
jcrist:masterfrom
HyukjinKwon:disable-symbolic-links-by-default
Open

HyukjinKwon wants to merge 1 commit into
jcrist:masterfrom
HyukjinKwon:disable-symbolic-links-by-default

Conversation

@HyukjinKwon

Copy link
Copy Markdown

This PR:

  • Adds keep_symlinks (--keep-symlinks in CLI) option disabled by default. By default, it will now copy the files referred by symbolic links.
  • Deprecates zip_symlinks (--zip-symlinks in CLI) option that used to only work with zip format. Now it works with other formats too.

Resolves #5

The rationale here is:

  • The downside is copying and it takes more time but we can make it it working everywhere, which is probably the main reason of packing a virtual environment, and also pretty important in distributed environments.
  • Presumably most of issues related to the path and prefixes will go away by doing this.
  • We can just simply copy by default first and incrementally whitelist the "safe" links like relative paths.

I added unittests and manually tested CLI after installing, for example:

venv-pack --keep-symlinks -o pyspark_venv-keep-symlinks.tar.gz
venv-pack --zip-symlinks -o pyspark_venv-zip_symlinks.tar.gz
venv-pack  -o pyspark_venv.tar.gz

@HyukjinKwon

HyukjinKwon commented Jan 4, 2021 •

Copy link
Copy Markdown
Author

The tests look already failing in the master branch ... Without this PR, the same tests fails in the master branch.

This branch has not been deployed

No deployments
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.

Add option to include python in environment

1 participant