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

BUG: problems with package_contents: lib: tests #1153

Closed
h-vetinari opened this issue Nov 2, 2024 · 5 comments
Closed

BUG: problems with package_contents: lib: tests #1153

h-vetinari opened this issue Nov 2, 2024 · 5 comments

Comments

@h-vetinari
Copy link

h-vetinari commented Nov 2, 2024

In, the libaries are not named according to the usual pattern, but using the package_contents tests apparently is not compatible with selectors?

For zlib, I'm currently using

    tests:
      - package_contents:
          include:
            - zlib.h
          lib:
            # naming pattern doesn't match `lib<foo>.so` (unix) & `foo.dll` (win)
            - if unix:
              then:
                - z
              else:
                - zlib

which causes

Error:   × Parsing: expected a scalar value.
     ╭─[102:22]
 101 │                 # naming pattern doesn't match `lib<foo>.so` (unix) & `foo.dll` (win)
 102 │ ╭─▶             - if unix:
 103 │ │                 then:
 104 │ │                   - z
 105 │ │                 else:
 106 │ ├─▶                 - zlib
     · ╰──── expected a string value for `globs`

Also "expected a scalar value" sounds bad, because some packages contain several libraries (and so obviously it needs to be possible to put a list under lib:).

@h-vetinari h-vetinari changed the title BUG: problems with package_contents: libs: BUG: problems with package_contents: lib: tests Nov 2, 2024
@wolfv
Copy link
Member

wolfv commented Nov 2, 2024

The syntax is wrong - it should be "if: unix" not "if unix:"

@h-vetinari
Copy link
Author

gah, that's a trap I'm sure to fall into several times (as it diverges from how to write this in vanilla python...)

@wolfv
Copy link
Member

wolfv commented Nov 2, 2024

If you use VS Code they should show you that it's not according to the JSON spec :)

@wolfv
Copy link
Member

wolfv commented Nov 2, 2024

Image

@wolfv
Copy link
Member

wolfv commented Nov 2, 2024

Image

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

No branches or pull requests

2 participants