From 6d954db27556e15320b20226a49241e5ae184648 Mon Sep 17 00:00:00 2001 From: Arisu Tachibana Date: Wed, 11 Sep 2024 19:28:35 +0900 Subject: [PATCH] github/poetry: Add poetry action Signed-off-by: Arisu Tachibana --- .github/workflows/black.yml | 12 ------------ .github/workflows/poetry.yml | 28 ++++++++++++++++++++++++++++ pyproject.toml | 2 +- 3 files changed, 29 insertions(+), 13 deletions(-) delete mode 100644 .github/workflows/black.yml create mode 100644 .github/workflows/poetry.yml diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml deleted file mode 100644 index 042c856..0000000 --- a/.github/workflows/black.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Lint - -on: [push, pull_request] - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: psf/black@stable - with: - options: "--check --verbose" diff --git a/.github/workflows/poetry.yml b/.github/workflows/poetry.yml new file mode 100644 index 0000000..376f4ef --- /dev/null +++ b/.github/workflows/poetry.yml @@ -0,0 +1,28 @@ +name: Poetry + +on: [push, pull_request] + +jobs: + ci: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Python + uses: actions/setup-python@v4 + # see details (matrix, python-version, python-version-file, etc.) + # https://github.com/actions/setup-python + - name: Install poetry + uses: abatilo/actions-poetry@v2 + - name: Setup a local virtual environment (if no poetry.toml file) + run: | + poetry config virtualenvs.create true --local + poetry config virtualenvs.in-project true --local + - uses: actions/cache@v3 + name: Define a cache for the virtual environment based on the dependencies lock file + with: + path: ./.venv + key: venv-${{ hashFiles('poetry.lock') }} + - name: Install the project dependencies + run: poetry install + - name: Run the automated tests (for example) + run: poetry run black --check --verbose . diff --git a/pyproject.toml b/pyproject.toml index 29d63a4..26dc382 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,7 @@ classifiers = [ ] [tool.poetry.dependencies] -python = "^3.12" +python = "^3.10" click = "^8.1.7" requests = "^2.32.3" toml = "^0.10.2"