ci: 👷 replace Poetry workflow with UV testing workflow and update dependencies in pyproject.toml

Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
This commit is contained in:
Onuralp SEZER 2025-01-08 23:09:25 +03:00
parent 656f639db5
commit 730bbd246c
No known key found for this signature in database
GPG Key ID: CF0835DFDF14CA38
5 changed files with 5434 additions and 5188 deletions

View File

@ -1,45 +0,0 @@
name: 🔧 Poetry Checks and Test Workflow
on:
push:
paths:
- "poetry.lock"
- "pyproject.toml"
pull_request:
paths:
- "poetry.lock"
- "pyproject.toml"
workflow_dispatch:
jobs:
poetry-tests:
name: Poetry install and check
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
runs-on: ${{ matrix.os }}
steps:
- name: 📥 Checkout the repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 🐍 Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: ${{ matrix.python-version }}
- name: 📜 Setup Poetry
uses: abatilo/actions-poetry@3765cf608f2d4a72178a9fc5b918668e542b89b1 # v4.0.0
- name: 🔍 Check the correctness of the project config
run: poetry check
- name: 🚀 Do Install the package Test
run: poetry install --with dev --extras metrics
- name: 🧪 Run the Import test
run: poetry run python -c "import supervision; from supervision import assets; from supervision import metrics; print(supervision.__version__)"
- name: 🧪 Run the Test
run: poetry run pytest

39
.github/workflows/uv-test.yml vendored Normal file
View File

@ -0,0 +1,39 @@
name: 🔧 Uv Checks and Test Workflow
on:
push:
paths:
- "uv.lock"
- "pyproject.toml"
pull_request:
paths:
- "uv.lock"
- "pyproject.toml"
workflow_dispatch:
jobs:
poetry-tests:
name: Uv install and check
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
runs-on: ${{ matrix.os }}
steps:
- name: 📥 Checkout the repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 🐍 Install uv and set Python version ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
- name: 🚀 Install Packages
run: uv pip install -r pyproject.toml --extra dev --extra docs --extra metrics
- name: 🧪 Run the Import test
run: uv run python -c "import supervision; from supervision import assets; from supervision import metrics; print(supervision.__version__)"
- name: 🧪 Run the Test
run: uv run pytest

5105
poetry.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -41,9 +41,9 @@ dependencies = [
"numpy>=1.21.2,<1.26.0; python_version < '3.12'",
"numpy>=1.26.0,<2.1.0; python_version >= '3.12' and python_version < '3.13'",
"numpy>=2.1.0; python_version >= '3.13'",
"scipy (==1.10.0); python_version < '3.9'",
"scipy (>=1.10.0,<1.14.1) ; python_version >= '3.9' and python_version < '3.13'",
"scipy (>=1.14.1); python_version >= '3.13'",
"scipy==1.10.0; python_version < '3.9'",
"scipy>=1.10.0,<1.14.1; python_version >= '3.9' and python_version < '3.13'",
"scipy>=1.14.1; python_version >= '3.13'",
"matplotlib>=3.6.0",
"pyyaml>=5.3",
"defusedxml>=0.7.1",
@ -63,36 +63,29 @@ metrics = [
"pandas>=2.0.0; python_version < '3.13'",
"pandas>=2.2.3; python_version >= '3.13'"
]
[tool.poetry]
# Keep version here since it's dynamic
packages = [{ include = "supervision" }, { include = "supervision/py.typed" }]
[tool.poetry.group.dev.dependencies]
pytest = ">=7.2.2,<9.0.0"
tox = ">=4.11.4"
notebook = ">=6.5.3,<8.0.0"
ipywidgets = ">=8.1.1"
jupytext = ">=1.16.1"
nbconvert = ">=7.14.2"
docutils = "!=0.21"
[tool.poetry.group.docs.dependencies]
mkdocs-material = { extras = ["imaging"], version = "^9.5.5" }
mkdocstrings = ">=0.25.2,<0.27.0"
mkdocstrings-python = ">=1.10.9"
mike = ">=2.0.0"
# For Documentation Development use Python 3.10 or above
# Use Latest mkdocs-jupyter min 0.24.6 for Jupyter Notebook Theme support
mkdocs-jupyter = ">=0.24.3"
mkdocs-git-committers-plugin-2 = { version = ">=2.4.1", python = ">=3.8,<4" }
mkdocs-git-revision-date-localized-plugin = ">=1.2.4"
[tool.poetry.group.build.dependencies]
twine = ">=5.1.1,<7.0.0"
wheel = ">=0.40,<0.46"
build = ">=0.10,<1.3"
dev = [
"pytest>=7.2.2,<9.0.0",
"tox>=4.11.4",
"notebook>=6.5.3,<8.0.0",
"ipywidgets>=8.1.1",
"jupytext>=1.16.1",
"nbconvert>=7.14.2",
"docutils!=0.21"
]
docs = [
"mkdocs-material[imaging]>=9.5.5",
"mkdocstrings>=0.25.2,<0.27.0",
"mkdocstrings-python>=1.10.9",
"mike>=2.0.0",
"mkdocs-jupyter>=0.24.3",
"mkdocs-git-committers-plugin-2>=2.4.1; python_version >= '3.8' and python_version < '4'",
"mkdocs-git-revision-date-localized-plugin>=1.2.4"
]
build = [
"twine>=5.1.1,<7.0.0",
"wheel>=0.40,<0.46",
"build>=0.10,<1.3"
]
[tool.bandit]
target = ["test", "supervision"]
@ -102,7 +95,6 @@ tests = ["B201", "B301", "B318", "B314", "B303", "B413", "B412", "B410"]
check = true
imports = ["cv2", "supervision"]
[tool.ruff]
target-version = "py38"
@ -226,17 +218,21 @@ skip-magic-trailing-comma = false
line-ending = "auto"
[tool.codespell]
skip = "*.ipynb,poetry.lock"
skip = "*.ipynb"
count = true
quiet-level = 3
ignore-words-list = "STrack,sTrack,strack"
[tool.setuptools]
include-package-data = false
include-package-data = true
[tool.setuptools.packages.find]
include = ["supervision*"]
exclude = ["docs*", "test*", "examples*"]
[tool.setuptools.package-data]
supervision = ["py.typed"]
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
requires = ["setuptools >= 61.0"]
build-backend = "setuptools.build_meta"

5361
uv.lock Normal file

File diff suppressed because it is too large Load Diff