From b9ad4a0c4883321f481190747c56957b42324f8d Mon Sep 17 00:00:00 2001 From: Ryo <36154873+RyoJerryYu@users.noreply.github.com> Date: Fri, 7 Jun 2024 01:36:50 +0800 Subject: [PATCH] feat: use pyproject --- .github/workflows/release.yaml | 2 +- .github/workflows/test_ci.yaml | 2 +- pyproject.toml | 30 ++++++++++++++++++++++++++++++ requirements-dev.txt | 1 + requirements-test.txt | 0 5 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 pyproject.toml create mode 100644 requirements-dev.txt delete mode 100644 requirements-test.txt diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 206ac78..078aa33 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -25,7 +25,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt - pip install -r requirements-test.txt + pip install -r requirements-dev.txt - name: Run tests run: make test diff --git a/.github/workflows/test_ci.yaml b/.github/workflows/test_ci.yaml index aee439e..ca8c7d7 100644 --- a/.github/workflows/test_ci.yaml +++ b/.github/workflows/test_ci.yaml @@ -25,7 +25,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt - pip install -r requirements-test.txt + pip install -r requirements-dev.txt - name: Run tests run: make test diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..0fcdd76 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,30 @@ +[project] +name = "memos_webhook" +version = "0.1.1" +authors = [{ name = "RyoJerryYu" }] +description = "A webhook server for memos" +readme = "README.md" +license = { file = "LICENSE" } +requires-python = ">=3.12" +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", +] +dynamic = ["dependencies", "optional-dependencies"] + +[project.urls] +Homepage = "https://github.com/RyoJerryYu/memos-webhook-py" +Issues = "https://github.com/RyoJerryYu/memos-webhook-py/issues" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.setuptools.dynamic] +optional-dependencies = { dev = { file = ["requirements-dev.txt"] } } +dependencies = { file = ["requirements.txt"] } + +[tool.setuptools.packages.find] +where = ["."] +include = ["proto*", "src*"] +exclude = ["*_test.py"] diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..e18fc81 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1 @@ +betterproto[compiler] \ No newline at end of file diff --git a/requirements-test.txt b/requirements-test.txt deleted file mode 100644 index e69de29..0000000