Skip to content
This repository was archived by the owner on Jan 31, 2025. It is now read-only.
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
22 changes: 15 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,52 @@
name: ci

on:
push:
branches:
- main
pull_request:

jobs:
build:

runs-on: ${{ matrix.os }}
env:
PYTHONIOENCODING: utf-8
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
python-version: ['3.9']
python-version: [3.9]

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4

- uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: |
pyproject.toml
enable-cache: "false"

- name: Install main
shell: bash
run: |
pip install .[test]
make install

- name: Lint
shell: bash
run: |
make lint

- name: Mypy
shell: bash
run: |
make mypy

- name: Test
shell: bash
run: |
make test

- name: Install from dist
shell: bash
run: |
make build
pip install dist/labelme_toolkit-*.whl
pip install dist/*.whl
50 changes: 0 additions & 50 deletions .github/workflows/release.yml

This file was deleted.

23 changes: 14 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,30 @@ all:

PACKAGE_NAME:=labelme_toolkit

install:
uv sync --dev

mypy:
mypy --package $(PACKAGE_NAME)
uv run mypy --package $(PACKAGE_NAME)

lint:
ruff format --check
ruff check
uv run ruff format --check
uv run ruff check

format:
ruff format
ruff check --fix
uv run ruff format
uv run ruff check --fix

test:
python -m pytest -n auto -v $(PACKAGE_NAME)
uv run pytest -n auto -v $(PACKAGE_NAME)

clean:
rm -rf build dist *.egg-info

build: clean
python -m build --sdist --wheel
uv run python -m build --sdist --wheel

publish: build
python -m twine upload dist/$(PACKAGE_NAME)-*
# upload: build
# python -m twine upload dist/$(PACKAGE_NAME)-*
#
# publish: build upload
36 changes: 15 additions & 21 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,26 @@ classifiers = [
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"click",
"imgviz",
"jinja2",
"loguru",
"numpy",
"click>=8.1.8",
"imgviz>=1.7.6",
"jinja2>=3.1.5",
"loguru>=0.7.3",
"numpy>=2.0.2",
"osam>=0.2.0",
"Pillow>=10.1",
]
dynamic = ["readme", "version"]

[project.optional-dependencies]
test = [
"build",
"mypy",
"types-Pillow",
"types-setuptools",
"pytest",
"pytest-xdist",
"ruff",
"twine",
]
pro = [
"labelme-toolkit-pro",
[dependency-groups]
dev = [
"build>=1.2.2.post1",
"mypy>=1.14.1",
"pytest>=8.3.4",
"pytest-xdist>=3.6.1",
"ruff>=0.9.2",
"twine>=6.0.1",
"types-pillow>=10.2.0.20240822",
"types-setuptools>=75.8.0.20250110",
]

[project.urls]
Expand Down Expand Up @@ -107,8 +104,5 @@ skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"

[tool.uv.sources]
labelme-toolkit-pro = { git = "https://github.com/labelmeai/toolkit-pro.git" }

[tool.ruff.lint.isort]
force-single-line = true
Loading