Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: moved build info to pyproject.toml #1504

Merged
merged 2 commits into from
Oct 3, 2023
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
7 changes: 4 additions & 3 deletions .github/scripts/utils.sh
Original file line number Diff line number Diff line change
@@ -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"
}

Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools twine wheel
pip install build twine

- name: Build
run: |
python setup.py sdist bdist_wheel
python -m build

- name: Test the Build
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools twine wheel
pip install build twine

- name: Build
run: |
python setup.py sdist bdist_wheel
python -m build

- name: Test the Build
run: |
Expand Down
98 changes: 96 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]" }]
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",
Jonas1312 marked this conversation as resolved.
Show resolved Hide resolved
"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
Expand Down Expand Up @@ -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"]
8 changes: 0 additions & 8 deletions setup.cfg

This file was deleted.

109 changes: 0 additions & 109 deletions setup.py

This file was deleted.

4 changes: 2 additions & 2 deletions src/kili/entrypoints/mutations/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def upload_plugin(
plugin_path: Optional[str] = None,
plugin_name: Optional[str] = None,
verbose: bool = True,
**kwargs # pylint: disable=missing-param-doc
**kwargs, # pylint: disable=missing-param-doc
) -> LiteralString:
"""Uploads a plugin.

Expand Down Expand Up @@ -190,7 +190,7 @@ def update_plugin(
plugin_path: Optional[str] = None,
plugin_name: Optional[str] = None,
verbose: bool = True,
**kwargs # pylint: disable=missing-param-doc
**kwargs, # pylint: disable=missing-param-doc
) -> LiteralString:
"""Update a plugin with new code.

Expand Down