Skip to content

Conversation

kafitzgerald
Copy link
Collaborator

@kafitzgerald kafitzgerald commented Jul 17, 2025

Removes deprecated pkg_resources.

This shouldn't cause any problems for the Linux or macOS builds since it was originally used as a workaround for some Windows specific issues tied to np.distutils. And we no longer rely upon distutils so in theory removing this shouldn't be an issue there either. Unfortunately, we don't have testing for Windows, but we also aren't releasing Windows builds at the moment either.

I'll make sure we have an issue open for Windows testing / releases, but I'm inclined to get this merged without that and hopefully prioritize that soon.

Closes #280

@kafitzgerald kafitzgerald requested a review from erogluorhan July 17, 2025 19:37
Copy link
Collaborator

@erogluorhan erogluorhan left a comment

Choose a reason for hiding this comment

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

Sounds good to me; thanks for doing this!

@kafitzgerald kafitzgerald merged commit cef7105 into NCAR:develop Jul 18, 2025
16 checks passed
@kafitzgerald kafitzgerald deleted the rm_pkg_resources branch July 18, 2025 23:05
Comment on lines -12 to -14
req = pkg_resources.Requirement.parse("wrf-python")
extra_dll_dir = pkg_resources.resource_filename(req,
"wrf-python/.libs")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the updated version of this is importlib.resources.path("wrf", ".libs"), which seems to have been added in 3.7. mesonbuild/meson-python#700 includes discussion on a similar topic. This comment and the followup have suggestions, and also say that I should run into any problems in my default development environment, which simplifies checks.

Copy link
Contributor

Choose a reason for hiding this comment

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

A guess based on the directory name (and Python doing its own search for imported extension modules) is that this is for the Fortran and OpenMP runtimes, which would be stored there by Windows wheel-packaging machinery, which was your guess. Since I build and install on the same system, I don't need to package those libraries, nor ensure they are on the path.

If you decide conda is the recommended binary distribution system on Windows, that should be irrelevant.

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.

Remove deprecated use of pkg_resources

3 participants