Project Set Up¶
Your Guide to Setting Up a Nesta Cookiecutter Project¶
In this page you will learn how to set up a project using the cookiecutter. The steps are different depending on whether you are the first one setting up a project (Project Configurer) or whether a project already exists and you are just setting it up locally (Team Member).
Project Configurer¶
Prerequisite: If this is your first time setting up a cookiecutter project you need to install it from https://pypi.org/project/cookiecutter. You can do this in the terminal with brew install cookiecutter
.
-
Request repository setup: First things first, you need a repo created for you. Submit a Create a repo in the Nesta GitHub org issue from the github_support issue page. You will need to provide a project name, suggested repo name, whether public/private, github teams involved, team leading the project, short and long description of the project. An empty repo will be set up for you and you will receive a notification when this is done.
-
Set up your project locally: It is important that you do not clone the repo yet! Instead, follow these steps:
-
Open the terminal and
cd
to a folder where you eventually want your repo to be - Run
cookiecutter https://github.com/nestauk/ds-cookiecutter
. This will automatically install the latest version. If you want to install a different version runcookiecutter https://github.com/nestauk/ds-cookiecutter -c <VERSION TAG>
-
You will be presented with the following:
You've downloaded ~.cookiecutters/ds-cookiecutter before. Is it okay to delete and re-download it?[yes]
press Enter to confirm yes, it's always best to use the latest version.project_name [Project_name]
: add_a_name_hererepo_name [add_a_name_here]
: add_a_name_hereauthor_name [Nesta]
: add_author or press Enter to confirm Nestadescription [A short description of the project.]
: add short descriptionSelect openness: 1 - public 2 - private Choose from 1, 2 [1]
: regardless of the choice you can always change it in the future
-
cd
to project directory and runmake install
to:- Create a conda environment with a name corresponding to the repo_name prompt and install the project package and its dependencies
- Configure and install Git pre-commit hooks
-
Connect your local project to github: You have set up your project locally and now you have to connect it to the remote repo. When you change directory to your created project folder, you will see that you are in a git repository and the generated cookiecutter has committed itself to the
0_setup_cookiecutter
branch. Connect to the git repo by runninggit remote add origin git@github.com:nestauk/<REPONAME>
to point your local project to the configured repository. -
Merging your new branch: You are on
0_setup_cookiecutter
, whistdev
is empty. They have diverging histories so you won't be able to push any work todev
. For this reason you need to merge0_setup_cookiecutter
todev
by running:
git checkout 0_setup_cookiecutter
git branch dev 0_setup_cookiecutter -f
git checkout dev
git push origin dev -f
- You are all set! You can delete the
0_setup_cookicutter
branch and enjoy coding!
Team Members¶
- Open the terminal and
cd
into a folder where you want the project set up. - Clone the repository by running
git clone <REPONAME>
andcd
into the repository. - Run
make install
to configure the development environment.