You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Run `source venv/bin/activate && pip install --upgrade pip` to activate the created Python Virtual Environment and
40
-
upgrade
41
-
pip.
42
-
- Run `pip install pipenv` to install [Pipenv](https://pipenv.pypa.io/en/latest/).
37
+
- Install [uv](https://docs.astral.sh/uv/getting-started/installation/) for Python package management
38
+
- Create a virtual environment using `uv venv` and activate it using `source .venv/bin/activate`
39
+
- Run `uv sync --dev` to install all dependencies and create a virtual environment
40
+
- Add the virtual environment to PyCharm by navigating to
41
+
`PyCharm -> Settings... -> Project: clowder2 -> Python Interpreter -> Add Interpreter` and selecting type `uv` and then selecting the virtual environment.
42
+
43
+
For detailed PyCharm configuration instructions, see the [official PyCharm uv documentation](https://www.jetbrains.com/help/pycharm/uv.html).
43
44
44
45
### Required Services
45
46
@@ -61,39 +62,38 @@ After starting up the required services, setup and run the backend module.
61
62
62
63
The backend module is developed using [Python](https://www.python.org/), [FastAPI](https://fastapi.tiangolo.com/),
63
64
and [Motor](https://motor.readthedocs.io/en/stable/).
64
-
We recommend using [Python 3.9](https://www.python.org/downloads/)
65
-
and Pipenv for dependency management.
65
+
We recommend using [Python 3.9+](https://www.python.org/downloads/)
66
+
and uv for dependency management.
66
67
67
68
#### Install Backend Dependencies
68
69
69
-
1. Switch to backend module directory `cd backend`.
70
-
2. Install dependencies using `pipenv install --dev`.
70
+
1. Install dependencies using `uv sync --dev` from the project root directory.
71
71
72
72
#### Run Backend Module
73
73
74
74
You can run the backend module using either of the below options:
75
75
76
76
- Using the PyCharm's run configuration by navigating to `PyCharm -> Run -> Run...` and clicking `uvicorn`. Running
77
77
directly from PyCharm helps the developer by providing easy access to its debugging features.
78
-
- From the command line by running `pipenv run uvicorn app.main:app --host 0.0.0.0 --reload`.
78
+
- From the command line by running `uv run uvicorn app.main:app --host 0.0.0.0 --reload`.
79
79
- To run the backend module with multiple workers, similar to production, run
80
-
`pipenv run uvicorn app.main:app --host 0.0.0.0 --workers 17`
80
+
`uv run uvicorn app.main:app --host 0.0.0.0 --workers 17`
81
81
82
82
Additional steps/details:
83
83
84
84
1. API docs are available at `http://localhost:8000/docs`. The API base URL is `http://localhost:8000/api/v2`.
85
85
2. Create a user using `POST /api/v2/users` and getting a JWT token by using `POST /api/v2/login`. Place the token in
86
86
header of requests that require authentications using the `Authorization: Bearer <your token>` HTTP header.
87
87
* You can also run the frontend module below and use the Login link available there.
88
-
3. Manually run tests before pushing with `pipenv run pytest -v` or right-clicking on `test` folder and clicking `Run`
88
+
3. Manually run tests before pushing with `uv run pytest -v` or right-clicking on `test` folder and clicking `Run`
89
89
in PyCharm.
90
90
4. Linting is done using [Black](https://black.readthedocs.io/en/stable/). You can set up PyCharm to automatically
91
91
run it when you save a file using
92
92
these [instructions](https://black.readthedocs.io/en/stable/integrations/editors.html).
93
93
The git repository includes an action to run Black on push and pull_request.
94
-
5. Before pushing new code, please make sure all files are properly formatted by running the following command in
95
-
the `/backend` directory:
96
-
```pipenv run black app```
94
+
5. Before pushing new code, please make sure all files are properly formatted by running the following command from
0 commit comments