-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check pyproject requirements before running unit tests #169
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
I was hoping this would be possible to solve on Poetry level. Looking into Poetry code that prints https://github.com/python-poetry/poetry/blob/main/src/poetry/utils/env/env_manager.py#L421 |
This comment was marked as resolved.
This comment was marked as resolved.
Well, I was hoping that you could turn off the autodetection via config 🤷 I also found that code you referenced, but it didn't feel right to depend on undocumented behavior found by digging in the code. |
Oh, you're right, I overlooked that, thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I think we can use this documented feature: https://python-poetry.org/docs/managing-environments/ I did quick local test with multiple Python versions available and some constraint in Pytproject.toml and it seems to be doing what we want. For example doing it in two steps:
-> This will raise error if the requirements do not match selected version
|
@Pijukatel Since this is non-intrusive and not a huge priority, I'll merge this now. If you want to propose a different solution, feel free to open another PR. |
See https://github.com/apify/crawlee-python/actions/runs/13078683861/job/36501197341 for a practical application
Since it doesn't seem to be possible to reuse code in reusable workflows, I just added this to unit tests...