Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Ethan Smith
    @ethanhs
    @ddfisher would you consider a PR that gets typed_ast to build under VS 2010 (and maybe supports Python 3.4?)
    Ethan Smith
    @ethanhs
    Basically vs 2010 is picky about where types are declared. I went through and moved a few declarations (no change to functionality) and it now compiles and passes the mypy test suite (need to test 64 bit compilation).
    Ethan Smith
    @ethanhs
    hm, 64 bit windows should be working. build.cmd should set the environment up correctly...
    Ethan Smith
    @ethanhs
    Ah, needed the right environment variable. https://ci.appveyor.com/project/ethanhs/typed-ast everything is working.
    David Fisher
    @ddfisher
    Excited about that PR. Thanks!
    Ethan Smith
    @ethanhs
    Your welcome! @ddfisher. Could we get a new release (1.1.0 presumably?) so I can update mypy?
    David Fisher
    @ddfisher
    Yep! I can do that this afternoon
    Ethan Smith
    @ethanhs
    Great! Thanks
    David Fisher
    @ddfisher
    @ethanhs typed_ast 1.1.0 released!
    can you double-check that the new windows wheels work?
    Ethan Smith
    @ethanhs
    Great! Will do
    Guido van Rossum
    @gvanrossum
    I am trying to do another release of typed_ast: 1.1.1, consolidating all changes so far (but not python/typed_ast#61, since the discussion makes it sound risky if we want to substitute this into mypy without any risk). But I can't find the appveyor project for it. Do I just have to create my own appveyor project?
    Guido van Rossum
    @gvanrossum
    CfirTsabari
    @CfirTsabari
    seem like the new version(1.3.4) windows wheels are missing ,sorry that I can't try to upload them myself (i don't have a mac).
    asif
    @getasif

    Hello there,

    I am trying to cross compile typed_ast(git cloned from https://github.com/python/typed_ast.git) with this specific compiler: arm-poky-linux-gnueabi-gcc
    I have setup the environment for by sourcing environment-setup-cortexa9hf-neon-poky-linux-gnueabi and upon doing a echo $CC I do confirm its arm-poky-linux-gnueabi-gcc
    On the command line(I am using Virtual Box with Ubuntu 18.04-64bit) I tried executing: sudo python3 setup.py --verbose build --compiler=arm-poky-linux-gnueabi-gcc
    Unfortunately, it stops with this message: error: don't know how to compile C/C++ code on platform 'posix' with 'arm-poky-linux-gnueabi-gcc' compiler
    What am I missing? Please let me know. Thank you.

    Ethan Smith
    @ethanhs
    @getasif you may want to look at https://stackoverflow.com/a/25595274
    asif
    @getasif
    @ethanhs I did try that. It didn't help. I believe the platform is "armv7l" when I did a "uname -a" on the Linux running on SBC. What else I can do to cross compile for the ARM based SBC. Thank you.
    Ethan Smith
    @ethanhs
    Can you tell me what error you get when you run it without the compile flag?
    @getasif
    asif
    @getasif

    @ethanhs sure, here it is:

    running build
    running build_py
    not copying typed_ast/ast27.py (output up-to-date)
    not copying typed_ast/ast3.py (output up-to-date)
    not copying typed_ast/conversions.py (output up-to-date)
    not copying typed_ast/init.py (output up-to-date)
    package init file 'ast3/tests/init.py' not found (or not a regular file)
    not copying ast3/tests/test_basics.py (output up-to-date)
    running build_ext
    building '_ast27' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/ast27
    creating build/temp.linux-x86_64-3.6/ast27/Parser
    creating build/temp.linux-x86_64-3.6/ast27/Python
    creating build/temp.linux-x86_64-3.6/ast27/Custom
    arm-poky-linux-gnueabi-gcc -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iast27/Include -I/usr/include/python3.6m -c ast27/Parser/acceler.c -o build/temp.linux-x86_64-3.6/ast27/Parser/acceler.o
    unable to execute 'arm-poky-linux-gnueabi-gcc': No such file or directory
    error: command 'arm-poky-linux-gnueabi-gcc' failed with exit status 1

    This is how the first few lines in setup.py look like:
    import ast
    import re
    import sys
    import os
    os.environ["CC"] = "arm-poky-linux-gnueabi-gcc"
    os.environ["CXX"] = "arm-poky-linux-gnueabi-g++"
    When I do a "echo $CC" I get this:- arm-poky-linux-gnueabi-gcc -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/mybuild_project/sysroots/cortexa9hf-neon-poky-linux-gnueabi
    Ethan Smith
    @ethanhs
    can you do which arm-poky-linux-gnueabi-gcc?
    asif
    @getasif
    Sure one moment please, I will let you know the absolute path for that
    /opt/mybuild_project/sysroots/x86_64-personal-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc
    Ethan Smith
    @ethanhs
    perhaps you need to set CC to use the absolute path?
    asif
    @getasif
    I have tried that as well
    But let me try that again.
    I executed this and its the same failure message:
    sudo python3 setup.py --verbose build --compiler=/opt/mybuild_project/sysroots/x86_64-personal-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc
    asif
    @getasif
    running build running build_py not copying typed_ast/ast27.py (output up-to-date) not copying typed_ast/ast3.py (output up-to-date) not copying typed_ast/conversions.py (output up-to-date) not copying typed_ast/__init__.py (output up-to-date) package init file 'ast3/tests/__init__.py' not found (or not a regular file) not copying ast3/tests/test_basics.py (output up-to-date) running build_ext error: don't know how to compile C/C++ code on platform 'posix' withsudo python3 setup.py --verbose build --compiler /opt/mybuild_project/sysroots/x86_64-personal-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc``
    This is the output of "uname -a" on the Virtual Box running Linux:
    Linux asif-vm 4.15.0-55-generic #60-Ubuntu SMP Tue Jul 2 18:22:20 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
    asif
    @getasif

    Hello @ethanhs here is one update. I assigned the os.environ["CC"] and os.environ["CXX"] to the absolute path based compilers respectively in setup.py and executed this command: sudo python3 setup.py --verbose build

    OUTPUT:
    running build running build_py not copying typed_ast/ast27.py (output up-to-date) not copying typed_ast/ast3.py (output up-to-date) not copying typed_ast/conversions.py (output up-to-date) not copying typed_ast/__init__.py (output up-to-date) package init file 'ast3/tests/__init__.py' not found (or not a regular file) not copying ast3/tests/test_basics.py (output up-to-date) running build_ext building '_ast27' extension /opt/mybuild_project/sysroots/x86_64-personal-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iast27/Include -I/usr/include/python3.6m -c ast27/Parser/acceler.c -o build/temp.linux-x86_64-3.6/ast27/Parser/acceler.o cc1: warning: include location "/usr/include/python3.6m" is unsafe for cross-compilation [-Wpoison-system-directories] In file included from /usr/include/python3.6m/Python.h:8:0, from ast27/Include/pgenheaders.h:8, from ast27/Parser/acceler.c:13: /usr/include/python3.6m/pyconfig.h:15:53: fatal error: arm-linux-gnueabi/python3.6m/pyconfig.h: No such file or directory compilation terminated. error: command '/opt/mybuild_project/sysroots/x86_64-personal-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc' failed with exit status 1

    Ethan Smith
    @ethanhs
    Sorry, it looks like your Python install is incomplete
    asif
    @getasif
    I just upgraded my python, so now upon doing a "python3 --version" I get this: Python 3.6.8
    Ethan Smith
    @ethanhs
    Your system Python won't work if you are cross compiling
    I'm afraid I don't have all of the knowledge or time to help more
    asif
    @getasif
    Where as when I source the file for setting up the cross-compilation for ARM, I get this version of python3: Python 3.5.2
    Minke Zhang
    @cripplet
    hi -- question
    I want to parse py2 code with type annotations: https://pastebin.com/2KKdrPSg
    but when running this, the parser is complaining about a syntax error in the code, due to type annotations
    but isn't typed_ast suppose to support...types?
    https://github.com/python/typed_ast/blob/master/ast27/Parser/Python.asdl#L13 the syntax tree for ast27 seems to agree with me here
    Ethan Smith
    @ethanhs
    @cripplet Type annotations are only supported in Python 3
    Type comments are parsed by typed ast in Python 2
    Minke Zhang
    @cripplet
    But this isn't the case -- when attempted to parse the "src" variable in the pastebin file, typed_ast.ast27 throws a RuntimeError, complaining about the syntax of "src"
    oh I see
    @ethanhs thanks, that clears it up :(