From 2dc3cbf52f5ec2a9f25daba0afeba0d85bb40ec3 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 1 Sep 2022 14:11:17 -0500 Subject: [PATCH 1/7] try pip --- recipe/bld.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/bld.bat b/recipe/bld.bat index 7a4b862..c58f536 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -8,7 +8,7 @@ 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 . --dest-dir=dist --no-deps --no-build-isolation if errorlevel 1 exit 1 REM set dep_dir=%LIBRARY_BIN% From bdcbe526bcc0e985fdb2d341cc3316e6c1ecc683 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 1 Sep 2022 14:20:45 -0500 Subject: [PATCH 2/7] Update bld.bat --- recipe/bld.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/bld.bat b/recipe/bld.bat index c58f536..521ebd9 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -8,7 +8,7 @@ echo HDF5_incdir = %LIBRARY_INC% >> %SITECFG% echo netCDF4_libdir = %LIBRARY_LIB% >> %SITECFG% echo netCDF4_incdir = %LIBRARY_INC% >> %SITECFG% -%PYTHON% -m pip wheel . --dest-dir=dist --no-deps --no-build-isolation +%PYTHON% -m pip wheel . --wheel-dir=dist --no-deps --no-build-isolation if errorlevel 1 exit 1 REM set dep_dir=%LIBRARY_BIN% From f8b9ea152d26a09e2d2d30b0909c058cc8270675 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 1 Sep 2022 14:29:39 -0500 Subject: [PATCH 3/7] verbose --- recipe/bld.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/bld.bat b/recipe/bld.bat index 521ebd9..60fdcbd 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -8,7 +8,7 @@ echo HDF5_incdir = %LIBRARY_INC% >> %SITECFG% echo netCDF4_libdir = %LIBRARY_LIB% >> %SITECFG% echo netCDF4_incdir = %LIBRARY_INC% >> %SITECFG% -%PYTHON% -m pip wheel . --wheel-dir=dist --no-deps --no-build-isolation +%PYTHON% -m pip wheel . --wheel-dir=dist --no-deps --no-build-isolation -vv if errorlevel 1 exit 1 REM set dep_dir=%LIBRARY_BIN% From 6a01ea2590bf40f04340e81402654341e3753b58 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 1 Sep 2022 14:39:37 -0500 Subject: [PATCH 4/7] windows-2019 for now --- .github/workflows/conda-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: From 4426ce9b0a52a9a8d98c5786a02ce65846a5361d Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 1 Sep 2022 15:29:16 -0500 Subject: [PATCH 5/7] delocate --- recipe/bld.bat | 7 ++++--- recipe/fix_windows_wheel.py | 2 +- recipe/meta.yaml | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/recipe/bld.bat b/recipe/bld.bat index 60fdcbd..7eee0fe 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -11,9 +11,10 @@ echo netCDF4_incdir = %LIBRARY_INC% >> %SITECFG% %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 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..a90766f 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -32,6 +32,7 @@ requirements: - hdf5 - libnetcdf - zlib + - delocate # [win] run: - python - setuptools From 21e5a81255d039dde8e9117d245656b176fdbddd Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 1 Sep 2022 17:36:02 -0500 Subject: [PATCH 6/7] Don't test the conda package --- recipe/bld.bat | 2 +- recipe/meta.yaml | 19 +++++++------------ recipe/run_test.bat | 4 ++++ 3 files changed, 12 insertions(+), 13 deletions(-) create mode 100644 recipe/run_test.bat diff --git a/recipe/bld.bat b/recipe/bld.bat index 7eee0fe..bd39420 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -21,5 +21,5 @@ 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/meta.yaml b/recipe/meta.yaml index a90766f..d77e8c0 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -15,6 +15,11 @@ build: - ncinfo = netCDF4.utils:ncinfo - nc4tonc3 = netCDF4.utils:nc4tonc3 - nc3tonc4 = netCDF4.utils:nc3tonc4 + ignore_run_exports_from: + - zlib + - hdf5 + - libnetcdf + - numpy requirements: build: @@ -35,20 +40,10 @@ requirements: - 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" From 63293bd5a9eb78477724260c41926b828a0fd7cd Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 1 Sep 2022 17:59:39 -0500 Subject: [PATCH 7/7] delete entrypoints --- recipe/meta.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index d77e8c0..16ce9e1 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -11,10 +11,6 @@ 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