From 4c217256793631c24c9856c08b46900a6f014575 Mon Sep 17 00:00:00 2001 From: yassun7010 Date: Wed, 20 Nov 2024 09:46:54 +0900 Subject: [PATCH] feat: python package. --- Cargo.toml | 1 + python/pyproject.toml | 13 +++++++++---- python/uv.lock | 22 +++++++++++++++++++++- rust/tombi-cli/Cargo.toml | 2 ++ rust/tombi-cli/README.md | 1 + 5 files changed, 34 insertions(+), 5 deletions(-) create mode 120000 rust/tombi-cli/README.md diff --git a/Cargo.toml b/Cargo.toml index 8c61f019..721a16a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,6 +7,7 @@ version = "0.0.1" edition = "2021" authors = ["yassun7010 "] license = "MIT" +repository = "https://github.com/yassun7010/tombi" [workspace.dependencies] anyhow = "1.0.89" diff --git a/python/pyproject.toml b/python/pyproject.toml index bbe28d02..a16e6669 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -2,19 +2,24 @@ name = "tombi" version = "0.0.1" description = "Reserved package for tombi" -readme = "README.md" -requires-python = ">=3.12" +requires-python = ">=3.10" dependencies = [] [project.urls] GitHub = "https://github.com/yassun7010/tombi" [build-system] -requires = ["hatchling"] -build-backend = "hatchling.build" +requires = ["maturin>=1.5,<2.0"] +build-backend = "maturin" [dependency-groups] dev = [ "pytest>=8.3.3", "ruff>=0.7.4", ] + +[tool.maturin] +bindings = "bin" +manifest-path = "../rust/tombi-cli/Cargo.toml" +module-name = "tombi" +python-source = "src" diff --git a/python/uv.lock b/python/uv.lock index 7833b868..bf35efca 100644 --- a/python/uv.lock +++ b/python/uv.lock @@ -1,5 +1,5 @@ version = 1 -requires-python = ">=3.12" +requires-python = ">=3.10" [[package]] name = "colorama" @@ -10,6 +10,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335 }, ] +[[package]] +name = "exceptiongroup" +version = "1.2.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/09/35/2495c4ac46b980e4ca1f6ad6db102322ef3ad2410b79fdde159a4b0f3b92/exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc", size = 28883 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/02/cc/b7e31358aac6ed1ef2bb790a9746ac2c69bcb3c8588b41616914eb106eaf/exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b", size = 16453 }, +] + [[package]] name = "iniconfig" version = "2.0.0" @@ -43,9 +52,11 @@ version = "8.3.3" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "exceptiongroup", marker = "python_full_version < '3.11'" }, { name = "iniconfig" }, { name = "packaging" }, { name = "pluggy" }, + { name = "tomli", marker = "python_full_version < '3.11'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/8b/6c/62bbd536103af674e227c41a8f3dcd022d591f6eed5facb5a0f31ee33bbc/pytest-8.3.3.tar.gz", hash = "sha256:70b98107bd648308a7952b06e6ca9a50bc660be218d53c257cc1fc94fda10181", size = 1442487 } wheels = [ @@ -95,3 +106,12 @@ dev = [ { name = "pytest", specifier = ">=8.3.3" }, { name = "ruff", specifier = ">=0.7.4" }, ] + +[[package]] +name = "tomli" +version = "2.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/1e/e4/1b6cbcc82d8832dd0ce34767d5c560df8a3547ad8cbc427f34601415930a/tomli-2.1.0.tar.gz", hash = "sha256:3f646cae2aec94e17d04973e4249548320197cfabdf130015d023de4b74d8ab8", size = 16622 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/de/f7/4da0ffe1892122c9ea096c57f64c2753ae5dd3ce85488802d11b0992cc6d/tomli-2.1.0-py3-none-any.whl", hash = "sha256:a5c57c3d1c56f5ccdf89f6523458f60ef716e210fc47c4cfb188c5ba473e0391", size = 13750 }, +] diff --git a/rust/tombi-cli/Cargo.toml b/rust/tombi-cli/Cargo.toml index ceb8cbe9..91dac185 100644 --- a/rust/tombi-cli/Cargo.toml +++ b/rust/tombi-cli/Cargo.toml @@ -1,9 +1,11 @@ [package] name = "tombi-cli" +description = "TOML Formatter/Linter CLI Tool." version.workspace = true edition.workspace = true authors.workspace = true license.workspace = true +repository.workspace = true [[bin]] name = "tombi" diff --git a/rust/tombi-cli/README.md b/rust/tombi-cli/README.md new file mode 120000 index 00000000..fe840054 --- /dev/null +++ b/rust/tombi-cli/README.md @@ -0,0 +1 @@ +../../README.md \ No newline at end of file