nteract / jupyter-paths

:city_sunrise: Pure JavaScript implementation of jupyter --paths --json
BSD 3-Clause "New" or "Revised" License
9 stars 11 forks source link

Replace fs.realpathSync() with path.resolve() #33

Closed nils-werner closed 4 years ago

nils-werner commented 4 years ago

Background for this PR can be found in #32.

This PR replaces fs.realpathSync() with path.resolve(). Both functions can be used to resolve relative paths to absolute paths, but fs.realpathSync() additionally resolves symlinks, too.

If the virtualenv was created using symlinks to the OS Python interpreter (the new default in virtualenv >= 20.0.0), this will make this library escape the virtualenv and return incorrect paths for dataDirs() and configDirs().

To test this PR, do:

virtualenv --symlinks .
ls -l bin/python*                  # make sure you are seeing symlinks

git clone https://github.com/nteract/jupyter-paths.git
cd jupyter-paths

npm install --only=dev

npm test    # this fails

git fetch origin pull/33/head:pr-33
git checkout pr-33
npm test    # this succeeds
rgbkrk commented 4 years ago

Looks like the build failures are not your fault at all. I'm going to merge this and make an issue.

captainsafia commented 4 years ago

Looks like the build failures are not your fault at all. I'm going to merge this and make an issue.

Yeah, we need to do some build maintenance on these packages. Thanks for opening the issues!