Coder Social home page Coder Social logo

Comments (9)

drbenmorgan avatar drbenmorgan commented on July 23, 2024

Hi @gaede, apologies for that, I'll get a fix Pull Request prepared.

from podio.

drbenmorgan avatar drbenmorgan commented on July 23, 2024

Having had a quick look at this, there are a several ways to resolve this so thought better to discuss here before fixing in a Pull Request:

  1. Restore original behaviour, so the install tree would look like:

    +- CMAKE_INSTALL_PREFIX/
       +- python/
       +- templates/
    

    The simplest, but will cause problems for packagers - e.g. say the install prefix is /usr/local, then /usr/local/templates is non-standard and could easily clash (I'm ignoring the python dir for now!).

  2. Move templates as a subdirectory of python, so the relative path becomes "./templates". This is probably the best solution if the template files aren't for general access/use, i.e. only podio's python code will read them.

  3. Update the relative path on install using known install locations to construct a relative path.

I'll implement whatever solution is preferred for podio. My personal recommendation would be the second one if the template files are only intended for internal use by podio's class generation.

from podio.

gaede avatar gaede commented on July 23, 2024

Hi @drbenmorgan, I'd also vote for option 2). Can't think of any other use cases for the templates than from our python generators.

from podio.

gaede avatar gaede commented on July 23, 2024

PS: shouldn't the INSTALL_DIR/python have a podio subdirectory in case someone wants to install to /usr/local/ ?

from podio.

drbenmorgan avatar drbenmorgan commented on July 23, 2024

Thanks @gaede, I'll go ahead and implement 2).

You're right on the INSTALL_DIR/python issue, but python/podio also seems odd. Looking at the files in python/, there are some programs and modules

  • programs: podio_class_generator.py, podio_create_package.py
  • modules: podio_config_reader.py, podio_templates.py, EventStore.py

The former should probably go under a bin/ subdirectory, but am not sure about the latter. I'd guess lib/pythonX.Y/site-packages/podio. Maybe just install them all to bin for now?

from podio.

drbenmorgan avatar drbenmorgan commented on July 23, 2024

Ah scratch that install to bin, since that would stick templates under that which wouldn't be good.

from podio.

gaede avatar gaede commented on July 23, 2024

How about having sth like:

/usr/local/include
/usr/local/lib
/usr/local/podio
/usr/local/podio/python
/usr/local/podio/templates
/usr/local/podio/...

Then we could easily add whatever is needed to /usr/local/podio/ ?

from podio.

drbenmorgan avatar drbenmorgan commented on July 23, 2024

I've submitted a Pull Request to fix the main issue using the 2nd option. Long term, it's probably best to think about a structure like:

+- bin/
    +- podio_class_generator
+- include/
    +- podio/
+- lib/
    +- libpodio.so
    +- ...dict...
    +- cmake/
    +- pythonX.Y/
       +- site-packages/
          +- podio/
             +- EventStore.py ?
             +- podio_config_reader.py ?
                 ...

That would require a little more work though, so thought best to submit the PR to get the fix in directly for now!

from podio.

peremato avatar peremato commented on July 23, 2024

from podio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.