diff --git a/.github/workflows/conda-build.yml b/.github/workflows/conda-build.yml index 677bf7c..6156ed5 100644 --- a/.github/workflows/conda-build.yml +++ b/.github/workflows/conda-build.yml @@ -8,7 +8,7 @@ on: [push, pull_request] jobs: build: name: ${{ matrix.CONFIG }} - runs-on: ${{ matrix.os }}-latest + runs-on: windows-2019 strategy: fail-fast: false matrix: diff --git a/recipe/bld.bat b/recipe/bld.bat index 7a4b862..bd39420 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -8,17 +8,18 @@ echo HDF5_incdir = %LIBRARY_INC% >> %SITECFG% echo netCDF4_libdir = %LIBRARY_LIB% >> %SITECFG% echo netCDF4_incdir = %LIBRARY_INC% >> %SITECFG% -%PYTHON% setup.py bdist_wheel +%PYTHON% -m pip wheel . --wheel-dir=dist --no-deps --no-build-isolation -vv if errorlevel 1 exit 1 -REM set dep_dir=%LIBRARY_BIN% -REM python %RECIPE_DIR%\fix_windows_wheel.py %dep_dir%\mpir.dll %dep_dir%\mpfr.dll %dep_dir%\mpc.dll %dep_dir%\flint-16.dll %dep_dir%\pthreadVSE2.dll %dep_dir%\zlib.dll -REM if errorlevel 1 exit 1 +set dep_dir=%LIBRARY_BIN% +python %RECIPE_DIR%\fix_windows_wheel.py %dep_dir%\hdf5.dll %dep_dir%\netcdf.dll %dep_dir%\libcurl.dll %dep_dir%\libcrypto-3-x64.dll %dep_dir%\zlib.dll ^ + %dep_dir%\mfhdf.dll %dep_dir%\hdf5_hl.dll %dep_dir%\zip.dll %dep_dir%\libssh2.dll %dep_dir%\libbz2.dll %dep_dir%\xdr.dll %dep_dir%\hdf.dll +if errorlevel 1 exit 1 mkdir %RECIPE_DIR%\..\build_artifacts mkdir %RECIPE_DIR%\..\build_artifacts\pypi_wheels for %%f in (dist\*.whl) do ( cp %%f %RECIPE_DIR%\..\build_artifacts\pypi_wheels\ - %PYTHON% -m pip install %%f + cp %%f %PREFIX%\ ) diff --git a/recipe/fix_windows_wheel.py b/recipe/fix_windows_wheel.py index 0eb07d1..ec9d8a1 100644 --- a/recipe/fix_windows_wheel.py +++ b/recipe/fix_windows_wheel.py @@ -16,7 +16,7 @@ def add_library(lib_paths, dist_path="dist"): fname = os.path.abspath(fname) with wheeltools.InWheel(fname, fname): for lib_path in lib_paths: - shutil.copy2(lib_path, pjoin("netcdf4", "lib")) + shutil.copy2(lib_path, pjoin("netCDF4")) def main(): diff --git a/recipe/meta.yaml b/recipe/meta.yaml index d26b66d..16ce9e1 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -11,10 +11,11 @@ source: build: skip: true # [not (win and vc>=14)] number: 0 - entry_points: - - ncinfo = netCDF4.utils:ncinfo - - nc4tonc3 = netCDF4.utils:nc4tonc3 - - nc3tonc4 = netCDF4.utils:nc3tonc4 + ignore_run_exports_from: + - zlib + - hdf5 + - libnetcdf + - numpy requirements: build: @@ -32,22 +33,13 @@ requirements: - hdf5 - libnetcdf - zlib + - delocate # [win] run: - python - - setuptools - - {{ pin_compatible('numpy') }} - - cftime - - hdf5 - - libnetcdf test: - imports: - - netCDF4 - - cftime - commands: - - ncinfo -h - - nc4tonc3 -h - - nc3tonc4 -h + requires: + - pip about: home: http://github.com/Unidata/netcdf4-python diff --git a/recipe/run_test.bat b/recipe/run_test.bat new file mode 100644 index 0000000..0fecb5d --- /dev/null +++ b/recipe/run_test.bat @@ -0,0 +1,4 @@ +for %%f in (%PREFIX%\*.whl) do ( + "%PYTHON%" -m pip install %%f +) +"%PYTHON%" -c "import netCDF4"