Skip to content

Commit 8735f8d

Browse files
committed
docs: update instructions for uv
1 parent dfa1e3d commit 8735f8d

File tree

1 file changed

+13
-24
lines changed

1 file changed

+13
-24
lines changed

README.md

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,11 @@ cd homebrewhub
3838

3939
Now, no matter if you choose the local setup or the docker one, you will need a couple of pre-requirements on the system:
4040

41-
- `pre-commit` <br>
42-
E.g. Install it from pip:
43-
```bash
44-
python3 -m venv env
45-
source env/bin/activate
46-
pip install pre-commit
47-
```
48-
After it's installed, run `pre-commit install` in the project root folder to see if everything gets initialised correctly. `pre-commit run --all-files` will run it against the whole repository.
49-
- (Optional) The `gbtoolsid` ([Game Boy Toolchain ID](https://github.com/bbbbbr/gbtoolsid)) executable must be available in the project root to populate toolchain details for the imported entries. Get a build on the [Releases](https://github.com/bbbbbr/gbtoolsid/releases/latest) page and extract the zip or run `make prepare-gbtid` from the root of the repository.
50-
51-
### 2. Pull the games database(s)
41+
1. `pre-commit` <br>
42+
E.g. Install it with pip: `pip install pre-commit`. Once installed, run `pre-commit install` in the project root folder to see if everything gets initialised correctly. `pre-commit run --all-files` will run it against the whole repository.
43+
2. (Optional) The `gbtoolsid` ([Game Boy Toolchain ID](https://github.com/bbbbbr/gbtoolsid)) executable must be available in the project root to populate toolchain details for the imported GB/GBC entries. There's a provided script to do so you can run with `make prepare-gbtid` or you can get a build on the [Releases](https://github.com/bbbbbr/gbtoolsid/releases/latest) page of the project and extract the zip.
44+
45+
### 2. Pull the entry databases
5246

5347
To populate the database, we'll need some sources. Here's how to pull all the 'official' databases (you need at least one):
5448

@@ -84,12 +78,13 @@ curl http://localhost:8081/api/all
8478

8579
### 3B. Manual requirements
8680

87-
You need Python 3 and a couple of packages to build `psycopg2` (database driver).
81+
You need Python 3, a couple of packages to build `psycopg2` (database driver) and `uv` to handle Python dependencies.
8882

8983
On Linux, this command should install all requirements:
9084

9185
```bash
9286
apt install python3 libpq-dev python3-dev python3-venv
87+
pip install uv
9388
```
9489

9590
Next, install Postgres 12 ([download link](https://www.postgresql.org/download/)), create a user, password and a database named `hh`. Have it running in the background on port `5432`.
@@ -100,23 +95,17 @@ After that, follow the steps below to get started running the project manually:
10095
# Make sure you are in the cloned repository
10196
cd homebrewhub
10297

103-
# Set up a virtual env
104-
python3 -m venv env
98+
# Set up a virtual env, install deps (including dev)
99+
uv sync
105100

106101
# Activate it
107-
source env/bin/activate
108-
109-
# Install Python dependencies
110-
pip install -r requirements.txt
111-
112-
# Install Pre-Commit git hooks (for enforcing code style on git commit)
113-
pre-commit install
102+
source .venv/bin/activate
114103

115104
# Prepare migrations for our Entry model
116-
python3 manage.py makemigrations hhub
105+
./manage.py makemigrations hhub
117106

118107
# Sync the database for the first time
119-
python3 manage.py migrate
108+
./manage.py migrate
120109

121110
# Populate with the entries from the database repository
122111
DATABASE_URL=postgres://yourpostgresuserhere:yourpostgrespasswordhere@localhost:5432/hh python3 manage.py runscript sync_db
@@ -146,7 +135,7 @@ The "real" database needs to be built (and updated when a commit gets pushed) fr
146135
Every time you want to trigger a database sync (e.g. you pulled some updates on the games database), run:
147136

148137
```bash
149-
python3 manage.py runscript sync_db
138+
./manage.py runscript sync_db
150139
```
151140

152141
### 5. Get the frontend running

0 commit comments

Comments
 (0)