Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions build_envs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ dependencies:
- matplotlib
- netcdf4
- numpy
- packaging
- pycodestyle
- setuptools
- sphinx
- sphinx_rtd_theme
- sphinxcontrib-googleanalytics
Expand Down
21 changes: 2 additions & 19 deletions src/wrf/__init__.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,8 @@
from __future__ import (absolute_import, division, print_function)
import os
import pkg_resources

try:
from . import api
from .api import *
except ImportError:
# For gfortran+msvc combination, extra shared libraries may exist
# (stored by numpy.distutils)
if os.name == "nt":
req = pkg_resources.Requirement.parse("wrf-python")
extra_dll_dir = pkg_resources.resource_filename(req,
"wrf-python/.libs")
Comment on lines -12 to -14
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.

if os.path.isdir(extra_dll_dir):
os.environ["PATH"] += os.pathsep + extra_dll_dir

from . import api
from .api import *
else:
raise

from . import api
from .api import *

__all__ = []
__all__.extend(api.__all__)
Loading