Skip to content

Commit

Permalink
chore: move packaging to uv
Browse files Browse the repository at this point in the history
  • Loading branch information
SaboniAmine committed Oct 27, 2024
1 parent 5c15688 commit 602e203
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 66 deletions.
30 changes: 11 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ well as policy-makers and economic stakeholders.

Bloom is tested with:

| | Main version (dev) | Stable version (1.0.0) |
|------------|----------------------|------------------------|
| Python | 3.8, 3.9, 3.10, 3.11 | 3.8, 3.9, 3.10, 3.11 |
| Platform | AMD64/ARM64(\*) | AMD64/ARM64(\*) |
| Docker | 24 | 24 |
| PostgreSQL | 14 | 14 |
| | Main version (dev) | Stable version (1.0.0) |
|------------|--------------------|------------------------|
| Python | 3.11 | 3.11 |
| Platform | AMD64/ARM64(\*) | AMD64/ARM64(\*) |
| Docker | 24 | 24 |
| PostgreSQL | 14 | 14 |

## Getting started

Expand Down Expand Up @@ -118,7 +118,7 @@ You can now jump to [Use the Bloom Application](#use-the-bloom-application)

#### Prerequistes

* **Python**: 3.9, 3.10, 3.11
* **Python**: 3.11
* **Python-pip**: >=20
* **Postgresql**: 14, 15, 16

Expand All @@ -130,18 +130,10 @@ password, database name, port to use)
```bash
# From project diretory
cd ./backend
# Install poetry
pip install --user "poetry==1.8.1"
# Mise à disposition de l'exécutable de manière temporaire
export PATH=$PATH:~/.local/bin/
# Ensure that poetry will create a `.venv` directory into the project with the command
poetry config virtualenvs.in-project true
# Install dependencies from pyproject.toml
poetry install
# Make sure everything is all right using
poetry env info
# Enable virtual poetry project environment
poetry shell
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install project and dependencies
uv sync
```

#### Initial configuration
Expand Down
8 changes: 0 additions & 8 deletions backend/bloom/main.py → backend/bloom/app.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
from fastapi import FastAPI, APIRouter, Depends, HTTPException
from fastapi import Request
from fastapi.security import APIKeyHeader

from bloom.routers.v1.cache import router as router_cache_v1
from bloom.routers.v1.metrics import router as router_metrics_v1
from bloom.routers.v1.vessels import router as router_vessels_v1
from bloom.routers.v1.ports import router as router_ports_v1
from bloom.routers.v1.zones import router as router_zones_v1
from bloom.dependencies import ( DatetimeRangeRequest,
PaginatedRequest,OrderByRequest,
paginate,PagedResponseSchema,PageParams,
X_API_KEY_HEADER,check_apikey)

import redis
import json
Expand All @@ -21,9 +16,6 @@

rd = redis.Redis(host=settings.redis_host, port=settings.redis_port, db=0)

from datetime import datetime
import time

API_PREFIX_V1='/api/v1'

app = FastAPI()
Expand Down
87 changes: 48 additions & 39 deletions backend/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,49 +1,57 @@
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.poetry]
[tool.hatch.build.targets.wheel]
packages = ["bloom"]


[dependency-groups]
dev = [
"pre-commit~=3.6",
"ruff~=0.7",
"tox~=4.14",
]

[project]
authors = [
{name = "Your Name", email = "[email protected]"},
]
requires-python = "~=3.11"
dependencies = [
"alembic~=1.13",
"autopep8~=2.0",
"dependency-injector~=4.41",
"dependency-injection~=1.2",
"GeoAlchemy2~=0.14",
"geopandas~=0.14",
"geopy~=2.4",
"gql~=3.5",
"matplotlib~=3.8",
"openpyxl~=3.1",
"pandas~=2.2",
"poetry~=1.8",
"psycopg2-binary~=2.9",
"pydantic~=2.6",
"pydantic-settings~=2.2",
"python-dotenv~=1.0",
"PyYAML~=6.0",
"requests~=2.31",
"requests-toolbelt~=1.0",
"shapely~=2.0",
"scipy==1.12.0",
"slack-sdk~=3.27",
"SQLAlchemy~=2.0",
"pycountry==23.12.11",
"fastapi[standard]>=0.111.0,<1.0.0",
"uvicorn<1.0.0,>=0.30.1",
"redis<6.0.0,>=5.0.4",
]
name = "bloom"
version = "0.1.0"
description = "Bloom scrapping application"
authors = ["Your Name <[email protected]>"]

[tool.poetry.dependencies]
alembic = "~1.13"
autopep8 = "~2.0"
dependency-injector = "~4.41"
dependency_injection = "~1.2"
GeoAlchemy2 = "~0.14"
geopandas = "~0.14"
geopy = "~2.4"
gql = "~3.5"
matplotlib = "~3.8"
openpyxl = "~3.1"
pandas = "~2.2"
poetry = "~1.8"
psycopg2-binary = "~2.9"
pydantic = "~2.6"
pydantic-settings = "~2.2"
python = ">=3.9,<3.9.7 || >3.9.7,<4.0"
python-dotenv = "~1.0"
PyYAML = "~6.0"
requests = "~2.31"
requests-toolbelt = "~1.0"
shapely = "~2.0"
scipy = "1.12.0"
slack-sdk = "~3.27"
SQLAlchemy = "~2.0"
pycountry = "23.12.11"
fastapi = "^0.111.0"
uvicorn = "^0.30.1"
redis = "^5.0.4"


[tool.poetry.group.dev.dependencies]
pre-commit = "~3.6"
ruff = "~0.3"
tox = "~4.14"

[tool.ruff]
select = [
"A",
Expand Down Expand Up @@ -148,3 +156,4 @@ target-version = "py310"

[tool.ruff.mccabe]
max-complexity = 10

3 changes: 3 additions & 0 deletions clevercloud/clever.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
"*/15 * * * * /home/bas/venv/bin/python /home/bas/app_7244f095-70bc-43c3-9950-d075c01af05f/backend/load_spire_data_from_api.py"
]

0 comments on commit 602e203

Please sign in to comment.