-
-
Notifications
You must be signed in to change notification settings - Fork 462
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: change poetry to rye for scripts
- Loading branch information
1 parent
109640c
commit c58d44b
Showing
5 changed files
with
17 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,15 +20,15 @@ SimpleLogin backend consists of 2 main components: | |
## Install dependencies | ||
|
||
The project requires: | ||
- Python 3.10 and poetry to manage dependencies | ||
- Python 3.10 and rye to manage dependencies | ||
- Node v10 for front-end. | ||
- Postgres 13+ | ||
|
||
First, install all dependencies by running the following command. | ||
Feel free to use `virtualenv` or similar tools to isolate development environment. | ||
|
||
```bash | ||
poetry sync | ||
rye sync | ||
``` | ||
|
||
On Mac, sometimes you might need to install some other packages via `brew`: | ||
|
@@ -55,7 +55,7 @@ brew install -s re2 pybind11 | |
We use pre-commit to run all our linting and static analysis checks. Please run | ||
|
||
```bash | ||
poetry run pre-commit install | ||
rye run pre-commit install | ||
``` | ||
|
||
To install it in your development environment. | ||
|
@@ -160,25 +160,25 @@ Here are the small sum-ups of the directory structures and their roles: | |
The code is formatted using [ruff](https://github.com/astral-sh/ruff), to format the code, simply run | ||
|
||
``` | ||
poetry run ruff format . | ||
rye run ruff format . | ||
``` | ||
|
||
The code is also checked with `flake8`, make sure to run `flake8` before creating the pull request by | ||
|
||
```bash | ||
poetry run flake8 | ||
rye run flake8 | ||
``` | ||
|
||
For HTML templates, we use `djlint`. Before creating a pull request, please run | ||
|
||
```bash | ||
poetry run djlint --check templates | ||
rye run djlint --check templates | ||
``` | ||
|
||
If some files aren't properly formatted, you can format all files with | ||
|
||
```bash | ||
poetry run djlint --reformat . | ||
rye run djlint --reformat . | ||
``` | ||
|
||
## Test sending email | ||
|
@@ -236,18 +236,11 @@ There are several ways to setup Python and manage the project dependencies on Ma | |
# we haven't managed to make python 3.12 work | ||
brew install python3.10 | ||
|
||
# make sure to update the PATH so python, pip point to Python3 | ||
# for us it can be done by adding "export PATH=/opt/homebrew/opt/[email protected]/libexec/bin:$PATH" to .zprofile | ||
# Install rye using the official installation script, found on https://rye.astral.sh/guide/installation/ | ||
|
||
# Although pipx is the recommended way to install poetry, | ||
# install pipx via brew will automatically install python 3.12 | ||
# and poetry will then use python 3.12 | ||
# so we recommend using poetry this way instead | ||
curl -sSL https://install.python-poetry.org | python3 - | ||
|
||
poetry install | ||
# Install the dependencies | ||
rye sync | ||
|
||
# activate the virtualenv and you should be good to go! | ||
source .venv/bin/activate | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,10 +12,10 @@ docker run -p 25432:5432 --name ${container_name} -e POSTGRES_PASSWORD=postgres | |
sleep 3 | ||
|
||
# upgrade the DB to the latest stage and | ||
env DB_URI=postgresql://postgres:[email protected]:25432/sl poetry run alembic upgrade head | ||
env DB_URI=postgresql://postgres:[email protected]:25432/sl rye run alembic upgrade head | ||
|
||
# generate the migration script. | ||
env DB_URI=postgresql://postgres:[email protected]:25432/sl poetry run alembic revision --autogenerate $@ | ||
env DB_URI=postgresql://postgres:[email protected]:25432/sl rye run alembic revision --autogenerate $@ | ||
|
||
# remove the db | ||
docker rm -f ${container_name} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters