Comments (7)
What command is generating this output? There is python 3 syntax in backoff/_async.py
and that module should not be imported or compiled under python 2.7.
from backoff.
The PKGBUILD runs python2 setup.py install --root="$pkgdir" --optimize=1
, I've included the output of a manual run below.
0 ✓ fryfrog@apollo ~/aur/python-backoff/src/backoff-1.8.0 $[master] python2 setup.py install --root="../../pkg/python2-backoff/" --optimize=1
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
warnings.warn(msg)
running install
running build
running build_py
file README.py (for module README) not found
file LICENSE.py (for module LICENSE) not found
file README.py (for module README) not found
file LICENSE.py (for module LICENSE) not found
running install_lib
creating ../../pkg
creating ../../pkg/python2-backoff
creating ../../pkg/python2-backoff/usr
creating ../../pkg/python2-backoff/usr/lib
creating ../../pkg/python2-backoff/usr/lib/python2.7
creating ../../pkg/python2-backoff/usr/lib/python2.7/site-packages
creating ../../pkg/python2-backoff/usr/lib/python2.7/site-packages/backoff
copying build/lib/backoff/_wait_gen.py -> ../../pkg/python2-backoff/usr/lib/python2.7/site-packages/backoff
copying build/lib/backoff/_sync.py -> ../../pkg/python2-backoff/usr/lib/python2.7/site-packages/backoff
copying build/lib/backoff/_async.py -> ../../pkg/python2-backoff/usr/lib/python2.7/site-packages/backoff
copying build/lib/backoff/_decorator.py -> ../../pkg/python2-backoff/usr/lib/python2.7/site-packages/backoff
copying build/lib/backoff/__init__.py -> ../../pkg/python2-backoff/usr/lib/python2.7/site-packages/backoff
copying build/lib/backoff/_common.py -> ../../pkg/python2-backoff/usr/lib/python2.7/site-packages/backoff
copying build/lib/backoff/_jitter.py -> ../../pkg/python2-backoff/usr/lib/python2.7/site-packages/backoff
byte-compiling ../../pkg/python2-backoff/usr/lib/python2.7/site-packages/backoff/_wait_gen.py to _wait_gen.pyc
byte-compiling ../../pkg/python2-backoff/usr/lib/python2.7/site-packages/backoff/_sync.py to _sync.pyc
byte-compiling ../../pkg/python2-backoff/usr/lib/python2.7/site-packages/backoff/_async.py to _async.pyc
File "usr/lib/python2.7/site-packages/backoff/_async.py", line 22
async def _call_handlers(hdlrs, target, args, kwargs, tries, elapsed, **extra):
^
SyntaxError: invalid syntax
byte-compiling ../../pkg/python2-backoff/usr/lib/python2.7/site-packages/backoff/_decorator.py to _decorator.pyc
byte-compiling ../../pkg/python2-backoff/usr/lib/python2.7/site-packages/backoff/__init__.py to __init__.pyc
byte-compiling ../../pkg/python2-backoff/usr/lib/python2.7/site-packages/backoff/_common.py to _common.pyc
byte-compiling ../../pkg/python2-backoff/usr/lib/python2.7/site-packages/backoff/_jitter.py to _jitter.pyc
writing byte-compilation script '/tmp/tmpNyY1G1.py'
/usr/bin/python2 -O /tmp/tmpNyY1G1.py
File "usr/lib/python2.7/site-packages/backoff/_async.py", line 22
async def _call_handlers(hdlrs, target, args, kwargs, tries, elapsed, **extra):
^
SyntaxError: invalid syntax
removing /tmp/tmpNyY1G1.py
running install_egg_info
Writing ../../pkg/python2-backoff/usr/lib/python2.7/site-packages/backoff-1.8.0-py2.7.egg-info
from backoff.
Backoff doesn't ship with a setup.py
anymore so I'm not clear what one your example is referencing.
Instead there is a pyproject.toml
as specified by PEP 517. https://www.python.org/dev/peps/pep-0517/
I'm currently using poetry for building and publishing backoff
from backoff.
The setup.py
comes out of the .tar.gz
that pypi hosts for you at https://files.pythonhosted.org/packages/source/b/backoff/backoff-1.8.0.tar.gz
, I'll do a little digging and see what I can figure out too.
0 ✓ fryfrog@apollo ~/aur/python-backoff/src/backoff-1.8.0 $[master] ls -alh
total 49K
drwxr-xr-x 4 fryfrog fryfrog 9 Jul 24 13:25 .
drwxr-xr-x 4 fryfrog fryfrog 5 Jul 24 13:25 ..
drwxr-xr-x 2 fryfrog fryfrog 9 Jul 24 13:25 backoff
drwxr-xr-x 3 fryfrog fryfrog 3 Jul 24 13:25 build
-rw-r--r-- 1 fryfrog fryfrog 1.1K Mar 10 2018 LICENSE
-rw-r--r-- 1 fryfrog fryfrog 1.1K Dec 31 1969 PKG-INFO
-rw-r--r-- 1 fryfrog fryfrog 1.6K Dec 20 2018 pyproject.toml
-rw-r--r-- 1 fryfrog fryfrog 12K Dec 15 2018 README.rst
-rw-r--r-- 1 fryfrog fryfrog 13K Dec 31 1969 setup.py
from backoff.
^ Looks like this is promising.
from backoff.
Okay that makes sense. I didn't remember that poetry is generating a setup.py.
The fundamental issue is that on python 2.7, you do not want it to byte compile the _async submodule as it is necessarily python 3 syntax.
It looks like you can specify files to exclude in pyproject.toml but I'm not sure how to exclude them for only one version of python...
Maybe there's a way when invoking setup.py to exclude that file from being compiled?
from backoff.
So it doesn't actually cause any problems, I'm just gonna ignore it. :)
from backoff.
Related Issues (20)
- Duplicate logging in some special cases HOT 1
- How do I use this?
- Obtain value returned by backoff_handler function after maximum tries is reached
- max_retries HOT 1
- max_time only applies _after_ first retry?
- Canonical way to handle error bursting
- Add exponential decay
- How to handle backoff on Facebook cursor? HOT 1
- Improve Typing and Error Handling in `on_exception`
- question about max_time
- Feature Request: add a way to use backoff in a context manager HOT 2
- feature request: toggle decorator on/off
- `backoff.on_predicate` does not work for `staticmethod`s
- Expose typing hints as they are part of the API
- Add support for globally disabling retries
- How to provide arguments to `on_backoff` function HOT 1
- Feature Request: support direct invocation with functools.partial
- Maintenance help? HOT 7
- README: `max_value` arg to `@backoff.on_predicate(backoff.fibo...)` -- if not obsolete, then maybe just confusing?
- Prevent error message in case of giveup using
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from backoff.