[Django] #26952: Mention the need to install libffi-dev prior to installing packages for tests

44 views
Skip to first unread message

Django

unread,
Jul 26, 2016, 7:32:18 AM7/26/16
to django-...@googlegroups.com
#26952: Mention the need to install libffi-dev prior to installing packages for
tests
-------------------------------+--------------------
Reporter: edmorley | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------
The contributing guide explains how to install the Python packages
required to run the tests in a couple of places:
https://docs.djangoproject.com/en/dev/intro/contributing/#running-django-s
-test-suite-for-the-first-time
https://docs.djangoproject.com/en/dev/internals/contributing/writing-code
/unit-tests/#running-all-the-tests

However the `pip install tests/requirements/py*.txt` will fail during the
installation of `argon2-cffi` unless `libffi-dev` is installed, with a
delightful error like:

{{{
$ pip install -r requirements/py2.txt
Collecting argon2-cffi>=16.1.0 (from -r requirements/base.txt (line 1))
Downloading argon2_cffi-16.1.0.tar.gz (1.2MB)
100% |################################| 1.2MB 1.1MB/s
Complete output from command python setup.py egg_info:
c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
compilation terminated.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-PCA0QU/argon2-cffi/setup.py", line 160, in
<module>
extras_require=EXTRAS_REQUIRE,
File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/home/vagrant/.virtualenvs/django/local/lib/python2.7/site-
packages/setuptools/dist.py", line 348, in __init__
self.fetch_build_eggs(attrs['setup_requires'])
File "/home/vagrant/.virtualenvs/django/local/lib/python2.7/site-
packages/setuptools/dist.py", line 394, in fetch_build_eggs
replace_conflicting=True,
File "/home/vagrant/.virtualenvs/django/local/lib/python2.7/site-
packages/pkg_resources/__init__.py", line 826, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/home/vagrant/.virtualenvs/django/local/lib/python2.7/site-
packages/pkg_resources/__init__.py", line 1092, in best_match
return self.obtain(req, installer)
File "/home/vagrant/.virtualenvs/django/local/lib/python2.7/site-
packages/pkg_resources/__init__.py", line 1104, in obtain
return installer(requirement)
File "/home/vagrant/.virtualenvs/django/local/lib/python2.7/site-
packages/setuptools/dist.py", line 461, in fetch_build_egg
return cmd.easy_install(req)
File "/home/vagrant/.virtualenvs/django/local/lib/python2.7/site-
packages/setuptools/command/easy_install.py", line 664, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/home/vagrant/.virtualenvs/django/local/lib/python2.7/site-
packages/setuptools/command/easy_install.py", line 694, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/home/vagrant/.virtualenvs/django/local/lib/python2.7/site-
packages/setuptools/command/easy_install.py", line 875, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/home/vagrant/.virtualenvs/django/local/lib/python2.7/site-
packages/setuptools/command/easy_install.py", line 1114, in
build_and_install
self.run_setup(setup_script, setup_base, args)
File "/home/vagrant/.virtualenvs/django/local/lib/python2.7/site-
packages/setuptools/command/easy_install.py", line 1102, in run_setup
raise DistutilsError("Setup script exited with %s" % (v.args[0],))
distutils.errors.DistutilsError: Setup script exited with error:
command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-
build-PCA0QU/argon2-cffi/
}}}


Many people will know immediately what the issue is (or one would hope
after Googling), however it would probably be good to state the
requirement explicitly and also mention in the troubleshooting section
:-)

--
Ticket URL: <https://code.djangoproject.com/ticket/26952>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 26, 2016, 7:59:59 AM7/26/16
to django-...@googlegroups.com
#26952: Mention the need to install libffi-dev prior to installing packages for
tests
--------------------------------------+------------------------------------
Reporter: edmorley | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by timgraham):

* needs_better_patch: => 0
* needs_docs: => 0
* type: Bug => Cleanup/optimization
* needs_tests: => 0
* stage: Unreviewed => Accepted


Comment:

There is also `libjpeg-dev` and `zlib1g-dev` for Pillow. Hopefully we can
link to instructions in the docs for argon2-cffi and Pillow rather than
writing our own instructions.

--
Ticket URL: <https://code.djangoproject.com/ticket/26952#comment:1>

Django

unread,
Jul 27, 2016, 10:22:22 PM7/27/16
to django-...@googlegroups.com
#26952: Mention the need to install libffi-dev prior to installing packages for
tests
--------------------------------------+------------------------------------
Reporter: edmorley | Owner: an0o0nym
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by an0o0nym):

* owner: nobody => an0o0nym
* status: new => assigned


Comment:

Hello There,
I would like to assign this ticket to myself as my first contribution.

--
Ticket URL: <https://code.djangoproject.com/ticket/26952#comment:2>

Django

unread,
Jul 28, 2016, 9:27:14 PM7/28/16
to django-...@googlegroups.com
#26952: Mention the need to install libffi-dev prior to installing packages for
tests
--------------------------------------+------------------------------------
Reporter: edmorley | Owner: an0o0nym
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by an0o0nym):

Replying to [comment:1 timgraham]:


> There is also `libjpeg-dev` and `zlib1g-dev` for Pillow. Hopefully we
can link to instructions in the docs for argon2-cffi and Pillow rather
than writing our own instructions.

I just wanted to ask if linking the docs to the instructions pages of
these libraries is all that you want me to do? Or should I create some
text in the troubleshooting section regarding that problem, as edmorley
suggested in the ticket description?

--
Ticket URL: <https://code.djangoproject.com/ticket/26952#comment:3>

Django

unread,
Jul 28, 2016, 9:32:03 PM7/28/16
to django-...@googlegroups.com
#26952: Mention the need to install libffi-dev prior to installing packages for
tests
--------------------------------------+------------------------------------
Reporter: edmorley | Owner: an0o0nym
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by timgraham):

Please do whatever you think will be most helpful.

--
Ticket URL: <https://code.djangoproject.com/ticket/26952#comment:4>

Django

unread,
Jul 29, 2016, 8:25:17 PM7/29/16
to django-...@googlegroups.com
#26952: Mention the need to install libffi-dev prior to installing packages for
tests
--------------------------------------+------------------------------------
Reporter: edmorley | Owner: an0o0nym
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by an0o0nym):

I have created a new pull request at
[https://github.com/django/django/pull/6991].

I have created new Unit Testing section under the Troubleshooting page,
with subsection regarding in general the problem of missing libraries for
the dependencies - based on the ticket description problem. Moreover I
have linked appropriate pages to that section, which were also mentioned
in the ticket description. One last thing I have changed were url
addresses (for the dependencies mentioned in the ticket description as
well as in comments). I made them point to the dependencies' documentation
rather than writing new instructions as suggested in the comment section
of this ticket.

--
Ticket URL: <https://code.djangoproject.com/ticket/26952#comment:5>

Django

unread,
Aug 9, 2016, 6:41:55 PM8/9/16
to django-...@googlegroups.com
#26952: Mention the need to install libffi-dev prior to installing packages for
tests
--------------------------------------+------------------------------------
Reporter: edmorley | Owner: an0o0nym
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"7c04223c018bf445efe62806deef3520ab3c89c0" 7c04223]:
{{{
#!CommitTicketReference repository=""
revision="7c04223c018bf445efe62806deef3520ab3c89c0"
[1.10.x] Fixed #26952 -- Added tips for installing test suite
dependencies.

Backport of 2b759c94c562c9ee9b6ca970739be15014050fda from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26952#comment:7>

Django

unread,
Aug 9, 2016, 6:42:06 PM8/9/16
to django-...@googlegroups.com
#26952: Mention the need to install libffi-dev prior to installing packages for
tests
--------------------------------------+------------------------------------
Reporter: edmorley | Owner: an0o0nym
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: master

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"2b759c94c562c9ee9b6ca970739be15014050fda" 2b759c94]:
{{{
#!CommitTicketReference repository=""
revision="2b759c94c562c9ee9b6ca970739be15014050fda"


Fixed #26952 -- Added tips for installing test suite dependencies.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26952#comment:6>

Reply all
Reply to author
Forward
0 new messages