NNPDF / pineappl

PineAPPL is not an extension of APPLgrid
https://nnpdf.github.io/pineappl/
GNU General Public License v3.0
12 stars 3 forks source link

Expose build information to Python #136

Closed felixhekhorn closed 2 years ago

felixhekhorn commented 2 years ago

How about adding something like https://github.com/PyO3/maturin/issues/100 ? or as is written there https://github.com/PyO3/pyo3-built/

this would facilitate the debugging process ...

alecandido commented 2 years ago

pyo3-built looks unnecessarily complex and too unmaintained.

I'd suggest to go for the first option, it looks perfect to me :)

cschwan commented 2 years ago

That's a good idea, I'll look into it!

cschwan commented 2 years ago

I tried adding

m.add("__version__", env!("CARGO_PKG_VERSION"))?;

in src/lib.rs, but this doesn't have an effect. It should add a variable pineappl.__version__, shouldn't it?

felixhekhorn commented 2 years ago

yes - you can check the available attributes with dir (in case it got bound somewhere else ...)

felixhekhorn commented 2 years ago

@cschwan the magic was just in the nesting of the layers (it got bound in pineappl.pineappl) - I reexposed it again on top level

felixhekhorn commented 2 years ago

@scarlehoff this is what would have helped us in hunting https://github.com/NNPDF/nnpdf/pull/1529#issuecomment-1137520115

cschwan commented 2 years ago

@felixhekhorn cheers!