Coder Social home page Coder Social logo

Comments (7)

facelessuser avatar facelessuser commented on August 17, 2024 1

As the conversation on this has died out, I will close this with the following comment:

Soup Sieve was originally created to accept BS4 objects/elements and to apply selectors, but the hope was always to replace the official CSS selectors in BS4. Since it has been accepted as the new official CSS selector support in BS4 and is a required dependency of BS4., Soup Sieve can really be viewed as a sub-module of Beautiful Soup as it is not optional and is not useful by itself.

Soup Sieve does offer some optional ways to apply selectors that are not built into Beautiful Soup such as closest, etc. These require you to explicitly import those methods, but Soup Sieve is still considered a part of Beautiful Soup at this point. If BS4 made CSS selectors optional, then, and only then, would we add the BS4 requirement to this package.

from soupsieve.

facelessuser avatar facelessuser commented on August 17, 2024

Yep, nor will it be. The reason is we didn't want to create a circular dependency. Originally, we weren't sure that it would be accepted as the official CSS selector library of BeautifulSoup. If it had not been accepted, we would have had to require bs4 as a dependency.

Generally, it is expected that you will get the package by installing bs4, but if you don't, you will need to install bs4.

from soupsieve.

asottile-sentry avatar asottile-sentry commented on August 17, 2024

is there a problem with a cycle there? it's already cyclical but the metadata doesn't match that

from soupsieve.

facelessuser avatar facelessuser commented on August 17, 2024

Most people aren't going to install soupsieve directly.

Now, this shouldn't be a surprise either as we do document this fact here and here.

I have had some projects that have created this circular dependency before, and this is especially problematic for people using tools to pin certain package versions, like when using Poetry or other package management systems. In these cases, people will complain about the circular dependency.

So, this is a lose-lose situation for me. I'll have people complain if I don't create the circular link, and I'll have people that will complain if I do create the circular link. So, end the end, I chose the path that doesn't actually break anything. Yes, if you don't have bs4, soupsieve won't work, but if you install bs4, it will work fine. The alternative is I break things like Poetry with no resolution.

from soupsieve.

asottile-sentry avatar asottile-sentry commented on August 17, 2024

in my experience poetry handles cycles fine -- do you have a link to a failure there?

from soupsieve.

facelessuser avatar facelessuser commented on August 17, 2024

I would have to dig up failures as it was in a different project. Whether it was specifically poetry or some other pip locking library, I don't recall, but what I do recall were very real complaints. I am not looking to revisit and cause the same problems with this project.

from soupsieve.

facelessuser avatar facelessuser commented on August 17, 2024

Just as an FYI, some of the issues related to circular dependencies were installing packages manually: squidfunk/mkdocs-material#2591. Additionally, there are tools like Pyodide which have to install packages manually. SoupSieve is supported there as well: https://github.com/pyodide/pyodide/tree/main/packages/soupsieve. They would have to add special exceptions to handle this odd, two-way dependency.

I didn't find the specific example of other package managers, I'm not sure where the original conversation was, but I'm still fairly certain it was an issue at some time in at least one of them.

from soupsieve.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.