conda / ceps

Conda Enhancement Proposals
Creative Commons Zero v1.0 Universal
19 stars 24 forks source link

A new test for file existence inside a package (for the new recipe format) #57

Closed wolfv closed 1 month ago

jaimergp commented 1 year ago

I like this a lot! Left a few comments.

I am also wondering how we can test that some files were not added. It is common to have tests/ top-level packages accidentally packaged, and we could have something like:

package_contents:
  files:
     - ~tests  # or "!tests"
wolfv commented 1 year ago

Great point! I think exclamation mark doesn't work in YAML, but tilde is fine.

wolfv commented 1 year ago

Are there other special locations, e.g. for R packages?

dhirschfeld commented 1 year ago

I am also wondering how we can test that some files were not added. It is common to have tests/ top-level packages accidentally packaged, and we could have something like:

package_contents:
  files:
     - ~tests  # or "!tests"

Maybe:

package_contents:
  includes:
    - mamba/api/
  excludes:
     - mamba/tests/
wolfv commented 1 year ago

@dhirschfeld that is also nice, but then it becomes harder to negate the existence of a given shared library, include file, etc. I lean towards ~ as prefix for negation.

wolfv commented 7 months ago

@JeanChristopheMorinPerso the RPM spec that you linked also has this:

%{_includedir}/yaml-cpp/

So it seems that it similarly has a "glob" syntax to take an entire directory. But thanks for the pointer, I didn't know about that!

wolfv commented 7 months ago

Some things that came up yesterday in the mamba meeting:

@JeanChristopheMorinPerso now that I think about it it could be a great idea to have a strict_mode: true / false that means that all files in the package have to be matched by any of the rules.

wolfv commented 7 months ago

Maybe strict_mode should be true by default ... :)

h-vetinari commented 7 months ago

strict_mode sounds cool!

for windows dlls we should do a strong test (e.g. make sure that both dll and lib file exist as a pair

In an ideal world, this would also check that the .lib file is actually an import library, and not a static library with the same name. 😇

wolfv commented 7 months ago

@h-vetinari I just chatted with ChatGPT and looks like we can do that with Goblin and some inspection of the files.

JeanChristopheMorinPerso commented 7 months ago

@JeanChristopheMorinPerso the RPM spec that you linked also has this:

%{_includedir}/yaml-cpp/

So it seems that it similarly has a "glob" syntax to take an entire directory. But thanks for the pointer, I didn't know about that!

They support a glob-style match, but I don't know if %{_includedir}/yaml-cpp/ necessarily does a recursive include or not.

jezdez commented 1 month ago

Closing in favor of #84.