Git Product home page Git Product logo

Comments (7)

bgreen-litl avatar bgreen-litl commented on May 21, 2024

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.

fryfrog avatar fryfrog commented on May 21, 2024

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.

bgreen-litl avatar bgreen-litl commented on May 21, 2024

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.

fryfrog avatar fryfrog commented on May 21, 2024

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.

fryfrog avatar fryfrog commented on May 21, 2024

python-poetry/poetry#866

^ Looks like this is promising.

from backoff.

bgreen-litl avatar bgreen-litl commented on May 21, 2024

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.

fryfrog avatar fryfrog commented on May 21, 2024

So it doesn't actually cause any problems, I'm just gonna ignore it. :)

from backoff.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.