Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork258
Make Ruff an optional dependency to avoid upper bound restriction#998
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Currently, openapi-python-client/pyproject.toml Line 17 ina73dfd4
But this means that if a user includes We need to pin our Could |
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 2 comments 8 replies
-
I see here why Ruff is a hard dependency:https://github.com/openapi-generators/openapi-python-client?tab=readme-ov-file#installation
It might be nice to make this optional? I do see the convenience, but for example, on our project we manage Ruff format ourselves as do perhaps others? And then if it were made optional the Ruff version wouldn't need to be restricted by |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
So what a lot of projects do in this situation is to make the default recommended way to install the package include all extras, see And even theFastAPI docs prescribe this. Another popular package that does this ispsycopg: This could be a nice middle ground for To install That way, when users come to the project, they are always shown a good default experience with all of the tools you would like to support? |
BetaWas this translation helpful?Give feedback.
All reactions
-
Oh that's a good idea, and we could make it a breaking change so hopefully folks read the changelog and add the features as needed. Would also need to tweak the GitHub Action so that it adds the features automatically, but only for new enough versions of the generator 🤔. |
BetaWas this translation helpful?Give feedback.
All reactions
👍 2
-
Any updates on this? Just stumbled upon this issue myself. I had this project on 0.20.0 as a dependency while my project has the newest Ruff version, which caused a conflict. I updated to 0.21.5, but I shouldn't be forced to IMO |
BetaWas this translation helpful?Give feedback.
All reactions
-
@dbanty We just hit this problem again where when we updated our dependencies, Ruff updated to 0.8.x first and then: |
BetaWas this translation helpful?Give feedback.
All reactions
-
This is also a ongoing discussions to propose a way to define default extras, which would also solve this problem if the proposal is accepted and implemented |
BetaWas this translation helpful?Give feedback.
All reactions
-
I know it's not as good as optional, but starting with 0.27 there will be no upper bound of Ruff anymore, since I think I reduced the risk of generation breaking on every major version of Ruff. If we can get the Jinja templates into a nice enough state that the code they create is tolerablewithout Ruff, I will make it optional. Easier said than done, though, since whitespace is extra hard with those 😓 |
BetaWas this translation helpful?Give feedback.
All reactions
❤️ 1
-
@dbanty I think this is a very pragmatic move and I appreciate the careful consideration of trade offs you are taking. |
BetaWas this translation helpful?Give feedback.
All reactions
❤️ 1