My (former) usual practice was to create a Python virtual environment, then install cookiecutter and use it to create new project directories with this template. Those projects of course will have their own Python, R, etc. requirements that needs to be installed afterwards to use.
Below, I have added an updated approach that simplified by using uv.
- Open a terminal
- Install uv, see
https://docs.astral.sh/uv/getting-started/installation/ - To use this template with cookiecutter simply do
uvx cookiecutter gh:akbaritabar/cookiecutter_projects_template - Answer the questions asked and it will create a project in your terminal's working directory using this template. It will include all the files and ReadMe items which now are populated using your answers to the questions about the project.
- In the terminal, cd to the project folder created above, and to use a specific version of Python
uv init --python 3.13 - To add all packages listed in requirements
uv add -r requirements.txt - Now, to run code using
snakemakeuseuvx(oruv tool run) as inuvx snakemake --version - Or to use VS Code that already inherits the environment created by uv do
code . - Or for Jupyter lab do
uv run --with jupyter jupyter lab - To see requirements and project's dependencies
uv treeand to record all those that are installed so far withrequirements.txtor byuv add packageName(and removed byuv remove packageName)uv sync
- Open a terminal
- Install vanilla Python from: https://www.python.org/
- Create a folder e.g.,
projectTemplatesand useVirtualenvto createenvinside it withpython -m virtualenv env, activate it with.\Scripts\activate.bat(on Windows), and install the requirements, i.e.,python -m pip install -r requirements.txt - Then cd to 'C:\projectTemplates' which is now a vanilla Python environment created for cookiecutter templates using the 'requirements.txt' file in this directory (which simply includes cookiecutter. I also included the data science template, that could be useful but is more elaborated than what I needed).
- To use the GitHub version of my own template, do
cookiecutter 'https://github.com/akbaritabar/cookiecutter_projects_template' - Answer the questions asked and it will create a project in your terminal's working directory using this template. It will include all the files and ReadMe items which now are populated using your answers to the questions about the project.
- Create a virtual environment for Python and install requirements as I wrote above (See my guidelines on using Pyenv) and enjoy!