diff --git a/.github/scripts/utils.sh b/.github/scripts/utils.sh index d84f7ab823..86562833bc 100755 --- a/.github/scripts/utils.sh +++ b/.github/scripts/utils.sh @@ -1,7 +1,7 @@ #!/bin/bash -get_sdk_version_from_setup_cfg() { - sdk_version=$(cat setup.cfg | grep current_version | cut -d ' ' -f 3) +get_sdk_version_from_pyproject_toml() { + sdk_version=$(cat pyproject.toml | grep version | cut -d ' ' -f 3 | sed -r s,"^\"(.*)\"$","\1",) echo "$sdk_version" } @@ -11,9 +11,10 @@ bump_version() { new_version=$(bump2version \ --list \ --"$1" \ - --current-version "$(get_sdk_version_from_setup_cfg)" \ + --current-version "$(get_sdk_version_from_pyproject_toml)" \ "$2" \ src/kili/__init__.py \ + pyproject.toml \ | grep new_version | sed -r s,"^.*=",,) echo "$new_version" diff --git a/pyproject.toml b/pyproject.toml index 91037dd8a0..8e25591d6e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,96 @@ +[build-system] +requires = ["setuptools", "wheel"] + +[project] +name = "kili" +version = "2.147.0" +description = "Python client for Kili Technology labeling tool" +readme = "README.md" +authors = [{ name = "Kili Technology", email = "contact@kili-technology.com" }] +license = { file = "LICENSE.txt" } +requires-python = ">=3.8" +classifiers = [ + "Intended Audience :: Science/Research", + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Topic :: Software Development", + "Topic :: Scientific/Engineering", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX", + "Operating System :: Unix", + "Operating System :: MacOS", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", +] +dependencies = [ + "pandas >= 1.0.0, < 3.0.0", + "click >= 8.0.0, < 9.0.0", + "requests >= 2.0.0, < 3.0.0", + "tabulate >= 0.9.0, < 0.10.0", + "tenacity >= 8.0.0, < 9.0.0", + "tqdm >= 4.0.0, < 5.0.0", + "typeguard >= 4, < 5", + "typing-extensions >= 4.1.0, < 5.0.0", + "pyparsing >= 3.0.0, < 4.0.0", + "websocket-client >= 1.0.0, < 2.0.0", + "pyyaml >= 6.0, < 7.0", + "Pillow >= 9.0.0, < 10.1.0", + "cuid >= 0.4, < 0.5", + "urllib3 >= 1.26, < 3", + "ffmpeg-python >= 0.2.0, < 0.3.0", + "gql[requests,websockets] >= 3.5.0b5, < 4.0.0", + "filelock >= 3.0.0, < 4.0.0", + "pip-system-certs >= 4.0.0, < 5.0.0; platform_system=='Windows'", + "pyrate-limiter >= 2, < 3", +] +urls = { homepage = "https://github.com/kili-technology/kili-python-sdk" } + +[project.scripts] +kili = "kili.entrypoints.cli:main" + + +[project.optional-dependencies] +dev = [ + # release + "bump2version", + # tests + "pytest", + "pytest-mock", + "pytest-cov", + "pytest-xdist[psutil]", + "pytest-timeout", + # documentation + "mkdocs", + "mkdocs-material", + "mkdocstrings", + "mkdocstrings-python-legacy", + "mkdocs-click", + "mike", + "pymdown-extensions", + # linting + "black", + "pre-commit >= 3.3.0, < 4.0.0", + "pylint == 2.17.7", + "pyright == 1.1.329", + # notebooks tests + "nbformat", + "nbconvert", + "ipykernel", + # profiling + "pyinstrument", + # other optional dependencies + "opencv-python >= 4.0.0, < 5.0.0", + "azure-storage-blob >= 12.0.0, < 13.0.0", +] +image-utils = ["opencv-python >= 4.0.0, < 5.0.0"] +azure = ["azure-storage-blob >= 12.0.0, < 13.0.0"] + [tool.black] line-length = 100 preview = true @@ -63,5 +156,6 @@ ignore = [ [tool.ruff.pydocstyle] convention = "google" -[tool.pytest.ini_options] -pythonpath = ["src", "."] +[tool.pytest] +ini_options = { pythonpath = ["src", "."] } +aliases = ["test = pytest"] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 50a25f1d4b..0000000000 --- a/setup.cfg +++ /dev/null @@ -1,8 +0,0 @@ -[bumpversion] -current_version = 2.147.0 - -[metadata] -description-file = README.md - -[aliases] -test = pytest diff --git a/setup.py b/setup.py deleted file mode 100644 index 1b688f6699..0000000000 --- a/setup.py +++ /dev/null @@ -1,109 +0,0 @@ -"""Script permits to setup the python package.""" - -from setuptools import find_packages, setup - -from src.kili import __version__ - -install_requires = [ - "pandas>=1.0.0,<3.0.0", - "click>=8.0.0,<9.0.0", - "requests>=2.0.0,<3.0.0", - "tabulate>=0.9.0,<0.10.0", - "tenacity>=8.0.0,<9.0.0", - "tqdm>=4.0.0,<5.0.0", - "typeguard>=4,<5", - "typing_extensions>=4.1.0,<5.0.0", - "pyparsing>=3.0.0,<4.0.0", - "websocket-client>=1.0.0,<2.0.0", - "pyyaml>=6.0,<7.0", - "Pillow>=9.0.0,<10.1.0", - "cuid>=0.4,<0.5", - "urllib3>=1.26,<3", - "ffmpeg-python>=0.2.0,<0.3.0", - "gql[requests,websockets]>=3.5.0b5,<4.0.0", - "filelock>=3.0.0,<4.0.0", - "pip-system-certs>=4.0.0,<5.0.0; platform_system=='Windows'", - "pyrate-limiter>=2,<3", -] - -image_requires = [ - "opencv-python>=4.0.0,<5.0.0", -] - -azure_requires = [ - "azure-storage-blob>=12.0.0,<13.0.0", -] - -dev_extra = [ - # release - "bump2version", - # tests - "pytest", - "pytest-mock", - "pytest-cov", - "pytest-xdist[psutil]", - "pytest-timeout", - # documentation - "mkdocs", - "mkdocs-material", - "mkdocstrings", - "mkdocstrings-python-legacy", - "mkdocs-click", - "mike", - "pymdown-extensions", - # linting - "black", - "pre-commit>=3.3.0,<4.0.0", - "pylint==2.17.7", - "pyright==1.1.329", - # notebooks tests - "nbformat", - "nbconvert", - "ipykernel", - # profiling - "pyinstrument", - *image_requires, - *azure_requires, -] - -setup( - name="kili", - version=__version__, - package_dir={"": "src"}, - packages=find_packages(where="src", exclude=["tests"]), - author="Kili Technology", - author_email="contact@kili-technology.com", - description="Python client for Kili Technology labeling tool", - long_description=open("README.md", encoding="utf-8").read(), - long_description_content_type="text/markdown", - install_requires=install_requires, - extras_require={ - "dev": dev_extra, - "image-utils": image_requires, - "azure": azure_requires, - }, - include_package_data=True, - entry_points={ - "console_scripts": ["kili=kili.entrypoints.cli:main"], - }, - url="https://github.com/kili-technology/kili-python-sdk", - classifiers=[ - "Intended Audience :: Science/Research", - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Topic :: Software Development", - "Topic :: Scientific/Engineering", - "Operating System :: Microsoft :: Windows", - "Operating System :: POSIX", - "Operating System :: Unix", - "Operating System :: MacOS", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: Implementation :: CPython", - "Programming Language :: Python :: Implementation :: PyPy", - ], -)