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

Feat/add scripts #317

Merged
merged 2 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ $ hatch env create test
$ hatch env create docs
```

!!! Tip
This is the recommended way but if you still feel you want your own virtual environment and
all the packages installed there, you can always run `scripts/install`.

### Enable pre-commit

The project comes with a pre-commit hook configuration. To enable it, just run inside the clone:
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ dev = [
"uvicorn[standard]>=0.24.0",
]


templates = ["mako>=1.2.4,<2.0.0"]
jwt = ["passlib==1.7.4", "python-jose>=3.3.0,<4"]
encoders = ["ujson>=5.7.0,<6"]
Expand Down
20 changes: 20 additions & 0 deletions scripts/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh -e

# Use the Python executable provided from the `-p` option, or a default.
[ "$1" = "-p" ] && PYTHON=$2 || PYTHON="python3"

VENV="venv"

set -x

if [ "$VIRTUAL_ENV" != '' ]; then
PIP="$VIRTUAL_ENV/bin/pip"
elif [ -z "$GITHUB_ACTIONS" ]; then
"$PYTHON" -m venv "$VENV"
PIP="$VENV/bin/pip"
else
PIP="pip"
fi

"$PIP" install -U pip
"$PIP" install -e .[dev,test,doc,templates,jwt,encoders,schedulers,ipython,ptpython]