Giter VIP home page Giter VIP logo

Comments (4)

ionelmc avatar ionelmc commented on August 11, 2024

Now sure what you're asking of me here. The packaging provided by this template should work in any environment than works with source or wheel distributions, and that includes virtualenvs.

Clarify what this means:

During set up, this template installs Python packages through pip to the Python user install directory

What "set up"?

from cookiecutter-pylibrary.

tomaz-suller avatar tomaz-suller commented on August 11, 2024

What I meant to suggest was adding the option to set up a virtual environment after executing cookiecutter .... Something like

1 - no
2 - yes
Install dependencies inside venv? [1]: 

By selecting option 1, everything would happen as right now. By selecting option 2 though a virtual environment would be created inside the rendered template, and it would then be sourced so tox and other template dependencies were installed in the venv.

I thought this would be a good feature since I wasn't expecting installing a library to my user as a side effect of cloning a cookiecutter template, and because some users prefer installing packages using pip only on virtual environments.

from cookiecutter-pylibrary.

tomaz-suller avatar tomaz-suller commented on August 11, 2024

Adding this would involve adding the option to the cookiecutter menu and then modifying this part of the post-gen hook

try:
subprocess.check_call(['tox', '-e', 'bootstrap', '--sitepackages'])
except Exception:
try:
subprocess.check_call([sys.executable, '-mtox', '-e', 'bootstrap', '--sitepackages'])
except Exception:
subprocess.check_call([sys.executable, ci / 'bootstrap.py'])

if this is a use case this template wants to support of course.

Implementing it should be straightforward, except perhaps for supporting the different shells and their different ways of activating the venv.

from cookiecutter-pylibrary.

ionelmc avatar ionelmc commented on August 11, 2024

I don't think this is a widely accepted workflow. I am using pipx to install tooling (including tox) ... and all this seems very crummy and will create support work for me, something I want to avoid especially when it's not my daily workflow.

from cookiecutter-pylibrary.

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.