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.

Wrong sub-dependency version selected

See original GitHub issue
  • OS version and name: macOS, py3.8, py3.9
  • Poetry version: 1.0.5

Reproduce

  • poetry init
  • poetry add beautifulsoup4

Installs sub-dep soupsieve==1.9.8 even though soupsieve==2.0.1 is available:

> poetry run pip freeze
beautifulsoup4==4.9.1
soupsieve==1.9.6

beautifulsoup4 has these lines in setup.py:

install_requires=["soupsieve>1.2"]
if sys.version_info.major == 2:
    install_requires.append("soupsieve<2.0")

ref: https://bazaar.launchpad.net/~leonardr/beautifulsoup/bs4/view/head:/setup.py#L11

poetry somehow picks up this restriction:

> poetry show --tree
beautifulsoup4 4.9.1 Screen-scraping library
├── soupsieve >1.2
└── soupsieve <2.0

and also shows the sub-dep as outdated:

> poetry show --outdated
soupsieve 1.9.6 2.0.1 A modern CSS selector implementation for Beautiful Soup.

This is all I know for now… I’ll look into the wheels, etc.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
dimaqqcommented, May 22, 2020

The tarball is a bit suspect, egg info has both restrictions, but setup.py has a conditional restriction.

tar xzf beautifulsoup4-4.9.1.tar.gz
...
ag soupsieve
...
beautifulsoup4-4.9.1/beautifulsoup4.egg-info/requires.txt
1:soupsieve>1.2
2:soupsieve<2.0
...
beautifulsoup4-4.9.1/setup.py
10:install_requires=["soupsieve>1.2"]
12:    install_requires.append("soupsieve<2.0")
...

If poetry evaluates tarball egg info, how should beautifulsoup4 author write their library so that poetry picks up correct sub-dependency versions for Python3 and Python2?

0reactions
dimaqqcommented, May 29, 2022

beautifulsoup4 project has since removed the Python major conditional entirely. I guess the original issue is now “gone”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

maven dependency pulling a wrong dependency
If you find a crash between different versions of the same dependency, the first thing you should do is figure out whether the...
Read more >
Overriding Dependency Versions and Using Version Ranges ...
Sometimes, Maven's automatic version selection picks the wrong version. For example, you might want to force your program to use an updated ......
Read more >
How to Resolve a Version Collision of Artifacts in Maven
One way to resolve a version collision is by removing a conflicting transitive dependency from specific artifacts. In our example, we don't want...
Read more >
Downgrading versions and excluding dependencies
Overriding transitive dependency versions. Gradle resolves any dependency version conflicts by selecting the latest version found in the dependency graph.
Read more >
Overriding Dependency Versions with Spring Boot
(i.e. it has the wrong version of Reactor). This is because the parent has dependency management for Reactor, and there is no explicit...
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