Python{2,3} plugins: Make site-packages link relative. #169

Merged
merged 1 commit into from Dec 18, 2015

Conversation

Projects
None yet
3 participants
Member

kyrofa commented Dec 16, 2015

Currently the Python2 and Python3 plugins create a <install>/usr/lib/<pythonversion>/site-packages symlink to <install>/usr/lib/<pythonversion>/dist-packages, but that absolute link doesn't exist when the .snap is installed. This commit makes the link relative instead of absolute so the link stays valid.

This may be worth cherry-picking to 1.x.

Fixes LP: #1523384

- os.path.join(prefix, 'lib', self.python_version,
- 'dist-packages'),
- site_packages_dir)
+ os.symlink('dist-packages', site_packages_dir)
@elopio

elopio Dec 17, 2015

Member

Should we do the same for python3?

@kyrofa

kyrofa Dec 17, 2015

Member

Ah, good call, I didn't even look at python3. Fixing now. I'm going to go ahead and include the fix in this PR since it's small and I'd say it's the same bug.

Member

elopio commented Dec 17, 2015

I think we should have an integration test for this too, simplifying the snapcraft that was mentioned in the bug. Feel free to open a bug for it so we can write it in python once #166 lands.

Member

kyrofa commented Dec 17, 2015

@elopio yeah good idea, both on the test and on waiting, heh. The new bug: https://bugs.launchpad.net/snapcraft/+bug/1527270

@kyrofa kyrofa changed the title from Python2 plugin: Make site-packages link relative. to Python{2,3} plugins: Make site-packages link relative. Dec 17, 2015

Python{2,3} plugins: Make site-packages link relative.
Currently the Python2 and Python3 plugins create a
<install>/usr/lib/<pythonversion>/site-packages symlink to
<install>/usr/lib/<pythonversion>/dist-packages, but that absolute
link doesn't exist when the .snap is installed. This commit
makes the link relative instead of absolute so the link stays
valid.

Fixes LP: #1523384

Signed-off-by: Kyle Fazzari <kyle@canonical.com>

@kyrofa kyrofa added the bug label Dec 17, 2015

Collaborator

sergiusens commented Dec 18, 2015

👍

sergiusens added a commit that referenced this pull request Dec 18, 2015

Merge pull request #169 from kyrofa/bugfix/1523384/make_site_packages…
…_relative_link

Python{2,3} plugins: Make site-packages link relative.

@sergiusens sergiusens merged commit 68257b9 into snapcore:master Dec 18, 2015

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.05%) to 95.823%
Details

@kyrofa kyrofa deleted the kyrofa:bugfix/1523384/make_site_packages_relative_link branch Dec 18, 2015

smoser pushed a commit to smoser/snapcraft that referenced this pull request Sep 14, 2016

kalikiana pushed a commit to kalikiana/snapcraft that referenced this pull request Apr 6, 2017

Merge pull request #169 from kyrofa/bugfix/1523384/make_site_packages…
…_relative_link

Python{2,3} plugins: Make site-packages link relative.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment