Comments (7)
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.
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.
is there a problem with a cycle there? it's already cyclical but the metadata doesn't match that
from soupsieve.
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.
in my experience poetry handles cycles fine -- do you have a link to a failure there?
from soupsieve.
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.
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)
- CDATA handling in HTML changed in lxml parser with libxml2 2.9.12 HOT 21
- Interesting psuedo class to keep an eye on `:in()` HOT 8
- Rework internal structure of "relations" HOT 1
- circular dependency /bs4 HOT 15
- Attribute selectors vs \n in values HOT 5
- Change in `:has()` CSS Level 4 spec - document our difference or update? HOT 1
- hatch? HOT 5
- Using Hatch in Python 3.6 is technically not allowed HOT 7
- setup.py is mentioned in readme but there is no setup.py HOT 2
- Invalid syntax error on python3.4 HOT 5
- Tracking `:scope` issue related to relative selector lists (`:has()`) HOT 1
- pyproject.toml: validation error since setuptools 61.2.0 HOT 8
- PermissionError: [Errno 13] Permission denied HOT 4
- LXML does not currently generate wheels for Python 3.11 on Windows
- `:has()` is no longer forgiving HOT 1
- malformed attribute selector HOT 7
- The new type hints cause pytest to hang after test session HOT 4
- Attribute Selector Case Sensitivity: Whitespace HOT 1
- Potentially rework CSS parsing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from soupsieve.