Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔧 Run task by the same Python environment used to run Copier #1157

Merged
merged 3 commits into from
Sep 27, 2024

Conversation

waketzheng
Copy link
Contributor

My development environment is MacOS with default Python version 2.7, and I got the following error when running copier:

 > Running task 1 of 1: python .copier/update_dotenv.py
  File ".copier/update_dotenv.py", line 16
    if line.startswith(f"{upper_key}="):
                                     ^
SyntaxError: invalid syntax

How to reproduce:

alias python=python2
copier copy https://github.com/tiangolo/full-stack-fastapi-template my-awesome-project --trust

As the copier document says: we can use "{{ _copier_python }}" to run script by the same Python environment used to run Copier.

@tuukka
Copy link

tuukka commented Apr 25, 2024

I needed this on an Ubuntu system that does not have /usr/bin/python at all (need to use python3) - thank you for the fix!

@tiangolo
Copy link
Member

Great, thanks! 🚀 🍰

@tiangolo tiangolo merged commit 945fbc7 into fastapi:master Sep 27, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants