Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: switch from poetry to uv #2324

Merged
merged 2 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 2
updates:
# poetry
# uv
- package-ecosystem: "pip"
directory: "/server"
schedule:
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/ci-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,17 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install poetry
- name: Install uv
env:
UV_VERSION: "0.5.20"
run: |
pip install poetry
poetry config virtualenvs.create false
curl -LsSf "https://astral.sh/uv/${UV_VERSION}/install.sh" | sh

- name: Install dependencies
run: make install-dev
run: make install

- name: Install pandas ${{ matrix.pandas-version }}
run: pip install "pandas${{ matrix.pandas-version }}"
run: uv pip install "pandas${{ matrix.pandas-version }}"

- name: Lint
run: make lint
Expand Down
4 changes: 4 additions & 0 deletions server/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Changed

- Switched from `poetry` to `uv` for package management

## [0.48.7] - 2025-01-10

### Fixed
Expand Down
36 changes: 16 additions & 20 deletions server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,52 +10,48 @@ clean:

.PHONY: install
install:
poetry install --no-dev -E all
uv sync --all-extras

.PHONY: install-dev
install-dev:
poetry install -E all
uv sync --all-extras
pre-commit install

.PHONY: install-playground
install-playground:
poetry install -E playground

.PHONY: format
format:
poetry run $(format)
poetry run $(ruff) --fix
uv run $(format)
uv run $(ruff) --fix

.PHONY: lint
lint:
$(ruff)
$(format) --check
mypy
uv run $(ruff)
uv run $(format) --check
uv run mypy

.PHONY: test
test:
python -m pytest -n 8 -m "not serial" --junitxml=test-report.xml --cov=weaverbird --cov-report xml -s
uv run pytest -n 8 -m "not serial" --junitxml=test-report.xml --cov=weaverbird --cov-report xml -s

.PHONY: serial
test-serial:
python -m pytest -m serial
uv run pytest -m serial

.PHONY: all
all: test lint

.PHONY: build
build:
poetry build
uv build

.PHONY: upload
upload:
poetry publish --build
uv publish --build

.PHONY: start_docker_playground
start_docker_playground:
docker-compose down
docker-compose up -d weaverbird mongodb
start-docker-playground:
docker compose down
docker compose up -d weaverbird mongodb

.PHONY: stop_docker_playground
stop_docker_playground:
docker-compose down
stop-docker-playground:
docker compose down
2 changes: 1 addition & 1 deletion server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ See [docs about purpose and usage](../docs/_docs/tech/python-package.md).

## Development

We use [poetry](https://python-poetry.org/) for managing dependencies.
We use [uv](https://docs.astral.sh/uv/) for managing dependencies.

Main commands are available through `make`:

Expand Down
3,685 changes: 0 additions & 3,685 deletions server/poetry.lock

This file was deleted.

128 changes: 52 additions & 76 deletions server/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
[project]
authors = [{ name = "Toucan Toco", email = "[email protected]" }]
license = { text = "BSD-3-Clause" }
requires-python = "<3.13,>=3.11"
name = "weaverbird"
version = "0.48.7"
description = "A visual data pipeline builder with various backends"
authors = ["Toucan Toco <[email protected]>"]
keywords = [
"builder",
"data",
Expand All @@ -17,83 +15,61 @@ keywords = [
"query",
"sql",
]
license = "BSD-3-Clause"
readme = "README.md"

[tool.poetry.dependencies]
python = ">=3.11, <3.13"
pydantic = "^2.4.2"
dependencies = ["pydantic<3.0.0,>=2.4.2", "python-dateutil<3.0.0,>=2.8.2"]

[tool.uv]
package = true

# Dependencies for extras
## Pandas
[project.optional-dependencies]
pandas = [
{ version = "^1.2.5", optional = true, python = "<3.12" },
{ version = "^2", optional = true, python = ">=3.12" },
"numpy<2.0.0,>=1.2.5; python_version < \"3.12\"",
"numpy>=2,<3; python_version >= \"3.12\"",
"pandas<2.0.0,>=1.2.5; python_version < \"3.12\"",
"pandas<3,>=2; python_version >= \"3.12\"",
"geopandas<2",
]
geopandas = { version = "<2", optional = true }
## PyPika
PyPika = { version = "^0.48.9", optional = true }
## Playground
quart = { version = ">=0.17,<0.21", optional = true }
Quart-CORS = { version = ">=0.5,<0.8", optional = true }
hypercorn = { version = ">=0.13,<0.18", optional = true }
pymongo = { version = ">=4.2.0", optional = true, extras = ["srv", "tls"] }
psycopg = { optional = true, version = "^3.0.15" }
toucan-connectors = { version = "^6.3.0", optional = true, extras = [
"awsathena",
"google_big_query",
"mongo",
"mysql",
"Redshift",
"snowflake",
] }
python-dateutil = "^2.8.2"

[tool.poetry.group.dev.dependencies]
pytest-cov = ">=4.1,<7.0"
pytest-mock = "^3.11.1"
pytest-asyncio = ">=0.21,<0.26"
# required so we can use nosql_apply_parameters_to_query during tests
toucan-connectors = { version = "^6.3.0", extras = [
"awsathena",
"google_big_query",
"mongo",
"mysql",
"Redshift",
"snowflake",
] }
pytest-benchmark = ">=4,<6"
snowflake-sqlalchemy = "^1.6.1"
types-python-dateutil = "^2.8.19"
pytest = ">=7.4.1,<9.0.0"
pytest-xdist = ">=2.5,<4.0"
mypy = ">=0.990,<2"
docker = ">=6.1.3,<8.0.0"
sqlalchemy = "^2"
pymysql = "^1.1.0"
psycopg2 = "^2.9.7"
pymongo = ">=4.2.0"
PyYAML = "^6.0"
redshift-connector = "^2.1.3"
ruff = ">=0.5.0,<0.10"
pre-commit = ">=3.4,<5.0"
tenacity = ">=8.4.2,<10.0.0"

[tool.poetry.extras]
# Lib
pandas = ["pandas", "geopandas"]
pypika = ["pypika"]
all = ["pandas", "geopandas", "pypika"]
# playground
playground = [
"hypercorn",
"pandas",
"psycopg",
"pymongo",
"quart",
"Quart-CORS",
"toucan-connectors",
"quart<0.21,>=0.17",
"Quart-CORS<0.8,>=0.5",
"hypercorn<0.18,>=0.13",
"pymongo>=4.2.0",
"psycopg<4.0.0,>=3.0.15",
"toucan-connectors[Redshift,awsathena,google_big_query,mongo,mysql,snowflake]<7.0.0,>=6.3.0",
]
pypika = ["pypika>=0.48.9"]
all = [
"pandas<2.0.0,>=1.2.5; python_version < \"3.12\"",
"pandas<3,>=2; python_version >= \"3.12\"",
"geopandas<2",
"pypika>=0.48.9",
]

[dependency-groups]
dev = [
"pytest-cov<7.0,>=4.1",
"pytest-mock<4.0.0,>=3.11.1",
"pytest-asyncio<0.26,>=0.21",
"toucan-connectors[Redshift,awsathena,google_big_query,mongo,mysql,snowflake]<7.0.0,>=6.3.0",
"pytest-benchmark<6,>=4",
"snowflake-sqlalchemy<2.0.0,>=1.6.1",
"types-python-dateutil<3.0.0,>=2.8.19",
"pytest<9.0.0,>=7.4.1",
"pytest-xdist<4.0,>=2.5",
"mypy<2,>=0.990",
"docker<8.0.0,>=6.1.3",
"sqlalchemy<3,>=2",
"pymysql<2.0.0,>=1.1.0",
"psycopg2<3.0.0,>=2.9.7",
"pymongo>=4.2.0",
"PyYAML<7.0,>=6.0",
"redshift-connector<3.0.0,>=2.1.3",
"ruff<0.10,>=0.5.0",
"pre-commit<5.0,>=3.4",
"tenacity<10.0.0,>=8.4.2",
]


[tool.mypy]
files = "src/"
Expand Down
Loading
Loading