Giter Site home page Giter Site logo

Comments (3)

cjolowicz avatar cjolowicz commented on August 29, 2024 1

Thanks @pawamoy and @yajo for providing these insights!

I'm leaning towards the solution using a single license file with Jinja2 conditions because I find it more self-contained. Another example of a project template using this approach is cookiecutter-django. The folder solution has advantages in maintainability and readability, but I'd rather not add more logic to the hooks, and the set of supported licenses won't change very often. That's my reasoning anyway, feel free to raise additional points.

Pull requests for this would be very welcome 😉

from cookiecutter-hypermodern-python.

pawamoy avatar pawamoy commented on August 29, 2024

Check out how I'm doing this in cookie-poetry.
I basically add a choice field in cookiecutter.json with all licenses, and a folder in the template with a file for each license that gets generated. In a post-hook, I copy the selected license to the right place and delete the whole licenses folder (now useless).

Maybe not the best method, but it works 🙂
I know @yajo is writing all the licenses text in a big file with Jinja2 conditions. The filename is templated as well.

from cookiecutter-hypermodern-python.

yajo avatar yajo commented on August 29, 2024

Yes, see https://github.com/Tecnativa/doodba-copier-template/blob/ab7a378e473ab3b15a5db811f33715024c9f2b44/%7B%25%20if%20project_license%20%25%7DLICENSE%7B%25%20endif%20%25%7D.jinja and the related stuff.

from cookiecutter-hypermodern-python.

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.