Skip to content
Open
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
5ea3e22
Show mit fields in v1 (partial imple)
VadimKovalenkoSNF Jan 9, 2026
7b70958
Merge branch 'main' into OSDEV-2329-mit-living-wage-production-locations
VadimKovalenkoSNF Jan 12, 2026
58c4f63
Minor refactoring
VadimKovalenkoSNF Jan 12, 2026
d4d4f88
Refactor __get_partner_fields method
VadimKovalenkoSNF Jan 12, 2026
34eccae
Merge branch 'main' into OSDEV-2329-mit-living-wage-production-locations
VadimKovalenkoSNF Jan 13, 2026
4fc446f
Fix unit tests
VadimKovalenkoSNF Jan 13, 2026
e3173b7
Minor fix
VadimKovalenkoSNF Jan 13, 2026
026614a
Apply rich living wage output
VadimKovalenkoSNF Jan 13, 2026
c57aea1
Merge branch 'main' into OSDEV-2329-mit-living-wage-production-locations
VadimKovalenkoSNF Jan 13, 2026
d78d659
Merge branch 'main' into OSDEV-2329-mit-living-wage-production-locations
VadimKovalenkoSNF Jan 15, 2026
7f19bf6
Add release notes
VadimKovalenkoSNF Jan 15, 2026
40819ff
Merge branch 'main' into OSDEV-2329-mit-living-wage-production-locations
VadimKovalenkoSNF Jan 16, 2026
3b58dd5
Merge branch 'main' into OSDEV-2329-mit-living-wage-production-locations
VadimKovalenkoSNF Jan 16, 2026
e8d9181
Install pre-commit and other linters
VadimKovalenkoSNF Jan 19, 2026
11686a3
Upd RELEASE notes
VadimKovalenkoSNF Jan 19, 2026
4859340
Add settings.json example to the README.md
VadimKovalenkoSNF Jan 19, 2026
41d9b3c
Add .vscode/example-settings.json
VadimKovalenkoSNF Jan 19, 2026
6dcf345
Merge branch 'main' into pre-commit-package-for-django-app
VadimKovalenkoSNF Jan 20, 2026
3ca8000
Merge branch 'main' into pre-commit-package-for-django-app
VadimKovalenkoSNF Jan 26, 2026
8fef042
Add pre-requisites to Readme file
VadimKovalenkoSNF Jan 26, 2026
9f2f068
More instructinos in Readme file
VadimKovalenkoSNF Jan 26, 2026
5b993fc
Update: [email protected], [email protected] and [email protected]
VadimKovalenkoSNF Jan 31, 2026
a8d826e
Merge branch 'main' into pre-commit-package-for-django-app
VadimKovalenkoSNF Jan 31, 2026
382007f
Update table of contents
VadimKovalenkoSNF Jan 31, 2026
a27fab7
Merge branch 'main' into pre-commit-package-for-django-app
VadimKovalenkoSNF Feb 5, 2026
a55d0a4
Merge branch 'main' into pre-commit-package-for-django-app
VadimKovalenkoSNF Feb 11, 2026
e0df7fb
Update README anchors to fix TOC fragments
VadimKovalenkoSNF Feb 11, 2026
4ba491a
Updated the README to reference the correct example settings file
VadimKovalenkoSNF Feb 11, 2026
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ src/django/*.xlsx


# VSCode
.vscode
.vscode/*
!.vscode/example-settings.json

# PyCharm
.idea/
Expand Down
85 changes: 85 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
repos:
- repo: local
hooks:
- id: ruff-docker
name: ruff (django via docker)
language: system
entry: docker
args:
- compose
- run
- --rm
- --no-deps
- -v
- .:/workspace
- -w
- /workspace
- --entrypoint
- ruff
- django
- check
- --fix
- --exit-non-zero-on-fix
- --config
- /workspace/pyproject.toml
files: ^src/django/.*\.py$

- id: isort-docker
name: isort (django via docker)
language: system
entry: docker
args:
- compose
- run
- --rm
- --no-deps
- -v
- .:/workspace
- -w
- /workspace
- --entrypoint
- isort
- django
- --settings-path
- /workspace/pyproject.toml
files: ^src/django/.*\.py$

- id: black-docker
name: black (django via docker)
language: system
entry: docker
args:
- compose
- run
- --rm
- --no-deps
- -v
- .:/workspace
- -w
- /workspace
- --entrypoint
- black
- django
- --config
- /workspace/pyproject.toml
files: ^src/django/.*\.py$

- id: flake8-docker
name: flake8 (django via docker)
language: system
entry: docker
args:
- compose
- run
- --rm
- --no-deps
- -v
- .:/workspace
- -w
- /workspace
- --entrypoint
- flake8
- django
- --config
- /workspace/src/django/.flake8
files: ^src/django/.*\.py$
27 changes: 27 additions & 0 deletions .vscode/example-settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
"ruff.enable": true,
"ruff.importStrategy": "fromEnvironment",
"ruff.path": [
"${workspaceFolder}/.venv/bin/ruff"
],
"black-formatter.path": [
"${workspaceFolder}/.venv/bin/black"
],
"python.formatting.blackPath": "${workspaceFolder}/.venv/bin/black",
"[python]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.codeActionsOnSave": {
"source.fixAll": "always",
"source.fixAll.ruff": "always"
}
},
"python.formatting.provider": "black",
"python.formatting.blackArgs": [
"--line-length=88",
"--config",
"pyproject.toml"
],
"python.linting.ruffEnabled": true
}
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,19 @@ Open Supply Hub (OS Hub) is a tool to identify every goods production facility w
- [Kick-off & start local development](#kick-off--start-local-development)
- [Restore the DB dump in the local Docker DB container](#restore-the-db-dump-in-the-local-docker-db-container)
- [US County Tigerline Data Setup](#us-county-tigerline-data-setup)
- [Local Development](#local-development)
- [Running ECS Management Commands](#running-ecs-management-commands)
- [Creation of Superusers](#creation-of-superusers)
- [Upload a list and process it](#upload-a-list-and-process-it)
- [Hot Reloading 🔥](#hot-reloading-🔥)
- [Debugging Django](#debugging-django)
- [Embedded Maps](#embedded-maps)
- [Ports](#ports)
- [Linting & git hooks for Django app](#linting--git-hooks-for-django-app)
- [Scripts 🧰](#scripts-🧰)
- [Tools ⚒️](#tools-⚒️)
- [Running e2e (Playwright) and integration tests](#running-e2e-playwright-and-integration-tests)
- [Playwright Tests](#playwright-tests)


## Requirements
Expand Down Expand Up @@ -244,6 +248,24 @@ be available on their page, or you can visit http://localhost:6543/?embed=1&cont
| React development server | [`6543`](http://localhost:6543) |
| Gunicorn for Django app | [`8081`](http://localhost:8081) |

### Linting & git hooks for Django app

- **Local virtual environment (`.venv`) setup**: The `.venv` virtual environment is **not created automatically** and must be set up manually for local editor tooling (Black, Ruff) and pre-commit. Note that `./scripts/start_local_dev` uses Docker and does not create `.venv`—create it separately for editor integration. To set up:
1. Create the virtual environment: `python3 -m venv .venv` (or `python -m venv .venv` on some systems)
2. Activate it:
- macOS/Linux: `source .venv/bin/activate`
- Windows: `.venv\Scripts\activate`
3. Install tools: `pip install pre-commit black ruff` (Note: `black` and `ruff` are already in `src/django/requirements.txt`; for minimal editor tooling, install them separately as shown, or install from `src/django/requirements.txt` if you need other Django dependencies in your `.venv`)
4. Enable pre-commit git hooks: `pre-commit install`
- **Pre-commit setup**: Pre-commit orchestrates the hooks locally, but the hooks themselves execute inside the django Docker container to match CI. **Prerequisite**: Build the Docker image first (e.g., `docker compose build` or `./scripts/update`) so hooks can run successfully. To run hooks manually: `pre-commit run --all-files` (runs ruff --fix, isort, black, then flake8 inside the django container).
- **Local first wall**: Enable on-save formatting/fixes in your editor (Black + Ruff) using the repo `.venv`. Configure your editor to use `.venv`'s Python interpreter and formatter binaries (not Docker).
- Recommended VS Code/Cursor setup for on-save:
- Select interpreter: Command Palette → `Python: Select Interpreter` → `.venv/bin/python`.
- Install extensions: “Python” + “Ruff” + “Black Formatter (ms-python)”.
- Enable format on save and Ruff fixes (see `.vscode/settings.json` for reference): Black as default formatter, `source.fixAll` + `source.fixAll.ruff` on save, paths to `.venv/bin/black` and `.venv/bin/ruff` (not Docker binaries).
- Example settings file: `.vscode/example-settings.json`. Copy to `.vscode/settings.json` to apply.

- Config lives in `.pre-commit-config.yaml` with settings in `pyproject.toml` and `src/django/.flake8` (excludes migrations, settings.py, manage.py).

## Scripts 🧰

Expand Down
20 changes: 20 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[tool.black]
line-length = 88
target-version = ["py38"]
extend-exclude = "api/migrations/|settings\\.py|manage\\.py"

[tool.isort]
profile = "black"
line_length = 88
src_paths = ["src/django"]
skip = ["api/migrations"]

[tool.ruff]
target-version = "py38"
line-length = 88
src = ["src/django"]
extend-exclude = ["settings.py", "manage.py", "api/migrations/*"]

[tool.ruff.lint]
extend-ignore = ["E203"]

7 changes: 7 additions & 0 deletions src/django/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[flake8]
# Keep local linting aligned with the CI invocation from scripts/run_be_code_quality
# and .github/workflows/code_quality.yml.
exclude = settings.py, manage.py, *.pyc, api/migrations/*
max-line-length = 88
extend-ignore = E203, W503

3 changes: 3 additions & 0 deletions src/django/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ django-ckeditor-5==0.2.19
djangorestframework-gis==1.1.0
djangorestframework==3.15.2
flake8==7.1.0
black==26.1.0
isort==7.0.0
ruff==0.14.14
mccabe==0.7.0
mercantile==1.2.1
openpyxl==3.1.5
Expand Down
Loading