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

Add Makefile to auto setup repo for developers #699

Merged
merged 15 commits into from
Oct 26, 2022
8 changes: 8 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ First off, thanks for your input! We love to hear feedback from the community an
## We Develop with Github
We use github to host code, to track issues and feature requests, as well as accept pull requests.

## Quick Setup
To set up the development environment, run the following commands in the root of the repo:
```cli
make setup
source ./venv/bin/activate
```
This Makefile creates a Python virtual environment and installs all of the developer dependencies. Alternatively, follow the steps below.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be good to also include the other makefile components in readme

## Dependencies
To install the dependencies for developing and updating the code base, be sure to run `pip install -r requirements-dev.txt`

Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
setup: requirements.txt requirements-dev.txt requirements-test.txt
python3 -m venv venv

. venv/bin/activate; \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should these end with && instead of ;?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

&& returns a syntax error: unexpected end of file

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is bc the last line has \ and shouldn't end in && or ;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tonywu315 I would test locally this rec from @JGSweets ... I tested it one way but didn't work on my end

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works for me if I remove the \ on the last line.

pip install -r requirements.txt; \
pip install -r requirements-dev.txt; \
pip install -r requirements-test.txt; \
pip install -e .; \
pre-commit install; \
pre-commit run; \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we make a section for make test and make formatting?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could. I see this as just an initial implementation that improves the user experience -- one command to set their environment up, but I'll defer to @tonywu315 as the author of the PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

last line shouldn't have a \