Skip to content

update: numpy, pandas, sdl2 #3164

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Conversation

T-Dynamos
Copy link
Contributor

@T-Dynamos T-Dynamos commented Jun 17, 2025

Closes #3163

Split #3136

@T-Dynamos T-Dynamos marked this pull request as draft June 17, 2025 12:55
@T-Dynamos T-Dynamos force-pushed the numpy-update branch 4 times, most recently from 40f08b6 to a09a2b3 Compare June 19, 2025 12:21
@T-Dynamos T-Dynamos changed the title numpy: update to 2.3.0 update: numpy, pandas, sdl2 Jun 19, 2025
@T-Dynamos T-Dynamos force-pushed the numpy-update branch 3 times, most recently from 1cd30ca to edea820 Compare June 19, 2025 13:28
@T-Dynamos T-Dynamos marked this pull request as ready for review June 19, 2025 13:46
@T-Dynamos
Copy link
Contributor Author

T-Dynamos commented Jun 19, 2025

Ready for review. Hope it can be merged soon!

(One action failed, probably due to an internet connection error)

@kuzeyron kuzeyron added recipe core-providers Core code that's not a recipe labels Jun 24, 2025
@T-Dynamos
Copy link
Contributor Author

@AndreMiras any updates on this?

Copy link
Member

@AndreMiras AndreMiras left a comment

Choose a reason for hiding this comment

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

Yeah thanks for addressing the site package exclude thingy in a different way, at least now it doesn't impact all the other recipes.
However, generally speaking I'm cautious with changes in the core code that introduce a bit more complexity specially if it's for some very rare cases, I hope you understand.

While the changes in download_if_necessary() are easy to grasp and could easily help for more than a couple of recipes, I still want to believe we could try a different approach for the site package exclude dir exception case.
Maybe addressing it from within the Numpy recipe wouldn't be the sexiest, but at least it would be more contained.
Would you mind giving this specific part an extra thought otherwise I can give it a try when I get a chance.
This might as well not be easy at all or would in fact introduce much more complexity and completely off balance the benefits. I haven't explored, but it might be worth thinking about it and giving it a try.
Edit: my naive thought on that one is to Recipe.get_recipe('python3', self.ctx) from numpy prebuild_arch() to then mutate site_packages_dir_blacklist there. It's definitely hacky, but much more contained.

Also if @misl6 thinks otherwise, I totally trust him to make the right call, he's much more active and knowledgeable that anyone else regarding this code base

@T-Dynamos
Copy link
Contributor Author

T-Dynamos commented Jul 13, 2025

@AndreMiras

Recipe.get_recipe('python3', self.ctx) from numpy prebuild_arch()

calls:

def load_source(module, filename):
    # Python 3.5+
    import importlib.util
    if hasattr(importlib.util, 'module_from_spec'):
        spec = importlib.util.spec_from_file_location(module, filename)
        mod = importlib.util.module_from_spec(spec)
        spec.loader.exec_module(mod)
        return mod
    else:
        # Python 3.3 and 3.4:
        from importlib.machinery import SourceFileLoader
        return SourceFileLoader(module, filename).load_module()

However, this dynamic loading of the python3 recipe does not affect self.ctx.python_recipe, because the python_recipe module was already loaded earlier in the build process.

as python_recipe used in pythonforandroid/bootstraps/_sdl_common/__init__.py:

                site_packages_dir = self.ctx.python_recipe.create_python_bundle(
                    join(self.dist_dir, python_bundle_dir), arch)

Edit: My opinion, it's fine as it is :)

@T-Dynamos T-Dynamos requested a review from AndreMiras July 13, 2025 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-providers Core code that's not a recipe recipe
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Numpy recipe
3 participants