-
-
Notifications
You must be signed in to change notification settings - Fork 657
"SyntaxError: invalid syntax" when installing master via pip #496
Comments
Actually it's not. |
I believe all transports get loaded on initial import. This is only on master so I'm going to call it safe and we can push ahead with a fix, but we'll need to sort out something before releasing a new version. |
https://readthedocs.org/builds/raven/1689292/ |
@hheimbuerger This should be fine. It's more or less just a warning when installing. The transport is lazily loaded so when running, this doesn't happen. For example, gunicorn also errors the same way when installing for it's aiohttp worker.
Same idea. :) I agree it's confusing, but all tests pass and whatnot for python2, so I wouldn't be worried. We'll also be cutting a new release from master soon. |
Also for context, https://github.com/getsentry/raven-python/blob/master/raven/transport/__init__.py#L25-L26 The module isn't even imported in < python 3.3. |
Lastly, this is a similar Issue filed against gunicorn for what I just pointed out: benoitc/gunicorn#860 Turns out, it's a bug in pip confusingly showing the error. If you test against pip master, it doesn't complain. |
@mattrobenolt I know it works alright, I've actually lived with this for a while. But I have some less technical people running the code (and doing pip updates) and for them it's very confusing to see an error that looks so fatal. It's kinda undermining my efforts to try to empower them to judge for themselves whether there was a problem with the upgrade they have to deal with (or contact me). ;) I really think a stable package should not show this during installation. Is there nothing you can do? Can you link to the pip issue you were talking about? |
And I just submit another patch since this didn't cover installing from wheels very well: pypa/pip#2071 |
When compiling raven, I see the SyntaxError tagged above, but the exit code for "python -m compileall" is still 1. Shouldn't the exit code be 0 if this were truly not an issue? This only came up when I ran a deployment, and my tool pays attention to the exit codes. |
This isn't an issue, and exists in any library that tries to be python 2 and python 3 compatible in the same codebase. Similarly, this happens to gunicorn as well. The only fix we could do is to remove the python 3 specific syntax from our codebase, but I don't really think that's reasonable. |
Upgrading your pip version might solve the issue. |
@xordoquy The underlying problem is from |
And to clarify, |
Right, I assumed the compilall was part of the installation process. |
Yeah, it totally is. pip just masks those errors by literally using a regular expression to parse them out. :) It's kinda gross. But it's not an error by any means, just noise. |
When installing the latest master (89024b4) via pip (
pip install -U git+https://github.com/getsentry/raven-python
) on Python 2.7, I'm getting a "SyntaxError: invalid syntax" for the following line: https://github.com/getsentry/raven-python/blob/master/raven/transport/aiohttp.py#L30Looks reasonable, the asterisk really doesn't look like Python (2.x) syntax, or am I missing something?
The text was updated successfully, but these errors were encountered: