From e8d442b3f58d5feb43611711d3c2a4837ad61a2a Mon Sep 17 00:00:00 2001 From: detachhead Date: Sat, 26 Oct 2024 22:05:38 +1000 Subject: [PATCH] switch to uv --- pyproject.toml | 87 +++++++++++++++++++++++++------------------------- 1 file changed, 44 insertions(+), 43 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e3805f191..7ab1d5b24 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,27 @@ -[tool.pyprojectx] -main = ["pdm==2.18.2"] +[project] +name = "basedpyright" +description = "static type checking for Python (but based)" +dynamic = ["version"] +authors = [ + { name = "detachhead", email = "detachhead@users.noreply.github.com" }, +] +dependencies = [ + # required by the basedpyright cli & langserver wrapper scripts. only binaries are required (no cli) + # since the user shouldn't have a node/npm binary unknowingly added to their PATH + "nodejs-wheel-binaries>=20.13.1", +] +requires-python = ">=3.8" +readme = "README.md" +license = { text = "MIT" } -[tool.pdm] -distribution = true +[project.urls] +repository = "https://github.com/detachhead/basedpyright" -[tool.pdm.dev-dependencies] +[project.scripts] +basedpyright = 'basedpyright.pyright:main' +basedpyright-langserver = 'basedpyright.langserver:main' + +[dependency-groups] dev = [ "pylint>=3.0.0a7", "ruff>=0.2.2", @@ -35,11 +52,22 @@ docstubs_old = [ ] lochelper = ["rich>=13.0", "textual>=0.70.0"] -[tool.pdm.version] -source = "call" -getter = "based_build.get_version:get_version" +[build-system] +requires = [ + "pdm-backend>=2.3.0", + # required for building the pyright npm package to be bundled in the pypi package. + # cli is required due to dependencies with install scripts that assume node/npm is in the path + "nodejs-wheel>=20.13.1", + # used in pdm_build.py: + "typing_extensions>=4.12.2", + "docify>=1.0.0", +] +build-backend = "pdm.backend" + +[tool.pyprojectx] +main = ["uv==0.4.27"] -[tool.pdm.scripts] +[tool.pyprojectx.aliases] update = "pdm update -G dev -G docstubs -G lochelper" # we specify the python range here because our dev dependencies require at least python 3.9 but we still want to # support 3.8 in the published package. ideally we wouldn't because it's EOL but we want to support all versions @@ -57,6 +85,13 @@ generate_docstubs = { call = "based_build.generate_docstubs:main" } localization_helper = 'python based_build/localization_helper.py' docs = "mkdocs serve" +[tool.uv] +default-groups = ["dev", "docstubs", "lochelper"] + +[tool.pdm.version] +source = "call" +getter = "based_build.get_version:get_version" + [tool.pdm.build] excludes = ["tests/", "pdm_build.py"] source-includes = [ @@ -71,40 +106,6 @@ source-includes = [ "tsconfig.json", ] -[project] -name = "basedpyright" -description = "static type checking for Python (but based)" -dynamic = ["version"] -authors = [ - { name = "detachhead", email = "detachhead@users.noreply.github.com" }, -] -dependencies = [ - # required by the basedpyright cli & langserver wrapper scripts. only binaries are required (no cli) - # since the user shouldn't have a node/npm binary unknowingly added to their PATH - "nodejs-wheel-binaries>=20.13.1", -] -requires-python = ">=3.8" -readme = "README.md" -license = { text = "MIT" } - -[project.urls] -repository = "https://github.com/detachhead/basedpyright" - -[project.scripts] -basedpyright = 'basedpyright.pyright:main' -basedpyright-langserver = 'basedpyright.langserver:main' - -[build-system] -requires = [ - "pdm-backend>=2.3.0", - # required for building the pyright npm package to be bundled in the pypi package. - # cli is required due to dependencies with install scripts that assume node/npm is in the path - "nodejs-wheel>=20.13.1", - # used in pdm_build.py: - "typing_extensions>=4.12.2", - "docify>=1.0.0", -] -build-backend = "pdm.backend" [tool.pylint.MASTER] fail-on = "I"