Skip to content

Commit 20954a2

Browse files
authored
Merge pull request #180 from onuralpszr/python-toml-file-convert
Introduce pyproject toml file with optional install method and dropping python 3.7 support
2 parents 22d82c3 + 399121b commit 20954a2

File tree

8 files changed

+3217
-84
lines changed

8 files changed

+3217
-84
lines changed

.github/workflows/publish.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,32 @@ jobs:
1616
with:
1717
ref: ${{ github.head_ref }}
1818
- name: 🐍 Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v2
19+
uses: actions/setup-python@v4
2020
with:
2121
python-version: ${{ matrix.python-version }}
2222
- name: 🦾 Install dependencies
2323
run: |
24+
python -m pip install --upgrade virtualenv
2425
python -m pip install --upgrade pip
25-
pip install ".[dev]"
26-
- name: 🚀 Publish to PyPi
27-
env:
28-
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
29-
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
30-
PYPI_TEST_PASSWORD: ${{ secrets.PYPI_TEST_PASSWORD }}
26+
virtualenv venv
27+
source venv/bin/activate
28+
python -m pip install --upgrade pip
29+
python -m pip install --upgrade poetry
30+
poetry install
31+
32+
- name: 🏗️ Build source and wheel distributions
3133
run: |
32-
make publish -e PYPI_USERNAME=$PYPI_USERNAME -e PYPI_PASSWORD=$PYPI_PASSWORD -e PYPI_TEST_PASSWORD=$PYPI_TEST_PASSWORD
34+
python -m pip install --upgrade build twine
35+
python -m build
36+
twine check --strict dist/*
37+
- name: 🚀 Publish to PyPi
38+
uses: pypa/gh-action-pypi-publish@release/v1
39+
with:
40+
user: ${{ secrets.PYPI_USERNAME }}
41+
password: ${{ secrets.PYPI_PASSWORD }}
42+
- name: 🚀 Publish to Test-PyPi
43+
uses: pypa/gh-action-pypi-publish@release/v1
44+
with:
45+
repository-url: https://test.pypi.org/legacy/
46+
user: ${{ secrets.PYPI_USERNAME }}
47+
password: ${{ secrets.PYPI_TEST_PASSWORD }}

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ jobs:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
python-version: [3.7, 3.8, 3.9, '3.10']
12+
python-version: ["3.8", "3.9", "3.10","3.11"]
1313
steps:
1414
- name: 🛎️ Checkout
1515
uses: actions/checkout@v3
1616
with:
1717
ref: ${{ github.head_ref }}
1818
- name: 🐍 Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v2
19+
uses: actions/setup-python@v4
2020
with:
2121
python-version: ${{ matrix.python-version }}
2222
- name: 🦾 Install dependencies

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ check_code_quality:
1616
flake8 $(check_dirs) --count --max-line-length=88 --exit-zero --ignore=D --extend-ignore=E203,E501,W503 --statistics
1717

1818
publish:
19-
python setup.py sdist bdist_wheel
19+
poetry build
2020
twine upload -r testpypi dist/* -u ${PYPI_USERNAME} -p ${PYPI_TEST_PASSWORD} --verbose
2121
twine check dist/*
2222
twine upload dist/* -u ${PYPI_USERNAME} -p ${PYPI_PASSWORD} --verbose

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
## 💻 install
2626

2727
Pip install the supervision package in a
28-
[**3.11>=Python>=3.7**](https://www.python.org/) environment.
28+
[**3.11>=Python>=3.8**](https://www.python.org/) environment.
2929

3030
```bash
3131
pip install supervision

poetry.lock

Lines changed: 3121 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
[tool.poetry]
2+
name = "supervision"
3+
version = "0.12.0"
4+
description = "A set of easy-to-use utils that will come in handy in any Computer Vision project"
5+
authors = ["Piotr Skalski <[email protected]>"]
6+
maintainers = ["Piotr Skalski <[email protected]>"]
7+
readme = "README.md"
8+
packages = [{include = "supervision"}]
9+
homepage = "https://github.com/roboflow/supervision"
10+
repository = "https://github.com/roboflow/supervision"
11+
documentation = "https://github.com/roboflow/supervision/blob/main/README.md"
12+
keywords = ["machine-learning", "deep-learning", "vision", "ML", "DL", "AI", "YOLOv5", "YOLOv8", "Roboflow"]
13+
14+
classifiers=[
15+
'Intended Audience :: Developers',
16+
'Intended Audience :: Science/Research',
17+
'License :: OSI Approved :: BSD License',
18+
'Programming Language :: Python :: 3',
19+
'Programming Language :: Python :: 3.8',
20+
'Programming Language :: Python :: 3.9',
21+
'Programming Language :: Python :: 3.10',
22+
'Programming Language :: Python :: 3 :: Only',
23+
'Topic :: Software Development',
24+
'Topic :: Scientific/Engineering',
25+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
26+
"Topic :: Scientific/Engineering :: Image Recognition",
27+
'Typing :: Typed',
28+
'Operating System :: Microsoft :: Windows',
29+
'Operating System :: POSIX',
30+
'Operating System :: Unix',
31+
'Operating System :: MacOS'
32+
]
33+
34+
[tool.poetry.dependencies]
35+
python = ">=3.8,<3.12.0"
36+
numpy = "^1.20.0"
37+
matplotlib = "^3.7.1"
38+
pyyaml = "^6.0"
39+
pillow = "^8.4.0"
40+
opencv-python = { version = "^4.8.0.74", optional = true }
41+
opencv-python-headless = "^4.8.0.74"
42+
43+
44+
[tool.poetry.extras]
45+
desktop = ["opencv-python"]
46+
47+
48+
[tool.poetry.group.dev.dependencies]
49+
twine = "^4.0.2"
50+
pytest = "^7.2.2"
51+
wheel = "^0.40.0"
52+
notebook = "^6.5.3"
53+
mkdocs-material = "^9.1.4"
54+
mkdocstrings = {extras = ["python"], version = "^0.20.0"}
55+
build = "^0.10.0"
56+
57+
58+
[tool.setuptools]
59+
include-package-data = false
60+
61+
[tool.setuptools.packages.find]
62+
exclude = ["docs*", "test*"]
63+
64+
[build-system]
65+
requires = ["poetry-core"]
66+
build-backend = "poetry.core.masonry.api"

setup.py

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

supervision/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
__version__ = "0.11.1"
1+
import importlib.metadata as importlib_metadata
2+
__version__ = importlib_metadata.version(__package__)
3+
24

35
from supervision.classification.core import Classifications
46
from supervision.dataset.core import (

0 commit comments

Comments
 (0)