From 49c367ed8c1d462e09789d4076e2b964cbf1b465 Mon Sep 17 00:00:00 2001 From: Pavel Sobolev Date: Wed, 12 Jun 2024 12:12:00 +0300 Subject: [PATCH] Add a sample Python package for backend. --- .gitignore | 6 ++--- backend/.gitignore | 5 ++++ backend/pyproject.toml | 22 +++++++++++++++ backend/requirements-dev.txt | 49 ++++++++++++++++++++++++++++++++++ backend/requirements.txt | 30 +++++++++++++++++++++ backend/src/flowey/__init__.py | 2 ++ backend/src/flowey/__main__.py | 3 +++ flake.nix | 2 ++ frontend/.gitignore | 4 +-- 9 files changed, 118 insertions(+), 5 deletions(-) create mode 100644 backend/.gitignore create mode 100644 backend/pyproject.toml create mode 100644 backend/requirements-dev.txt create mode 100644 backend/requirements.txt create mode 100644 backend/src/flowey/__init__.py create mode 100644 backend/src/flowey/__main__.py diff --git a/.gitignore b/.gitignore index 7bd3ab4..e18fba8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -.direnv -.idea -.vscode +/.direnv/ +/.idea/ +/.vscode/ diff --git a/backend/.gitignore b/backend/.gitignore new file mode 100644 index 0000000..5c9d57a --- /dev/null +++ b/backend/.gitignore @@ -0,0 +1,5 @@ +/**/*.egg-info/ +/**/__pycache__/ +/.venv/ +/build/ +/dist/ diff --git a/backend/pyproject.toml b/backend/pyproject.toml new file mode 100644 index 0000000..34ddf59 --- /dev/null +++ b/backend/pyproject.toml @@ -0,0 +1,22 @@ +[build-system] +build-backend = "setuptools.build_meta" +requires = ["build==1.2.1", "setuptools==70.0.0"] + +[project] +name = "flowey" +version = "0.1.0" +requires-python = "==3.12.3" +dependencies = [] + +[project.optional-dependencies] +dev = ["pip-tools==7.4.1"] + +[project.scripts] +flowey = "flowey:main" + +[tool.pip-tools] +all-build-deps = true +allow-unsafe = true +annotation-style = "split" +generate-hashes = true +strip-extras = true diff --git a/backend/requirements-dev.txt b/backend/requirements-dev.txt new file mode 100644 index 0000000..70dddb7 --- /dev/null +++ b/backend/requirements-dev.txt @@ -0,0 +1,49 @@ +# +# This file is autogenerated by pip-compile with Python 3.12 +# by the following command: +# +# pip-compile --all-build-deps --allow-unsafe --extra=dev --generate-hashes --output-file=requirements-dev.txt --strip-extras +# +build==1.2.1 \ + --hash=sha256:526263f4870c26f26c433545579475377b2b7588b6f1eac76a001e873ae3e19d \ + --hash=sha256:75e10f767a433d9a86e50d83f418e83efc18ede923ee5ff7df93b6cb0306c5d4 + # via + # flowey (pyproject.toml::build-system.requires) + # pip-tools +click==8.1.7 \ + --hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \ + --hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de + # via pip-tools +packaging==24.1 \ + --hash=sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002 \ + --hash=sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124 + # via build +pip-tools==7.4.1 \ + --hash=sha256:4c690e5fbae2f21e87843e89c26191f0d9454f362d8acdbd695716493ec8b3a9 \ + --hash=sha256:864826f5073864450e24dbeeb85ce3920cdfb09848a3d69ebf537b521f14bcc9 + # via flowey (pyproject.toml) +pyproject-hooks==1.1.0 \ + --hash=sha256:4b37730834edbd6bd37f26ece6b44802fb1c1ee2ece0e54ddff8bfc06db86965 \ + --hash=sha256:7ceeefe9aec63a1064c18d939bdc3adf2d8aa1988a510afec15151578b232aa2 + # via + # build + # pip-tools +wheel==0.43.0 \ + --hash=sha256:465ef92c69fa5c5da2d1cf8ac40559a8c940886afcef87dcf14b9470862f1d85 \ + --hash=sha256:55c570405f142630c6b9f72fe09d9b67cf1477fcf543ae5b8dcb1f5b7377da81 + # via + # flowey (pyproject.toml::build-system.backend::editable) + # flowey (pyproject.toml::build-system.backend::wheel) + # pip-tools + +# The following packages are considered to be unsafe in a requirements file: +pip==24.0 \ + --hash=sha256:ba0d021a166865d2265246961bec0152ff124de910c5cc39f1156ce3fa7c69dc \ + --hash=sha256:ea9bd1a847e8c5774a5777bb398c19e80bcd4e2aa16a4b301b718fe6f593aba2 + # via pip-tools +setuptools==70.0.0 \ + --hash=sha256:54faa7f2e8d2d11bcd2c07bed282eef1046b5c080d1c32add737d7b5817b1ad4 \ + --hash=sha256:f211a66637b8fa059bb28183da127d4e86396c991a942b028c6650d4319c3fd0 + # via + # flowey (pyproject.toml::build-system.requires) + # pip-tools diff --git a/backend/requirements.txt b/backend/requirements.txt new file mode 100644 index 0000000..d487d6d --- /dev/null +++ b/backend/requirements.txt @@ -0,0 +1,30 @@ +# +# This file is autogenerated by pip-compile with Python 3.12 +# by the following command: +# +# pip-compile --all-build-deps --allow-unsafe --generate-hashes --strip-extras +# +build==1.2.1 \ + --hash=sha256:526263f4870c26f26c433545579475377b2b7588b6f1eac76a001e873ae3e19d \ + --hash=sha256:75e10f767a433d9a86e50d83f418e83efc18ede923ee5ff7df93b6cb0306c5d4 + # via flowey (pyproject.toml::build-system.requires) +packaging==24.1 \ + --hash=sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002 \ + --hash=sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124 + # via build +pyproject-hooks==1.1.0 \ + --hash=sha256:4b37730834edbd6bd37f26ece6b44802fb1c1ee2ece0e54ddff8bfc06db86965 \ + --hash=sha256:7ceeefe9aec63a1064c18d939bdc3adf2d8aa1988a510afec15151578b232aa2 + # via build +wheel==0.43.0 \ + --hash=sha256:465ef92c69fa5c5da2d1cf8ac40559a8c940886afcef87dcf14b9470862f1d85 \ + --hash=sha256:55c570405f142630c6b9f72fe09d9b67cf1477fcf543ae5b8dcb1f5b7377da81 + # via + # flowey (pyproject.toml::build-system.backend::editable) + # flowey (pyproject.toml::build-system.backend::wheel) + +# The following packages are considered to be unsafe in a requirements file: +setuptools==70.0.0 \ + --hash=sha256:54faa7f2e8d2d11bcd2c07bed282eef1046b5c080d1c32add737d7b5817b1ad4 \ + --hash=sha256:f211a66637b8fa059bb28183da127d4e86396c991a942b028c6650d4319c3fd0 + # via flowey (pyproject.toml::build-system.requires) diff --git a/backend/src/flowey/__init__.py b/backend/src/flowey/__init__.py new file mode 100644 index 0000000..b74c6e1 --- /dev/null +++ b/backend/src/flowey/__init__.py @@ -0,0 +1,2 @@ +def main(): + print("Hello there!") diff --git a/backend/src/flowey/__main__.py b/backend/src/flowey/__main__.py new file mode 100644 index 0000000..8273c4f --- /dev/null +++ b/backend/src/flowey/__main__.py @@ -0,0 +1,3 @@ +from . import main + +main() diff --git a/flake.nix b/flake.nix index 059c99d..c9fbe28 100644 --- a/flake.nix +++ b/flake.nix @@ -20,6 +20,8 @@ nixfmt-rfc-style nodejs_latest + + python312 ]; }; } diff --git a/frontend/.gitignore b/frontend/.gitignore index c925c21..3d2bc62 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -1,2 +1,2 @@ -/dist -/node_modules +/dist/ +/node_modules/