Skip to content

Correct constraint extraction code for Python not installed error message #605

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

Merged
merged 1 commit into from
Jun 20, 2025

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Jun 20, 2025

Some of the templates make use of Python packages. These dependencies are managed by the "Poetry" tool.

The templates provide a task for automatically installing the project's managed version of Poetry (#604). Python is required to install Poetry (and to use it after installation), so this is a prerequisite for project contributors using the template locally. In order to make the project infrastructure more friendly for contributors, instead of failing with a cryptic error if Python is not installed, the task starts by checking whether Python is installed, and if not displays a friendly error message explaining the need to install it.

The project's standard Python version must later be available for use by Poetry, so it makes sense for the contributor to install that version of Python in this case, rather than installing an arbitrary version and then needing to install yet another copy later. For this reason, the task contains code to determine the version constraint for the Python dependency and include that information in the error message.

Previously that code extracted the version constraint for Poetry instead of for Python as intended, resulting in incorrect information in the error message. The code is hereby corrected to get the correct data.

…sage

Some of the templates make use of Python packages. These dependencies are managed by the "Poetry" tool.

The templates provide a task for automatically installing the project's managed version of Poetry. Python is required to
install Poetry (and to use it after installation), so this is a prerequisite for project contributors using the template
locally. In order to make the project infrastructure more friendly for contributors, instead of failing with a cryptic
error if Python is not installed, the task starts by checking whether Python is installed, and if not displays a
friendly error message explaining the need to install it.

The project's standard Python version must later be available for use by Poetry, so it makes sense for the contributor
to install that version of Python in this case, rather than installing an arbitrary version and then needing to install
yet another copy later. For this reason, the task contains code to determine the version constraint for the Python
dependency and include that information in the error message.

Previously that code extracted the version constraint for Poetry instead of for Python as intended, resulting in
incorrect information in the error message. The code is hereby corrected to get the correct data.
@per1234 per1234 self-assigned this Jun 20, 2025
@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: code Related to content of the project itself topic: infrastructure Related to project infrastructure labels Jun 20, 2025
@per1234 per1234 merged commit 4aa8111 into arduino:main Jun 20, 2025
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant