dapper91 / pydantic-xml

python xml for humans
https://pydantic-xml.readthedocs.io
The Unlicense
155 stars 16 forks source link

`pyproject.toml`: Upper bound version constraints create unnecessary conflicts #83

Closed ja-albert closed 1 year ago

ja-albert commented 1 year ago

Hi :) First of all, thank you for your work on pydantic-xml!

I am currently using version 2.0.0a1, and so far, everything works :+1:

However, I have a different problem, related to Poetry and the pyproject.toml: I also use Poetry, but avoid upper bound versions, as this causes problems more often than it solves them. For example, here is a (pretty long) article explaining this topic: https://iscinumpy.dev/post/bound-version-constraints/ TL;DR: If you use upper bound versions (especially as a library), you will probably break code that depends on you. Worse, the other code cannot fix this, as it cannot relax your version constraints. Yes, upper bound versions is the default for Poetry, but even they acknowledge that it might be problematic: https://python-poetry.org/docs/faq/#are-unbound-version-constraints-a-bad-idea

In my concrete case:

As a workaround for both, I changed my pydantic-xml dependency to: pydantic-xml = {version = "=2.0.0a1", python = ">=3.10, <4.0"}

Additionally, unless you have a concrete reason not to, it could be beneficial for others if you relax all the upper bounds on the dependencies. Thank you!

dapper91 commented 1 year ago

Hi. Thanks for the provided links. Your proposal sounds reasonable. I will fix it in the next version.

ja-albert commented 1 year ago

Thank you, your changes work on my side 👍