From dead7a51c3ec12773cb9993770c4c7118a288b2b Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Tue, 19 Nov 2024 20:17:59 +1300 Subject: [PATCH] Implement support for Astral's uv. Signed-off-by: Thomas Mansencal --- .gitignore | 6 +- src/apps/ocioview/pyproject.toml | 116 ++++++++++++++++++----------- src/apps/ocioview/requirements.txt | 3 +- 3 files changed, 76 insertions(+), 49 deletions(-) diff --git a/.gitignore b/.gitignore index 53ca1bc274..827d8df759 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,8 @@ dist* mastercopy *.pyc !*.yml -.vscode +.idea/ +.venv/ +.vscode/ -src/apps/ocioview/poetry.lock +src/apps/ocioview/uv.lock diff --git a/src/apps/ocioview/pyproject.toml b/src/apps/ocioview/pyproject.toml index 858223b4d5..10ec8d460f 100644 --- a/src/apps/ocioview/pyproject.toml +++ b/src/apps/ocioview/pyproject.toml @@ -1,49 +1,75 @@ -[tool.poetry] +[project] name = "ocioview" version = "0.1.0" description = "OpenColorIO config visual editor application" -license = "BSD-3-Clause" -authors = ["Contributors to the OpenColorIO Project"] +requires-python = ">=3.10,<3.14" +authors = [ + { name = "Contributors to the OpenColorIO Project" } +] +maintainers = [ + { name = "Contributors to the OpenColorIO Project" } +] +license = { text = "BSD-3-Clause" } +classifiers = [ + "Development Status :: 3 - Alpha", + "Environment :: Console", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "License :: OSI Approved", + "Natural Language :: English", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Topic :: Scientific/Engineering", + "Topic :: Software Development", +] +dependencies = [ + "colour-science>=0.4.5,<0.5", + "colour-visuals", + "imageio>=2,< 3", + "networkx>=3,<4", + "numpy>=1.24,<3", + "opencolorio>=2,<3", + "pygfx>=0.1,<0.3", + "pygments", + "pyopengl", + "pyside6", + "qtawesome", + "scipy>=1.10,<2", +] + +[tool.uv.sources] +"colour-visuals" = { git = "https://github.com/colour-science/colour-visuals.git" } -[tool.poetry.dependencies] -python = ">= 3.9, < 3.12" -colour-science = {git = "https://github.com/colour-science/colour.git"} -colour-visuals = {git = "https://github.com/colour-science/colour-visuals.git"} -imageio = ">= 2, < 3" -networkx = ">= 2.7, < 3" -numpy = ">= 1.22, < 2" -opencolorio = "*" -pygfx = "*" -pygments = "*" -pyopengl = "*" -pyside6 = "*" -qtawesome = "*" -scipy = ">= 1.8, < 2" -wpgu = "*" +[project.optional-dependencies] +docs = [ + "restructuredtext-lint", + "sphinx", +] -[tool.poetry.group.dev.dependencies] -black = "*" -blackdoc = "*" -coverage = "!= 6.3" -coveralls = "*" -flynt = "*" -invoke = "*" -jupyter = "*" -pre-commit = "*" -pyright = "*" -pytest = "*" -pytest-cov = "*" -pytest-qt = "*" -pytest-xdist = "*" -ruff = "*" -toml = "*" -twine = "*" +[tool.uv] +package = true +dev-dependencies = [ + "black", + "coverage", + "coveralls", + "hatch", + "invoke", + "jupyter", + "pre-commit", + "pyright", + "pytest", + "pytest-cov", + "pytest-xdist", + "toml", + "twine", +] -[tool.poetry.group.docs.dependencies] -pydata-sphinx-theme = "*" -restructuredtext-lint = "*" -sphinx = "*" -sphinxcontrib-bibtex = "*" +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.build.targets.wheel] +packages = [ "ocioview" ] [tool.black] line-length = 79 @@ -85,7 +111,7 @@ filterwarnings = [ ] [tool.ruff] -target-version = "py39" +target-version = "py310" line-length = 88 select = [ "A", # flake8-builtins @@ -128,7 +154,7 @@ select = [ "TRY", # tryceratops "UP", # pyupgrade "W", # pydocstyle - "YTT" # flake8-2020 + "YTT", # flake8-2020 ] ignore = [ "B008", @@ -162,6 +188,7 @@ ignore = [ "RET508", "TRY003", "TRY300", + "UP038", ] typing-modules = ["colour.hints"] fixable = ["B", "C", "E", "F", "PIE", "RUF", "SIM", "UP", "W"] @@ -172,6 +199,5 @@ convention = "numpy" [tool.ruff.per-file-ignores] "docs/*" = ["INP"] -[build-system] -requires = ["poetry_core>=1.0.0"] -build-backend = "poetry.core.masonry.api" +[tool.ruff.format] +docstring-code-format = true diff --git a/src/apps/ocioview/requirements.txt b/src/apps/ocioview/requirements.txt index 124acd49da..ec6b8bca1e 100644 --- a/src/apps/ocioview/requirements.txt +++ b/src/apps/ocioview/requirements.txt @@ -1,4 +1,4 @@ -colour-science @ git+https://github.com/colour-science/colour.git +colour-science colour-visuals @ git+https://github.com/colour-science/colour-visuals.git imageio networkx @@ -10,4 +10,3 @@ PyOpenGL PySide6 QtAwesome scipy -wgpu