The goal of this repository is to be a central location for templating University of Chicago Data Clinic projects. When updating this repository the following principals should be followed:
- Low overhead on developers: This cookiecutter is meant to create templates that can be used to quickly spin up new project repositories. Adding additional steps post creation or an endless series of prompts will reduce its usefullness.
- Up to date with best practices: The tools used here should adhere as closely as possible to modern and popular methods
- Justify decisions: Decisions should be justified so future collaborators can make informed decisions as conditions change
-
Install cookiecutter.
pip install cookiecutter
-
Select this template to create a repository in the current directory.
cookiecutter https://github.com/uchicago-dsi/clinic-template
-
Follow the prompts in your terminal.
-
Turn the directory into a git repository
git init git add . git commit -m "Initial Commit"
-
We will follow the steps here to create repo on github and then push this repository.
- Step #1 is to crete an empty repo
- Step #2 is to set the remote branch and then push. Note that the code below requires replacing the GH_ORG and the REPO_NAME.
git remote add origin [email protected]:{{GH_ORG}}/{{REPO_NAME}}.git git branch -M main git push -u origin main
- Did you add branch protections?
- Set up additional users and permissions.
The file ``DataPolicy.md" contains the default data and code sharing policies for the project.
To check for style, we use ruff
. This run using pre-commit
. pre-commit is a tool for managing git hook scripts that we can use to run code checkers before git actions (like run ruff
before every commit). If it fails, the commit will be blocked and the user will be shown what needs to be changed. We configure our linters with pyproject.toml
To run checkers on pull requests to main
and dev
, we use the .github/workflows/main.workflow.yml
file.
The root directory of this repository contains files related to the cookiecutter itself. All generated repositories will have {{ cookiecutter.project_slug }}
as its root directory. To make additions that are dependent on user prompts, add the variable to the cookiecutter.json
file and reference the variable withing the {{ cookiecutter.project_slug }}
directory using Jinja templating.
For more information on cookiecutter, visit its git repository