Skip to content

Commit

Permalink
Move from poetry to uv
Browse files Browse the repository at this point in the history
  • Loading branch information
gi0baro committed Oct 9, 2024
1 parent a0f0580 commit e2f2b22
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 74 deletions.
45 changes: 19 additions & 26 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ jobs:
Linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, '3.10', '3.11', '3.12']
python-version: [3.8, 3.9, '3.10', '3.11', '3.12', '3.13']

services:
postgres:
Expand All @@ -30,66 +31,58 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install and configure Poetry
uses: gi0baro/setup-poetry-bin@v1
with:
virtualenvs-in-project: true
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Install dependencies
run: |
poetry install -v
uv sync --dev
- name: Test
env:
POSTGRES_URI: postgres:postgres@localhost:5432/test
run: |
poetry run pytest -v tests
uv run pytest -v tests
MacOS:
runs-on: macos-13
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, '3.10', '3.11', '3.12']
python-version: [3.8, 3.9, '3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install and configure Poetry
uses: gi0baro/setup-poetry-bin@v1
with:
virtualenvs-in-project: true
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Install dependencies
run: |
poetry install -v
uv sync --dev
- name: Test
run: |
poetry run pytest -v tests
uv run pytest -v tests
Windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, '3.10', '3.11', '3.12']
python-version: [3.8, 3.9, '3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install and configure Poetry
uses: gi0baro/setup-poetry-bin@v1
with:
virtualenvs-in-project: true
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Install dependencies
shell: bash
run: |
poetry install -v
uv sync --dev
- name: Test
shell: bash
run: |
poetry run pytest -v tests
uv run pytest -v tests
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ build/*
dist/*
Emmett.egg-info/*
poetry.lock
uv.lock

examples/*/databases
examples/*/logs
Expand Down
101 changes: 53 additions & 48 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
[project]
name = "emmett"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.poetry]
[project]
name = "emmett"
version = "2.5.13"
description = "The web framework for inventors"
authors = ["Giovanni Barillari <[email protected]>"]
readme = "README.md"
license = "BSD-3-Clause"
requires-python = ">=3.8"

readme = "README.md"
homepage = "https://emmett.sh"
repository = "https://github.com/emmett-framework/emmett"
documentation = "https://emmett.sh/docs"
authors = [
{ name = "Giovanni Barillari", email = "[email protected]" }
]

keywords = ["web", "asyncio"]
classifiers = [
Expand All @@ -27,54 +28,58 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
"Topic :: Software Development :: Libraries :: Python Modules"
]

packages = [
{include = "emmett/**/*.*", format = "sdist" },
{include = "tests", format = "sdist"}
]
include = [
"CHANGES.md",
"LICENSE",
"docs/**/*"
dependencies = [
"click>=6.0",
"emmett-core[granian,rapidjson]",
"pendulum~=3.0.0",
"pydal",
"pyyaml~=6.0",
"renoir~=1.6",
"severus~=1.1",
]

[tool.poetry.scripts]
emmett = "emmett.cli:main"

[tool.poetry.dependencies]
python = "^3.8"

click = ">=6.0"
emmett-core = { git = "https://github.com/emmett-framework/core", rev = "ab79ed4", extras = ["granian", "rapidjson"] }
pendulum = "~3.0.0"
pyDAL = { git = "https://github.com/gi0baro/pydal.git", rev = "emmett" }
pyyaml = "^6.0"
renoir = "^1.6"
severus = "^1.1"

orjson = { version = "~3.10", optional = true }
[project.optional-dependencies]
orjson = ["orjson~=3.10"]
uvicorn = [
"uvicorn~=0.19",
"h11>=0.12",
"websockets~=10.0",
"httptools~=0.6; sys_platform != 'win32'"
]

uvicorn = { version = "^0.19.0", optional = true }
h11 = { version = ">= 0.12.0", optional = true }
websockets = { version = "^10.0", optional = true }
httptools = { version = "~0.6.0", optional = true, markers = "sys_platform != 'win32'" }
[project.urls]
Homepage = 'https://emmett.sh'
Documentation = 'https://emmett.sh/docs'
Funding = 'https://github.com/sponsors/gi0baro'
Source = 'https://github.com/emmett-framework/emmett'
Issues = 'https://github.com/emmett-framework/emmett/issues'

[tool.poetry.dev-dependencies]
ipaddress = "^1.0"
pytest = "^7.1"
pytest-asyncio = "^0.15"
psycopg2-binary = "^2.9.3"
[project.scripts]
emmett = "emmett.cli:main"

[tool.poetry.extras]
orjson = ["orjson"]
uvicorn = ["uvicorn", "h11", "httptools", "websockets"]
[tool.hatch.build.targets.sdist]
include = [
'/README.md',
'/CHANGES.md',
'/LICENSE',
'/docs',
'/emmett',
'/tests',
]

[tool.poetry.urls]
"Issue Tracker" = "https://github.com/emmett-framework/emmett/issues"
[tool.uv]
dev-dependencies = [
"ipaddress>=1.0",
"pytest>=7.1",
"pytest-asyncio>=0.15",
"psycopg2-binary~=2.9; python_version != '3.13'",
]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.uv.sources]
emmett-core = { git = "https://github.com/emmett-framework/core", rev = "ab79ed4" }
pydal = { git = "https://github.com/gi0baro/pydal.git", branch = "emmett" }

0 comments on commit e2f2b22

Please sign in to comment.