-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,4 @@ include *.py | |
include *.release | ||
include *.sh | ||
include LICENSE | ||
include _build/*.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -*- coding: utf-8 -*- | ||
import os | ||
from setuptools.build_meta import * | ||
import subprocess | ||
|
||
|
||
def netcdf_has_parallel_support(): | ||
netcdf4_dir = os.environ.get("NETCDF4_DIR") | ||
ncconfig = os.path.join(netcdf4_dir, "bin", "nc-config") if netcdf4_dir else "nc-config" | ||
process = subprocess.run([ncconfig, "--has-parallel4"], capture_output=True) | ||
out = process.stdout.decode("utf-8").rstrip() | ||
return out == "yes" | ||
|
||
|
||
def get_requires_for_build_editable(config_settings=None): | ||
return ["mpi4py>=3.1"] if netcdf_has_parallel_support() else [] | ||
|
||
|
||
def get_requires_for_build_wheel(config_settings=None): | ||
return ["mpi4py>=3.1"] if netcdf_has_parallel_support() else [] | ||
|
||
|
||
def get_requires_for_build_sdist(config_settings=None): | ||
return ["mpi4py>=3.1"] if netcdf_has_parallel_support() else [] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters