Skip to content

Update setuptools in python3.6 #170

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

Closed
jared-mackey opened this issue Jan 10, 2017 · 5 comments
Closed

Update setuptools in python3.6 #170

jared-mackey opened this issue Jan 10, 2017 · 5 comments
Labels
Issue Request Request for image modification or feature

Comments

@jared-mackey
Copy link

jared-mackey commented Jan 10, 2017

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
@yosifkit
Copy link
Member

yosifkit commented Jan 11, 2017

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.

@jouve
Copy link

jouve commented Mar 27, 2017

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 ?

@yosifkit
Copy link
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.

@tianon
Copy link
Member

tianon commented Apr 4, 2017

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

@wglambert wglambert added Request Request for image modification or feature Issue labels Apr 24, 2018
@yosifkit
Copy link
Member

yosifkit commented May 1, 2018

Fixed by #186, #194.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue Request Request for image modification or feature
Projects
None yet
Development

No branches or pull requests

5 participants