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

Adding python-config script to virtualenv bin dir #783

Closed
wants to merge 3 commits into from

Conversation

madprog
Copy link

@madprog madprog commented Aug 16, 2015

Should solve most of #169

madprog referenced this pull request in madprog/virtualenv Aug 16, 2015
@amchoukir
Copy link

I can confirm that this patch fixes issues building Valloric/ycmd

@Ivoz
Copy link

Ivoz commented Aug 17, 2015

It seems you've forgotten to add/commit the file python-config into git with this PR.

@madprog
Copy link
Author

madprog commented Aug 17, 2015

Hello Matt,
The python-config file is gzipped and base64-ed, and inlined at the line 2239 of virtualenv.py, just like activate_this.py or distutils.cfg
Where should it be copied else?

@Ivoz
Copy link

Ivoz commented Aug 18, 2015

@madprog the source for all such files needs to live in virtualenv_embedded. They should then be automatically included into virtualenv.py by running bin/rebuild-script.py.

File was missing, as commented Ivoz (Matt Iversen)
References pypa#169
@madprog
Copy link
Author

madprog commented Aug 18, 2015

Here is the commit with the missing file.

@Ivoz
Copy link

Ivoz commented Aug 19, 2015

@madprog now I can see the contents of the file. It seems to me likely you copied this from a python 2 source. It uses the python 2 only print statement, so this is unsuitable to merge at the moment. Additionally, it doesn't cover the additional options available in a python3 python-config, you can see those here for instance.

BTW make it compatible with python2 and python3 as much as possible
@madprog
Copy link
Author

madprog commented Aug 19, 2015

@Ivoz Indeed it was at first copied from a python2-config. At that time (end of 2011), python3 was not that mainstream ;)
Please now find the python-config that you linked, updated so that it also runs with python2.
I compared the outputs using this zsh script:

#!/usr/bin/zsh

for i in prefix exec-prefix includes libs cflags ldflags extension-suffix help abiflags configdir; do
    echo "\x1b[32m$i\x1b[0m"

    PYTHON2_CMD="diff -u <(python2-config --$i 2>&1) <(python2 python-config --$i 2>&1)"
    PYTHON3_CMD="diff -u <(python3-config --$i 2>&1) <(python3 python-config --$i 2>&1)"

    if ! $SHELL -c "$PYTHON2_CMD" >/dev/null; then
        echo "\x1b[31mpython2\x1b[0m"
        $SHELL -c "$PYTHON2_CMD"
    fi

    if ! $SHELL -c "$PYTHON3_CMD" >/dev/null; then
        echo "\x1b[31mpython3\x1b[0m"
        $SHELL -c "$PYTHON3_CMD"
    fi
done

They are not exactly the same on my system: the order of the cflags or libflags is different (but similar), some may be duplicated, and the new options are supported for python2 (except --abiflags which was introduced in python3.2), but I think that it is sufficient. What do you think?

@Ivoz
Copy link

Ivoz commented Sep 19, 2015

@madprog I have applied this through #798, thanks for most of the work :)

@Ivoz Ivoz closed this Sep 19, 2015
@Ivoz Ivoz mentioned this pull request Sep 19, 2015
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.

3 participants