Skip to content

Update setuptools in python3.6 #170

Closed

Description

@jared-mackey

The setuptools included in the python3.6 version is broken and needs to be updated. Here is the specific issue pypa/setuptools#866

A quick workaround to overwrite the included one is to add the following run command to your Dockerfile.

RUN pip install -U setup tools

Activity

  1. yosifkit commented on Jan 11, 2017

    @yosifkit
    Member

    Looks like python should offer a new release with a working setuptools. 😉😉

    But I guess we'll have to work around it and fix it similar to how we keep pip up to date. 🤢

    Edit: especially doing it in the same RUN line to keep the size smaller.

  2. jouve commented on Mar 27, 2017

    @jouve

    Hi,

    I also encountered the error while while installing python-memcached:

        Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "/tmp/pip-build-awdnpsmf/python-memcached/setup.py", line 8, in <module>
            version=get_module_constant('memcache', '__version__'),
          File "/usr/local/lib/python3.6/site-packages/setuptools/depends.py", line 164, in get_module_constant
            return extract_constant(code, symbol, default)
          File "/usr/local/lib/python3.6/site-packages/setuptools/depends.py", line 197, in extract_constant
            const = code.co_consts[arg]
        IndexError: tuple index out of range
    

    @yosifkit Would you accept a PR adding
    pip install -U setuptools
    to the Dockerfile ?

  3. yosifkit commented on Mar 27, 2017

    @yosifkit
    Member

    Given that the current version of setuptools is 28.8.8, released in November 2016, and the newest is 34.3.3, released a day ago, we definitely need a better way to keep it up to date. I had thought that the 3.6.1 bump would've included a newer setuptools 😢

    Just adding the pip install -U setuptools would not be enough to trigger a rebuild when a new version of setuptools comes out, so we'll have to make sure that a version is specified like pip. Which means that we'll also need to change update.sh to grab the setuptools version and bump all the files.

    # line 62 https://github.com/docker-library/python/blob/32e920eb13714a9aeff2e016fb467901222d17b5/3.6/Dockerfile#L62
    - 	&& pip3 install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \
    +	&& pip3 install --no-cache-dir --upgrade --force-reinstall \
    +		"pip==$PYTHON_PIP_VERSION" \
    +		"setuptools==$PYTHON_SETUPTOOLS_VERSION" \
    # of course there would need to be another ENV up by line 26 for this new version

    Would this be harmful to apply to all the versions of python (2.7, 3.3, 3.4, 3.5, and 3.6) or would they break? We currently have Dockerfile templates and having it only apply to 3.6 would complicate things.

  4. tianon commented on Apr 4, 2017

    @tianon
    Member

    See also #186 (comment) where we're discussing something similar (wheel there, but setuptools as well since get-pip.py installs all three).

  5. yosifkit commented on May 1, 2018

    @yosifkit
    Member

    Fixed by #186, #194.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    IssueRequestRequest for image modification or feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions