Giter VIP home page Giter VIP logo

Comments (6)

blakeNaccarato avatar blakeNaccarato commented on August 27, 2024

This issue will now track effort on the PowerShell profile implementation. Things like automatic activation of the virtual environment, populating PYTHONSTARTUP with tooling\.pythonrc.py, and more.

from copier-python.

blakeNaccarato avatar blakeNaccarato commented on August 27, 2024

Maybe I can minimally touch the user's profile by asking them to run Set-PsEnv if a .env file exists. This keeps the barrier between profile-specific matters and project-specific matters. Then we can ship a .env in the template that touches the relevant environment variables.

from copier-python.

blakeNaccarato avatar blakeNaccarato commented on August 27, 2024

These two are roughly equivalent:

In the $PROFILE for pwsh:

# If there is an `.env` file in the PWD, load environment variables from it
Set-PsEnv

In .bashrc

#* Import dotenv aka .env environment variables if it is found
if [ -f ./.env ] ; then
    set -o allexport # enable shell option to export all created variables
    source ./.env # now this will export all vars instead of just one
    set +o allexport # disable shell option to export all created variables
fi

from copier-python.

blakeNaccarato avatar blakeNaccarato commented on August 27, 2024

Even though we aren't bundling a PowerShell profile or .bashrc, the manual first-time setup for a user will need to be documented. For security reasons, this cannot be automated, and instead we will tell the user what to do and why its needed.

from copier-python.

blakeNaccarato avatar blakeNaccarato commented on August 27, 2024

PowerShell profile tinkering is automatically done in typer w/ shellingham as a way to check which terminal the user has. So maybe it's reasonable to do this, but have a manual "echo text to terminal for you to copy instead" option as well.

from copier-python.

blakeNaccarato avatar blakeNaccarato commented on August 27, 2024

This is completed in scripts/Initialize-Shell.ps1, which is manually invoked wherever needed to set environment variables and activate the environment.

from copier-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.