Skip to content
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

Python support for pyyaml 5.4 #1432

Closed
brews opened this issue Jan 20, 2021 · 0 comments · Fixed by #1435
Closed

Python support for pyyaml 5.4 #1432

brews opened this issue Jan 20, 2021 · 0 comments · Fixed by #1435
Assignees
Milestone

Comments

@brews
Copy link

brews commented Jan 20, 2021

Problem description

The Python pulumi SDK and pulumi-kubernetes have different/incompatible restrictions on the pyyaml dependency.

pulumi-kubernetes supports 'pyyaml>=5.3.1,<5.4' but pyyaml 5.4 was released a few hours ago.The trouble is the pulumi Python SDK only requires 'pyyaml>=5.3.1'. So, when setting up the environment as part of a CI/CD job, for example, pip installs pyyaml 5.4 and pulumi itself then chokes on the incompatible pulumi-kubernetes and pyyaml versions when starting a preview.

Relevant lines from error logs are:

...
      File "/builds/fakeproject/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 792, in resolve
        raise VersionConflict(dist, req).with_context(dependent_req)
    pkg_resources.ContextualVersionConflict: (PyYAML 5.4 (/builds/fakeproject/venv/lib/python3.8/site-packages), Requirement.parse('pyyaml<5.4,>=5.3.1'), {'pulumi-kubernetes'})
    error: an unhandled error occurred: Program exited with non-zero exit code: 1

This got burned because setuptools and the package constraints in setup.py are not used to test or resolve conflicting dependencies in an environment.

Suggestions for a fix

Remove or extend the cap on pyyaml<5.4 in pulumi-kubernetes's setup.py, if possible.

My workaround has been to add pyyaml=5.3.* to requirements.txt, though it is not really a direct dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants