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

dependency on typed_ast in 2.0.0 breaks installation on Python 3 when a compiler is not available #597

Closed
michaelboulton opened this issue Jul 17, 2018 · 6 comments
Labels
Maintenance Discussion or action around maintaining astroid or the dev workflow

Comments

@michaelboulton
Copy link

Steps to reproduce

  1. Go into a Python 3.3+ environment without a compiler (eg docker run -i -t python:3.6-alpine /bin/sh)
  2. Try to install astroid (or Pylint) pip install astroid

Current behavior

Installation fails:

...
  unable to execute 'gcc': No such file or directory
  error: command 'gcc' failed with exit status 1

Expected behavior

Installs as normal, like with Python 2

I found this when trying to install Pylint in a docker container in CI.

I understand that 2.0.0 is a 'major' change so this might be expected behaviour, but it means that I either have to lock to a version astroid<2 or install a compiler into the docker container, both of which are not ideal. Is there some way to install this (and by extension Pylint) without using the typed_ast module?

@PCManticore
Copy link
Contributor

This was already mentioned in pylint-dev/pylint#2291, where the culprit was also alpine. But you said an interesting thing in that we can make typed_ast optional. The thing is that we want typed_ast to be installed by default at all times, so need to look if this is actually feasible or not.

@brycepg
Copy link
Contributor

brycepg commented Jul 19, 2018

Here's an alpine Dockerfile which works around this issue by telling pip that the typed_ast manylinux wheel is compatible with this system. It appears that their is no ABI issue:

FROM alpine:latest

RUN apk add --no-cache --update python3
RUN python3 -m ensurepip
RUN pip3 install --upgrade pip
RUN python3 -c 'import sys; f = open("/usr/lib/python3.6/site-packages/_manylinux.py", "w"); f.write("manylinux1_compatible = True"); f.close()'
RUN python3 -m pip install --upgrade astroid

It might help using a container that's based of off glibc instead of musl.

@hairyhenderson
Copy link

This seems to no longer be an issue with astroid v2.3.0+ and Python 3.8:

$ docker run -it --rm python:3.8-alpine /bin/sh
/ # pip install astroid
[...]
Installing collected packages: wrapt, six, lazy-object-proxy, astroid
Successfully installed astroid-2.3.2 lazy-object-proxy-1.4.3 six-1.12.0 wrapt-1.11.2
/ # 

Looks like maybe typed_ast isn't used by default now?

@hairyhenderson
Copy link

Ah, indeed, from reading #675 it seems typed_ast is not used on Python 3.8+. I guess this issue can be closed now?

@PCManticore
Copy link
Contributor

@hairyhenderson typed_ast was merged in the standard library's ast module on Python 3.8, if I recall correctly. At this point, I think we need to make typed_ast optional for 3.5-3.7.

@Pierre-Sassoulas Pierre-Sassoulas added Maintenance Discussion or action around maintaining astroid or the dev workflow and removed task labels Jul 14, 2022
@DanielNoord
Copy link
Collaborator

Closing as we won't invest the time to fix this for a release we are no longer supporting in the somewhat near future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Discussion or action around maintaining astroid or the dev workflow
Projects
None yet
Development

No branches or pull requests

6 participants