Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix windows tests #1104

Merged
merged 5 commits into from
Aug 29, 2024
Merged

Fix windows tests #1104

merged 5 commits into from
Aug 29, 2024

Conversation

ocefpaf
Copy link
Member

@ocefpaf ocefpaf commented Aug 14, 2024

This should fix the detection of nczarr on Windows but will work only on CIs with bash and conda. I guess that is our default environment for developing on Windows anyway. I'm looking into upstream a non-bash script to libnetcdf so we can drop these workarounds.

Closes #1102

Copy link

codecov bot commented Aug 14, 2024

Codecov Report

Attention: Patch coverage is 73.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 81.79%. Comparing base (f28f321) to head (3213f6d).
Report is 17 commits behind head on develop.

Files with missing lines Patch % Lines
compliance_checker/protocols/zarr.py 66.66% 1 Missing and 2 partials ⚠️
compliance_checker/cf/cf_1_9.py 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1104   +/-   ##
========================================
  Coverage    81.79%   81.79%           
========================================
  Files           25       25           
  Lines         5212     5223   +11     
  Branches      1255     1256    +1     
========================================
+ Hits          4263     4272    +9     
- Misses         642      644    +2     
  Partials       307      307           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ocefpaf
Copy link
Member Author

ocefpaf commented Aug 14, 2024

@benjwadams the nc-config bash script is working now on Windows. The error now is probably upstream with nczarr's implementation on Windows:

Error:NCpathcvt: stat=-36 (NetCDF: Invalid argument)
Windows fatal exception: access violation

Current thread 0x000017e0 (most recent call first):

Edit:
I'm going to skip that test until we figure this out.

I was able to get this to work on my Windows machine. Not sure what are the differences here. Investigating... It is quite frustrating!

@ocefpaf
Copy link
Member Author

ocefpaf commented Aug 14, 2024

@benjwadams this one is ready for review. While nc-config is working on Windows now, nczarr is not. I'm debugging this and will open an issue upstream when ready. I'm pretty sure it is unrelated to compliance-checker.

@ocefpaf ocefpaf marked this pull request as draft August 15, 2024 13:54
@ocefpaf ocefpaf force-pushed the fix_windows_tests branch 2 times, most recently from 61d9cc7 to d762a0c Compare August 15, 2024 17:31
@ocefpaf ocefpaf marked this pull request as ready for review August 15, 2024 17:35

def _fix_windows_slashes(zarr_url):
if platform.system() == "Windows":
zarr_url = zarr_url.replace("///", "//")
Copy link
Member Author

Choose a reason for hiding this comment

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

This one had me chasing red herrings all over the code base. I'm not sure if nczarr has a bug, or Python as_uri, or something else. All I know is that we can't have 3 / on Windows, only 2!

Comment on lines +23 to +28
on_windows = platform.system() == "Windows"

if on_windows:
ncconfig = ["sh", f"{os.environ['CONDA_PREFIX']}\\Library\\bin\\nc-config"]
else:
ncconfig = ["nc-config"]
Copy link
Member Author

Choose a reason for hiding this comment

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

@benjwadams while this works, I'm not sure we need this. We can find the version with netCDF4 and let the zarr availability be checked by the failing test. What do you think?

@ocefpaf
Copy link
Member Author

ocefpaf commented Aug 22, 2024

@benjwadams I'd like to go back to #1094 but it would be nice to get this one in first to avoid big conflicts. Do you think you'll have some time to check this one? It is mostly adding Windows tests and a small fix.

@benjwadams benjwadams merged commit b164024 into ioos:develop Aug 29, 2024
26 of 27 checks passed
@ocefpaf ocefpaf deleted the fix_windows_tests branch August 29, 2024 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants