From 7c06c274a6f891f580f81f74d4d3787003e56cb0 Mon Sep 17 00:00:00 2001 From: FujisakiEx <111629523+FujisakiEx@users.noreply.github.com> Date: Sat, 8 Jul 2023 17:42:32 +0900 Subject: [PATCH 1/2] update precommit --- .pre-commit-config.yaml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d26cdeb92..9697c822a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,3 +10,35 @@ repos: types: [file, python] stages: [push] pass_filenames: false + - id: poetry-export + name: poetry-export + entry: poetry export --without-hashes -o requirements.txt + language: python + stages: [commit] + pass_filenames: false + - id: poetry-export-dev + name: poetry-export-dev + entry: poetry export --without-hashes --with dev -o requirements-dev.txt + language: python + stages: [commit] + pass_filenames: false + - id: poetry-export-test + name: poetry-export-test + entry: poetry export --without-hashes --with test -o requirements-test.txt + language: python + stages: [commit] + pass_filenames: false + - id: poetry-export-license + name: poetry-export-license + entry: poetry export --without-hashes --with license -o requirements-license.txt + language: python + stages: [commit] + pass_filenames: false + +# - repo: https://github.com/python-poetry/poetry +# rev: '1.3.1' +# hooks: +# - id: poetry-check +# - id: poetry-lock +# - id: poetry-export +# args: ["--without-hashes", "-o", "requirements.txt" ] From 9b929fd479c37581c2049afa1c08bb462b4e41e8 Mon Sep 17 00:00:00 2001 From: FujisakiEx <111629523+FujisakiEx@users.noreply.github.com> Date: Sat, 8 Jul 2023 18:18:59 +0900 Subject: [PATCH 2/2] update github actions --- .github/workflows/test.yml | 17 ++++++++++- .pre-commit-config.yaml | 58 ++++++++++++++++++-------------------- 2 files changed, 44 insertions(+), 31 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b32dd4677..99cd54ba1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,8 @@ name: test +env: + POETRY_VERSION: '1.3.1' + on: push: pull_request: @@ -26,12 +29,24 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} - cache: pip + cache: poetry + + - name: Install poetry + run: pip3 install poetry - name: Install libraries for ubuntu if: matrix.os == 'ubuntu-20.04' run: sudo apt-get install libsndfile1 + - name: Check poetry + uses: pre-commit-ci/lite-action@v1.0.1 + if: always() + run: | + poetry export --without-hashes -o requirements.txt + poetry export --without-hashes --with dev -o requirements-dev.txt + poetry export --without-hashes --with test -o requirements-test.txt + poetry export --without-hashes --with license -o requirements-license.txt + - name: Install dependencies run: | python -m pip install --upgrade pip setuptools wheel diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9697c822a..eaddcdcb2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,35 +10,33 @@ repos: types: [file, python] stages: [push] pass_filenames: false + - repo: https://github.com/python-poetry/poetry + rev: '1.3.1' + hooks: - id: poetry-export - name: poetry-export - entry: poetry export --without-hashes -o requirements.txt - language: python - stages: [commit] - pass_filenames: false - - id: poetry-export-dev - name: poetry-export-dev - entry: poetry export --without-hashes --with dev -o requirements-dev.txt - language: python - stages: [commit] - pass_filenames: false - - id: poetry-export-test - name: poetry-export-test - entry: poetry export --without-hashes --with test -o requirements-test.txt - language: python - stages: [commit] - pass_filenames: false - - id: poetry-export-license - name: poetry-export-license - entry: poetry export --without-hashes --with license -o requirements-license.txt - language: python - stages: [commit] - pass_filenames: false - -# - repo: https://github.com/python-poetry/poetry -# rev: '1.3.1' -# hooks: -# - id: poetry-check -# - id: poetry-lock + args: ["--without-hashes", "-o", "requirements.txt" ] # - id: poetry-export -# args: ["--without-hashes", "-o", "requirements.txt" ] +# name: poetry-export +# entry: poetry export --without-hashes -o requirements.txt +# language: python +# stages: [commit] +# pass_filenames: false +# - id: poetry-export-dev +# name: poetry-export-dev +# entry: poetry export --without-hashes --with dev -o requirements-dev.txt +# language: python +# stages: [commit] +# pass_filenames: false +# - id: poetry-export-test +# name: poetry-export-test +# entry: poetry export --without-hashes --with test -o requirements-test.txt +# language: python +# stages: [commit] +# pass_filenames: false +# - id: poetry-export-license +# name: poetry-export-license +# entry: poetry export --without-hashes --with license -o requirements-license.txt +# language: python +# stages: [commit] +# pass_filenames: false +#