Skip to content

Commit 0ff06da

Browse files
committed
Fix build
1 parent a799348 commit 0ff06da

8 files changed

Lines changed: 133 additions & 101 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build and publish CPU 🐍📦 to PyPI
2+
on:
3+
push:
4+
tags:
5+
- 'v*'
6+
7+
jobs:
8+
build-n-publish:
9+
if: startsWith(github.ref, 'refs/tags/')
10+
name: Build and publish CPU 🐍📦 to PyPI
11+
runs-on: ubuntu-latest
12+
environment:
13+
name: pypi
14+
url: https://pypi.org/p/anylabeling
15+
permissions:
16+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
17+
steps:
18+
- uses: actions/checkout@v3
19+
- name: Set up Python
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: "3.x"
23+
- name: Install pypa/build
24+
run: >-
25+
python -m pip install build==1.2.2 twine==6.1.0 --user
26+
- name: Set preferred device to CPU
27+
run: >-
28+
sed -i'' -e 's/\_\_preferred_device\_\_[ ]*=[ ]*\"[A-Za-z0-9]*\"/__preferred_device__ = "CPU"/g' anylabeling/app_info.py
29+
- name: Build a binary wheel and a source tarball
30+
run: >-
31+
python -m build --sdist --wheel --outdir dist/ .
32+
- name: Publish distribution 📦 to PyPI
33+
if: startsWith(github.ref, 'refs/tags')
34+
uses: pypa/gh-action-pypi-publish@release/v1
35+
with:
36+
skip_existing: true
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build and publish GPU 🐍📦 to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
10+
build-n-publish-gpu:
11+
if: startsWith(github.ref, 'refs/tags/')
12+
name: Build and publish GPU 🐍📦 to PyPI
13+
runs-on: ubuntu-latest
14+
environment:
15+
name: pypi
16+
url: https://pypi.org/p/anylabeling-gpu
17+
permissions:
18+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
19+
steps:
20+
- uses: actions/checkout@v3
21+
- name: Set up Python
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: "3.x"
25+
- name: Install pypa/build
26+
run: >-
27+
python -m pip install build==1.2.2 twine==6.1.0 --user
28+
- name: Set preferred device to GPU
29+
run: >-
30+
sed -i'' -e 's/\_\_preferred_device\_\_[ ]*=[ ]*\"[A-Za-z0-9]*\"/__preferred_device__ = "GPU"/g' anylabeling/app_info.py
31+
- name: Build a binary wheel and a source tarball
32+
run: >-
33+
python -m build --wheel --outdir dist/ .
34+
- name: Publish distribution 📦 to PyPI
35+
if: startsWith(github.ref, 'refs/tags')
36+
uses: pypa/gh-action-pypi-publish@release/v1
37+
with:
38+
skip_existing: true

.github/workflows/python-publish.yml

Lines changed: 0 additions & 76 deletions
This file was deleted.

anylabeling/app_info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
__appname__ = "AnyLabeling"
22
__appdescription__ = "Effortless data labeling with AI support"
3-
__version__ = "0.4.17"
3+
__version__ = "0.4.22"
44
__preferred_device__ = "CPU" # GPU or CPU

pyproject.toml

Lines changed: 51 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,55 @@
1-
[tool.black]
2-
line-length = 79
3-
#include = '\.pyi?$'
4-
exclude = '''
5-
/(
6-
\.git
7-
| \.hg
8-
| \.mypy_cache
9-
| \.tox
10-
| \.venv
11-
| _build
12-
| buck-out
13-
| build
14-
| dist
15-
)/
16-
'''
1+
[project]
2+
name = "anylabeling"
3+
dynamic = ["version"]
4+
description = "Effortless data labeling with AI support"
5+
readme = "README.md"
6+
authors = [
7+
{name = "Viet-Anh Nguyen", email = "vietanh.dev@gmail.com"}
8+
]
9+
requires-python = ">=3.10"
10+
keywords = ["Image Annotation", "Machine Learning", "Deep Learning"]
11+
classifiers = [
12+
"Intended Audience :: Developers",
13+
"Intended Audience :: Science/Research",
14+
"Natural Language :: English",
15+
"Operating System :: OS Independent",
16+
"Programming Language :: Python",
17+
"Programming Language :: Python :: 3.10",
18+
"Programming Language :: Python :: 3.11",
19+
"Programming Language :: Python :: 3.12",
20+
"Programming Language :: Python :: 3 :: Only",
21+
]
22+
# Note: We're using most standard dependencies here
23+
# The GPU version will be handled by the setup.py
24+
# which dynamically chooses between onnxruntime and onnxruntime-gpu
25+
dependencies = [
26+
"imgviz>=0.11",
27+
"natsort>=7.1.0",
28+
"numpy==1.26.4",
29+
"Pillow>=2.8",
30+
"PyYAML==6.0.1",
31+
"termcolor==1.1.0",
32+
"opencv-python-headless==4.7.0.72",
33+
"PyQt5>=5.15.7; platform_system != 'Darwin'",
34+
"onnx==1.16.1",
35+
"qimage2ndarray==1.10.0",
36+
"darkdetect==0.8.0",
37+
"onnxruntime==1.18.1",
38+
]
39+
40+
[project.urls]
41+
Homepage = "https://github.com/vietanhdev/anylabeling"
42+
43+
[tool.setuptools.dynamic]
44+
version = {attr = "anylabeling.__version__"}
45+
46+
[project.scripts]
47+
anylabeling = "anylabeling.app:main"
48+
49+
# Since this project has dynamic dependencies based on GPU availability
50+
# and platform, we're still using setup.py for the final package building.
51+
# This configuration provides the minimal metadata needed for wheel building.
1752

1853
[build-system]
1954
requires = ["setuptools", "wheel"]
2055
build-backend = "setuptools.build_meta"
21-

requirements-dev.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
-r requirements.txt
2-
build
3-
twine
4-
black
2+
build==1.2.2
3+
twine==6.1.0
4+

requirements-gpu-dev.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
-r requirements-gpu.txt
2-
build
3-
twine
2+
build==1.2.2
3+
twine==6.1.0

requirements-macos-dev.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
-r requirements-macos.txt
2-
build
3-
twine
2+
build==1.2.2
3+
twine==6.1.0

0 commit comments

Comments
 (0)