question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dependencies too strict

See original GitHub issue

Description

We use aws-sam-cli to deploy our lambdas. However, the dependencies it requires are pinned quite tightly:

six~=1.11.0
chevron~=0.12
click~=7.0
enum34~=1.1.6; python_version<"3.4"
Flask~=1.0.2
boto3~=1.9, >=1.9.56
PyYAML~=5.1
cookiecutter~=1.6.0
aws-sam-translator==1.14.0
docker~=4.0
dateparser~=0.7
python-dateutil~=2.6
pathlib2~=2.3.2; python_version<"3.4"
requests==2.22.0
serverlessrepo==0.1.9
aws_lambda_builders==0.4.0

This makes it harder to work with other libraries. In my specific case, pylint-quotes, which requires six==1.12.

Anecdotally, it seems aws-sam-cli works fine with six==1.12. For this reason, and also to make co-existence with other libs easier, I’d like to encourage you to provide wider version ranges where/if possible.

I understand there might be reasons behind this that I don’t see, so perhaps at least explaining those would help me come to terms with this.

Some reasoning

I install aws-sam-cli side-by-side with other libs to have the deploy scripts which depend on aws-sam-cli in the same repository as the rest of my Python project, which requires the other libs. pipenv won’t let me easily work around this, e.g. by letting me create another virtual environment for just the deploy scripts without non-trivial changes to the directory structure (can elaborate if needed). I also still believe this is a different issue and the version constraints should be relaxed, if possible.

Steps to reproduce

pipenv --three
pipenv install --dev aws-sam-cli
pipenv install --dev pylint-quotes

with the last command failing due to a conflict.

Observed result

Cannot install both libs, as they require six~=1.11.0 and six==1.12. I assume similar results for other approaches.

Expected result

Wider version ranges that would allow me to install these libs side by side. See above.

Workaround

One can force their dependency management system to ignore the conflict. For pipenv, installing aws-sam-cli as a --dev dependency and pylint-quotes as a default/normal package. This gives priority to the default packages requirements and installs six==1.12.

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: MacOS 10.14.6 Mojave
  2. sam --version: SAM CLI, version 0.22.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
awood45commented, Oct 17, 2019

I’d just add that the recommended installation methods are covered in our developer guide and avoid pip/pipenv installation difficulties. Our behaviors are tested as calls through the CLI, not patching directly into our code as a dependency.

1reaction
jfusscommented, Oct 17, 2019

@HonzaRepresent We do not view SAM CLI as a library and why we keep our dependencies more locked down. As @awood45 stated, this is to make the CLI reproducible. If we start relaxing all the dependencies, than you might be installing something was that untested and would break the CLI. We know many people use PIP but we really don’t recommend it unless you really need to, it a very fragile way to install and requires the correct python version and to use a venv on your part (to get the isolation we are after).

My recommendation is to create a Makefile that will install SAM CLI into an venv on the system, if PIP is really want you want to use. You can then use that locally and in your CI environment, assuming the correct python versions we support are installed.

Closing this but feel free to re-open, if there are further questions on the topic.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dependencies too strict · Issue #1467 · aws/aws-sam-cli · GitHub
First try clearing your dependency cache with $ pipenv lock --clear, then try the original command again. Alternatively, you can use $ pipenv ......
Read more >
Strict dependency management - HackMD
Strict dependency management ; This is a protocol introduced by yarn which modifies the nodejs runtime to communicate the real dependency graph independentely...
Read more >
Dependency hell - Wikipedia
The dependency issue arises when several packages have dependencies on the same shared packages or libraries, but they depend on different and incompatible ......
Read more >
How to enable strict mode for my whole package but not for ...
Is there any way to force strict mode for all files of my package without forcing it for the dependencies of my package?...
Read more >
Dependency Managers Don't Manage Your Dependencies
After all, it's tough to know whether there is a good reason to add a dependency or not, and you don't want to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found