From 7c54e41174bd13aa4cd21cdac12fb1e93bc17fff Mon Sep 17 00:00:00 2001 From: forwardyoung Date: Sat, 26 Oct 2024 11:52:09 +0900 Subject: [PATCH 1/2] chore: open draft PR for initial setup of Python library structure --- integrations/python/.gitignore | 10 ++++++ integrations/python/.python-version | 1 + integrations/python/README.md | 11 +++++++ integrations/python/pyproject.toml | 31 +++++++++++++++++++ integrations/python/requirements-dev.lock | 12 +++++++ integrations/python/requirements.lock | 12 +++++++ .../python/src/lib9c_python/__init__.py | 2 ++ 7 files changed, 79 insertions(+) create mode 100644 integrations/python/.gitignore create mode 100644 integrations/python/.python-version create mode 100644 integrations/python/README.md create mode 100644 integrations/python/pyproject.toml create mode 100644 integrations/python/requirements-dev.lock create mode 100644 integrations/python/requirements.lock create mode 100644 integrations/python/src/lib9c_python/__init__.py diff --git a/integrations/python/.gitignore b/integrations/python/.gitignore new file mode 100644 index 0000000000..88b57474ec --- /dev/null +++ b/integrations/python/.gitignore @@ -0,0 +1,10 @@ +# lib9c_python generated files +__pycache__/ +*.py[oc] +build/ +dist/ +wheels/ +*.egg-info + +# venv +.venv diff --git a/integrations/python/.python-version b/integrations/python/.python-version new file mode 100644 index 0000000000..56bb66057d --- /dev/null +++ b/integrations/python/.python-version @@ -0,0 +1 @@ +3.12.7 diff --git a/integrations/python/README.md b/integrations/python/README.md new file mode 100644 index 0000000000..4e88aa30cf --- /dev/null +++ b/integrations/python/README.md @@ -0,0 +1,11 @@ +## Description: +This is a Python library designed for managing integrations and dependencies within the /integrations/python directory. The library follows PEP 621 standards for configuration and uses rye as the dependency manager and build tool. + +## Installation: +Install dependencies with rye +``` +rye sync +``` + +## Project Setup +This project is configured with a pyproject.toml file following PEP 621 standards, which defines dependencies and project metadata. diff --git a/integrations/python/pyproject.toml b/integrations/python/pyproject.toml new file mode 100644 index 0000000000..64b1742f2c --- /dev/null +++ b/integrations/python/pyproject.toml @@ -0,0 +1,31 @@ +[project] +name = "lib9c_python" +version = "0.1.0" +description = "A Python library for managing integrations and dependencies in the /integrations/python directory" +authors = [ + { name = "forwardyoung", email = "chahwayoung214@gmail.com" } +] +keywords = ["lib9c", "planetarium"] + +classifiers = [ + "Development Status :: 3 - Alpha", + "Programming Language :: Python" +] +dependencies = [] +readme = "README.md" +requires-python = ">= 3.8" +license = { text = "MIT" } + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.rye] +managed = true +dev-dependencies = [] + +[tool.hatch.metadata] +allow-direct-references = true + +[tool.hatch.build.targets.wheel] +packages = ["src/lib9c_python"] diff --git a/integrations/python/requirements-dev.lock b/integrations/python/requirements-dev.lock new file mode 100644 index 0000000000..505fd45b0a --- /dev/null +++ b/integrations/python/requirements-dev.lock @@ -0,0 +1,12 @@ +# generated by rye +# use `rye lock` or `rye sync` to update this lockfile +# +# last locked with the following flags: +# pre: false +# features: [] +# all-features: false +# with-sources: false +# generate-hashes: false +# universal: false + +-e file:. diff --git a/integrations/python/requirements.lock b/integrations/python/requirements.lock new file mode 100644 index 0000000000..505fd45b0a --- /dev/null +++ b/integrations/python/requirements.lock @@ -0,0 +1,12 @@ +# generated by rye +# use `rye lock` or `rye sync` to update this lockfile +# +# last locked with the following flags: +# pre: false +# features: [] +# all-features: false +# with-sources: false +# generate-hashes: false +# universal: false + +-e file:. diff --git a/integrations/python/src/lib9c_python/__init__.py b/integrations/python/src/lib9c_python/__init__.py new file mode 100644 index 0000000000..b111663ef5 --- /dev/null +++ b/integrations/python/src/lib9c_python/__init__.py @@ -0,0 +1,2 @@ +def hello() -> str: + return "Hello from lib9c_python!" From ddfce23961ab72100ca01012bf800a2462b357be Mon Sep 17 00:00:00 2001 From: forwardyoung Date: Sat, 26 Oct 2024 14:56:34 +0900 Subject: [PATCH 2/2] chore: rename library --- integrations/python/.gitignore | 2 +- integrations/python/pyproject.toml | 4 ++-- integrations/python/src/lib9c/__init__.py | 2 ++ integrations/python/src/lib9c_python/__init__.py | 2 -- 4 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 integrations/python/src/lib9c/__init__.py delete mode 100644 integrations/python/src/lib9c_python/__init__.py diff --git a/integrations/python/.gitignore b/integrations/python/.gitignore index 88b57474ec..9e9be3aff3 100644 --- a/integrations/python/.gitignore +++ b/integrations/python/.gitignore @@ -1,4 +1,4 @@ -# lib9c_python generated files +# lib9c generated files __pycache__/ *.py[oc] build/ diff --git a/integrations/python/pyproject.toml b/integrations/python/pyproject.toml index 64b1742f2c..9c5e74e5de 100644 --- a/integrations/python/pyproject.toml +++ b/integrations/python/pyproject.toml @@ -1,5 +1,5 @@ [project] -name = "lib9c_python" +name = "lib9c" version = "0.1.0" description = "A Python library for managing integrations and dependencies in the /integrations/python directory" authors = [ @@ -28,4 +28,4 @@ dev-dependencies = [] allow-direct-references = true [tool.hatch.build.targets.wheel] -packages = ["src/lib9c_python"] +packages = ["src/lib9c"] diff --git a/integrations/python/src/lib9c/__init__.py b/integrations/python/src/lib9c/__init__.py new file mode 100644 index 0000000000..dcfbc7ae6a --- /dev/null +++ b/integrations/python/src/lib9c/__init__.py @@ -0,0 +1,2 @@ +def hello() -> str: + return "Hello from lib9c!" diff --git a/integrations/python/src/lib9c_python/__init__.py b/integrations/python/src/lib9c_python/__init__.py deleted file mode 100644 index b111663ef5..0000000000 --- a/integrations/python/src/lib9c_python/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -def hello() -> str: - return "Hello from lib9c_python!"