Adding dependency for test

Hi, I’m currently working on issue #4561 and, in order to crop the images, I need to add an image manipulation library to the test dependencies.

I have searched the documentation for depencencies management and found these instructions.

I have followed the instructions and added pillow to the securedrop/requirements/python3/test_requirements.in file. Next, the instructions indicate to run

make update-pip-dependencies

which returns the following:

make: *** No rule to make target 'update-pip-dependencies'.  Stop.

I noticed however that I could run this instead

make update-pip-requirements

I’m not sure if this is correct and if so, should I raise an issue to update the make command in the docs?

When running the above, I get the following error:

jul@securedrop-dev:~/securedrop$ make update-pip-requirements 
███ Updating admin pip requirements...
Run with DOCKER_BUILD_VERBOSE=true for more information
Docker image build in progress  done !
Traceback (most recent call last):
  File "/usr/bin/pip-compile", line 11, in <module>
    sys.exit(cli())
  File "/usr/lib/python3.5/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.5/site-packages/click/core.py", line 676, in main
    _verify_python3_env()
  File "/usr/lib/python3.5/site-packages/click/_unicodefun.py", line 118, in _verify_python3_env
    'for mitigation steps.' + extra)
RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment.  Consult http://click.pocoo.org/python3/for mitigation steps.

This system supports the C.UTF-8 locale which is recommended.
You might be able to resolve your issue by exporting the
following environment variables:

    export LC_ALL=C.UTF-8
    export LANG=C.UTF-8
Makefile:9: recipe for target 'update-pip-requirements' failed
make[1]: *** [update-pip-requirements] Error 1
Makefile:26: recipe for target 'update-admin-pip-requirements' failed
make: *** [update-admin-pip-requirements] Error 2

I tried setting up the environment variables as indicated but with same results.

Being new to this project, I have not yet wrapped my head around the whole environment setup and a bit of help on how to add a dependency would be greatly appreciated!

Thanks in advance.

Update:

After checking the Makefile, I found that make update-pip-requirements was running both update-admin-pip-requirements and update-python3-requirements.

I ran both separately and the error associated with the click package occurred only in update-admin-pip-requirements. make update-python3-requirements ran without errors and my new dependency was added successfully.

I’d still like to understand why update-admin-pip-requirements fails, as well as if I should raise an issue to update the docs to replace make update-pip-dependencies with make update-pip-requirements (or make update-python3-requirements).

P.S. All tests ran with the screenshots automatically cropped to the page content. PR should land on GitHub shortly. :slight_smile:

Hello again,

You’re doing everything right, and just getting tripped up by our bugs. We recently updated the admin environment to use Python 3, and did not catch this, so thank you. And the docs have had that wrong command for a while. I’ve filed a couple of tickets:


Thanks!

1 Like

You’re doing everything right

@rmol, Thanks again for your quick reply. As a newcomer to the project, it’s comforting to know I can get support. When confronting an issue, it’s hard to know if I am the one doing something wrong (like my previous question) or if there is an actual issue with the code or documentation like in this case.

Sure thing. If you run into things like this in the future, you might get even faster responses in the SecureDrop Gitter channel. We watch both, of course, I just have the impression that those notifications get seen sooner.

Good to know. Thanks!