Skip to content
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

Do not require downloading xbuildenv when updating package recipes #30

Merged

Conversation

agriyakhetarpal
Copy link
Member

Description

Closes #25. This PR improves the xbuildenv search logic to not require downloads of the xbuildenv if a package update fails (for any reason). This means that the Pyodide root is searched in the current directory, and if it doesn't exist, we simply assume that the current working directory is the Pyodide root (and the packages/ directory one level down hosts the recipes).

I confirmed that this does not currently cause issues with the existing setup in the Pyodide repository.

Copy link
Member

@ryanking13 ryanking13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I left some minor comments, otherwise looks good to me.

@@ -250,7 +250,7 @@ def _download(self, url: str, path: Path) -> None:
Path to extract the cross-build environment to.
If the path already exists, raise an error.
"""
logger.info("Downloading Pyodide cross-build environment from %s", url)
logger.info(f"Downloading Pyodide cross-build environment from {url}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recently learned that it is not recommended not to use f-strings in log calls (pyodide/micropip#131).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pointer! I'll keep that in mind and add a Ruff rule for this in another PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in de4e3d7.

agriyakhetarpal and others added 2 commits September 18, 2024 14:35
Co-Authored-By: Gyeongjae Choi <def6488@gmail.com>
Co-Authored-By: Gyeongjae Choi <def6488@gmail.com>
@agriyakhetarpal agriyakhetarpal merged commit 9b65d5f into pyodide:main Sep 18, 2024
6 checks passed
@agriyakhetarpal agriyakhetarpal deleted the fix/no-xbuildenv-when-updating branch September 18, 2024 09:25
agriyakhetarpal added a commit that referenced this pull request Sep 19, 2024
## Description

Thanks to the tip in
#30 (comment),
I enabled a Ruff rule to avoid using f-strings in future logging
statements we add: https://docs.astral.sh/ruff/rules/logging-f-string/,
and converted the previous ones to comply with the rule. It's not
necessarily required, but it's good to enable best practices.

> [!IMPORTANT]  
> This PR should be merged with a merge commit, not squashed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pyodide skeleton pypi --update (or --update-patched) shouldn’t need to install xbuildenv if it fails
2 participants