Tutorial¶
This page contains a complete tutorial on how to create your project.
Step 1: Install copier¶
To start, we will need to install copier.
We recommend doing so with uv. If you don't have uv, installation instructions can be found
here. For MacOS or Linux;
curl -LsSf https://astral.sh/uv/install.sh | sh
Then you can use uv to install copier:
uv tool install copier
Alternatively, once you have uv installed, you can use uvx to use copier without actually installing it:
uvx copier copy ...
Step 2: Generate your project¶
On your local machine, navigate to the directory in which you want to create your project, and run the following command:
copier copy --trust https://github.com/switchbox-data/data-science-project.git <project-name>
For an explanation of the prompt arguments, see Prompt Arguments.
Follow the prompts to configure your project. Once completed, a new directory containing your project will be created. A git repo will automatically be created, and the generated files will be committed.
Step 3: Set up your Github repository¶
Create an empty new repository on Github. Give
it a name that matches <project-name> above. The name should contain alphanumeric characters and optionally -.
DO NOT check any boxes under the option Initialize this repository
with.
Step 4: Upload your project to Github¶
Run the following commands, replacing <project-name> with the name
that you also gave the Github repository and <github_author_handle> with the Github username or organization where you made your repo.
cd <project_name>
git remote add origin git@github.com:<github_author_handle>/<project_name>.git
git push -u origin main
Step 5: Set Up Your Development Environment¶
Initially, the CI/CD pipeline will fail for two reasons:
- The project does not yet contain a
uv.lockfile - There are a few formatting issues in the project
To fix that, we first install the environment and the pre-commit hooks with:
just install
This will generate the uv.lock file
Step 6: Run the pre-commit hooks¶
Now, to resolve the formatting issues, let's run the pre-commit hooks:
uv run pre-commit run -a
7. Commit the changes¶
Now we commit the changes made by the two steps above to the repository:
git add .
git commit -m 'Fix formatting issues'
git push origin main