-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
Add tests for .py utilities #835
Conversation
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( |
@plimkilde,
This should work for all architectures. |
This reverts commit f60d0ef.
recipe/meta.yaml
Outdated
- gdal_merge.py --version | ||
- gdal2tiles.py --help | ||
- gdal2xyz.py --help | ||
- gdal_retile.py --version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, dear. Seeing:
gdal_retile.py --version
GDAL 3.7.3, released 2023/10/30
but then it seems like it's exiting with an error code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep 😩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will be addressed per OSGeo/gdal#8676
…layer_algebra return 0 error code when invoked with --version switch Fixes conda-forge/gdal-feedstock#835 (review)
…layer_algebra return 0 error code when invoked with --version switch Fixes conda-forge/gdal-feedstock#835 (review)
…layer_algebra return 0 error code when invoked with --version switch Fixes conda-forge/gdal-feedstock#835 (review)
Finally passing for Linux. Let's see what happens with OSX and Windows. |
Aaargh! Windows testing is just saying:
but not telling us why. Anyone from @conda-forge/gdal have an suggestions for how to get more helpful output here? I really don't speak Windows. |
Hm, I don't see any of the Windows builds successfully running to completion. I'm wondering if we are checking for existence in the correct directory? |
I believe so. |
recipe/meta.yaml
Outdated
- rgb2pct.py --help | ||
- pct2rgb.py --help | ||
# Neither --help nor --version seem to work | ||
# - if not exist %PREFIX%\\Library\\bin\\gdalattachpct.py exit 1 # [win] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe try this next:
# - if not exist %PREFIX%\\Library\\bin\\gdalattachpct.py exit 1 # [win] | |
# - if not exist %LIBRARY_BIN%\\gdalattachpct.py exit 1 # [win] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I believe that's the same.
If we need more info about how things are failing, we could put the tests in their own scripts, say |
@zklaus, that's a great suggestion. |
I think on Windows, you'll need to run:
etc. It's probably popped up a dialog box wanting to know how to execute a |
Trouble is, then we're not testing the documented commands 😕 |
What's documented has never worked on Windows as-is. This has been a source of much confusion when I've been helping Windows users. I've always had to tell people to prefix everything with |
I don't feel inclined to write a passing test for something that doesn't work, so maybe we should limit the scope of this PR to simply adding tests of what works (i.e. Unix), then enabling Windows testing in a later PR when a solution is ready. |
Hi! This is the friendly automated conda-forge-linting service. I wanted to let you know that I linted all conda-recipes in your PR ( Here's what I've got... For recipe:
|
Hm, it seems to pass on Windows with existence checks disabled. As suggested above, I've tried to move them into a separate .bat file to have more details. |
Co-authored-by: Xylar Asay-Davis <[email protected]>
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( |
recipe/test_script_exist.bat
Outdated
REM script checks only for the existence of the .py files below. | ||
|
||
echo Test existence of gdalattachpct.py... | ||
if not exist %PREFIX%\\Library\\bin\\gdalattachpct.py exit 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could tidy up with %LIBRARY_BIN%
but let's see if this works first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That does not seem to make any difference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I said, it's just tidier. If the file isn't one place, it isn't the other because they point the same place. If the test is failing, the file presumably really isn't installed there.
recipe/test_script_exist.bat
Outdated
@echo on | ||
|
||
echo Test existence of gdalattachpct.py... | ||
if not exist %LIBRARY_BIN%\\gdalattachpct.py exit 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Single back slash should do it. You just need double in the yaml.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, though it should work in practice in most cases.
It's passing! I believe this is about the best that can be done without changes to GDAL itself, so I'm marking this PR as ready. |
@@ -0,0 +1,21 @@ | |||
@echo off | |||
REM As a workaround for GDAL apps unexpectedly returning error codes, this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: GDAL 3.8.0RC2 has been issued with the fix for that issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rouault, is there also a plan to move from scripts to entry points to better support Windows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xylar I'm waiting for feedback. See #834 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, sorry, I had noticed that comment and just forgot. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plimkilde, thanks for persisting through this one! Nice work!
Thanks @plimkilde ! |
Checklist
0
(if the version changed)conda-smithy
(Use the phrase@conda-forge-admin, please rerender
in a comment in this PR for automated rerendering)This adds tests for the Python-based GDAL utilities (
gdal_calc.py
,gdal_fillnodata.py
etc.), see #834.Interestingly, local testing revealed spotty support for both
--help
and--version
.