Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

try pip #2

Merged
merged 7 commits into from
Sep 5, 2022
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: 1 addition & 1 deletion .github/workflows/conda-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 6 additions & 5 deletions recipe/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines +14 to +17
Copy link
Owner

Choose a reason for hiding this comment

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

In theory we can replace this line with

delvewheel repair -w {dest_dir} {wheel}

now, right?


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%\
)
2 changes: 1 addition & 1 deletion recipe/fix_windows_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
24 changes: 8 additions & 16 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions recipe/run_test.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
for %%f in (%PREFIX%\*.whl) do (
"%PYTHON%" -m pip install %%f
)
"%PYTHON%" -c "import netCDF4"