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

A collection of fixes for when prefix != exec_prefix. #634

Closed
wants to merge 6 commits into from

Conversation

shidesthewise
Copy link

Patch version from Hans Meine from the duistutils mail list.
https://mail.python.org/pipermail/distutils-sig/2008-April/009336.html
http://mail.python.org/pipermail/distutils-sig/attachments/20080414/16fb135e/attachment-0001.diff

Add copy_inc_files function to fix issue of lost pyconfig.h.

When sys.exec_prefix and sys.prefix differ the pyconfig.h file
is in $(exec_prefix)/include/python$(version) and that file is
missing in the virtualenv because env/include/python$(version)
is a symlink to $(real_prefix)/include/python$(version).
If --always-copy is used then the two include directories merge.
I added copy_inc_files to symlink (or copy) the individual contents
of prefix include and exec_prefix include into env/include.

Update expected output to match actual output.

Setuptools and pip install line has been on one line instead of two
for awhile.

Add link from test to tests so python setup.py test work as expected.

@@ -0,0 +1 @@
tests
Copy link

Choose a reason for hiding this comment

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

Uhhh, what is this file for?

Oh, symlink. I'd prefer if you just renamed the folder.

Copy link
Member

Choose a reason for hiding this comment

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

Agrred. Don't use symlinks because they are not well supported on Windows. Also, this is unrelated to the rest of the patch. Please remove it and submit as a separate PR specifically stating that it's fixing setup.py test.

@shidesthewise
Copy link
Author

I'll pull out those test-related fixes today or tomorrow as a separate PR.

@shidesthewise
Copy link
Author

The test-only pull request is here: #635.

https://mail.python.org/pipermail/distutils-sig/2008-April/009336.html
http://mail.python.org/pipermail/distutils-sig/attachments/20080414/16fb135e/attachment-0001.diff

Add copy_inc_files function to fix issue of lost pyconfig.h.

When sys.exec_prefix and sys.prefix differ the pyconfig.h file
is in $(exec_prefix)/include/python$(version) and that file is
missing in the virtualenv because env/include/python$(version)
is a symlink to $(real_prefix)/include/python$(version).
If --always-copy is used then the two include directories merge.
I added copy_inc_files to symlink (or copy) the individual contents
of prefix include and exec_prefix include into env/include.
@shidesthewise
Copy link
Author

The prefix-only pull request is here: #636.

@pfmoore
Copy link
Member

pfmoore commented Aug 6, 2014

@shidesthewise Thanks. I've commented on the tests PR (I'm basically OK with the actual change, but not entirely sure about the directory renaming). The prefix-only one should be fine. I'm unavailable for a couple of weeks, though, so if no-one else progresses these in the meantime, ping me early September and I'll get back to them.

command name "test" also as the directory name to find tests.
Skip copying required file if exec_prefix != prefix and
the file is sourced from exec_prefix.  Let the
copying/linking of exec_dir in install_python handle
these files.
@shidesthewise
Copy link
Author

I was wondering what the likelihood of these being adopted and merged into the mainline.

@pfmoore
Copy link
Member

pfmoore commented Sep 15, 2014

Looking again at this:

  1. The setup.py test change doesn't match what's recommended in the py.test docs, which say to use self.pytest_args = []. I'd rather follow the recommendation, to the extent that I care at all (personally I just run py.test directly, I don't use setup.py test myself.)
  2. Are there compatibility issues with changing the content of orig-prefix.txt? It seems to me that this could break tools that expect to be able to introspect virtualenvs. At a minimum, I'd check that virtualenvwrapper isn't impacted.

I'm going to duck on this, I'm afraid - none of the changes affect systems or situations I have any experience with, and I'd rather one of the other developers who does have some familiarity with the subject take a look and comment.

@dstufft dstufft mentioned this pull request Jan 5, 2015
5 tasks
@shidesthewise
Copy link
Author

Because this is old and based on 1.11 and virtualenv is now in a 13.X series, I'll re-submit.

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.

4 participants