Skip to content

Commit

Permalink
Feat/add scripts (#317)
Browse files Browse the repository at this point in the history
* Add install script
* Update docs
  • Loading branch information
tarsil authored May 3, 2024
1 parent c832f59 commit 758cf7b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
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]

0 comments on commit 758cf7b

Please sign in to comment.