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

add exclude option in #254 #255

merged 1 commit into from Jan 13, 2016


Copy link

Hi team.

I created the issue and PR.
see #254

Best regards.

Yoshiya Ito

Copy link

Oh neat, I didn't know about this feature of find_packages, this will definitely help a lot of folks who are being bitten by this issue. Thank you! Adding to release milestone.

@bitprophet bitprophet added this to the 0.11 milestone Jun 13, 2015
Copy link
Contributor Author

Thank you for your reply!
Any time! :)

Copy link

Side note, a user claimed in #258 that the pyyaml SyntaxError on install, wasn't present in master. I'm guessing that may be something else at work since we haven't merged this PR yet and I don't recall other recent changes that would affect the vendored pyyaml. But, worth verifying.

Copy link
Contributor Author


I verified the issue #258 following environment, and I reproduce #258 install error.
Mac OSX v10.10.4 (OS is so irrelevant about #258)
pip v1.5.6
python v2.7.9

I hope this information will help you.
Best Regards.

[root cause]
The root cause of #258 is that yaml3 is installed despite of using python2.7x virtualenv.
In fact, the following syntax is valid only python3.

class YAMLObject(metaclass=YAMLObjectMetaclass):

By merging this PR, it will be avoidable the install error.
However, as you said, there is also other cause.
That is to say, the cause of #258 is that users are using pip v1.5.6.
pip1.5.x compile the 3rd-party libs during install.(.pyc)
(the message of compiling appears to be using the pip1.5.x)
Then, yaml3(for python3) compiling caused the error in the case of using python 2.x of virtualenv.

[easy solution]
try following.
(your virtualenv)> pip install --upgrade pip
and try again
(your virtualenv)> pip install invoke

[investigation log]

virtualenv Invoke
New python executable in Invoke/bin/python
Installing setuptools, pip...done.

cd Invoke
source ./bin/activate
pip install -U pip==1.5.6
pip --version
pip 1.5.6 from /Users/itouyoshiya/Documents/Python/Invoke/lib/python2.7/site-packages (python 2.7)

pip install invoke
Downloading/unpacking invoke
Downloading invoke-0.10.1-py2.py3-none-any.whl (166kB): 166kB downloaded
Installing collected packages: invoke
Compiling /Users/itouyoshiya/Documents/Python/Invoke/build/invoke/invoke/vendor/yaml3/ ...
File "/Users/itouyoshiya/Documents/Python/Invoke/build/invoke/invoke/vendor/yaml3/", line 284
class YAMLObject(metaclass=YAMLObjectMetaclass):
SyntaxError: invalid syntax

Successfully installed invoke
Cleaning up...

Copy link

I'm currently having a similar problem where conda (the package manager) also compiles files from the yaml3 folder and thus fails my CI build. If I could make sure that it didn't get included in the Python 2.7 package to begin with, this could be prevented.

So it would be great if this got merged in, so I can easily keep creating conda packages for invoke

Copy link

Yup this is in the 0.12 milestone and I plan to cut 0.12 any day now (already kicked most of the stuff I can't easily knock out, to 0.13, but not this one!). Sorry it's taken a while!

Copy link

Thanks for the heads up! Looking forward to 0.12 then

Copy link

For the record, I can't trivially recreate this problem with pip 7.1.2 from a Python 2 host environment (re: virtualenv creation). E.g. virtualenv --python=python3 blah && source blah/bin/activate && pip install <master invoke path> doesn't kaboom.

That's not to say I don't believe this problem exists, it's definitely gotten enough reports - just noting that I'm about to merge an updated copy of this PR but without being able to verify it. Gonna be relying on @yoshiya0503 @matheo @ivoflipse etc to verify it for me :) please check out latest master or release version 0.12.0 and let me know if it corrects the issue for you!

I'll probably release things as-is without waiting, but happy to cut another emergency bugfix release should I have incorrectly applied the fix.

@bitprophet bitprophet merged commit 68e2fad into pyinvoke:master Jan 13, 2016
bitprophet added a commit that referenced this pull request Jan 13, 2016
Copy link

I didn't get the problem using pip, but while building an invoke package using conda. It tries to compile all the .py files in the package, which obviously fails if Python 3 code is run while building for Python 2.

Having this filtering step would make my life easier :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

Successfully merging this pull request may close these issues.

None yet

3 participants