From 2512abdd17b6b0633302671c699bb878a894a3d5 Mon Sep 17 00:00:00 2001 From: jo Date: Sat, 2 Mar 2024 12:37:15 +0100 Subject: [PATCH 1/2] chore: ensure poetry install in .venv --- Makefile | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 3443e74..3c8f67f 100644 --- a/Makefile +++ b/Makefile @@ -8,31 +8,29 @@ all: install format lint test install-poetry: curl -sSL https://install.python-poetry.org | python3 - -POETRY_VIRTUALENVS_IN_PROJECT = true +export POETRY_VIRTUALENVS_IN_PROJECT = true -INSTALL_STAMP := .installed -install: $(INSTALL_STAMP) -$(INSTALL_STAMP): +install: .venv +.venv: poetry install - touch $(INSTALL_STAMP) -format: install +format: .venv poetry run black . poetry run isort --profile black . -lint: install +lint: .venv poetry run black . --diff --check poetry run pylint gh_release_install tests poetry run mypy gh_release_install tests -test: install +test: .venv poetry run pytest -n $(CPU_CORES) --color=yes -v --cov=gh_release_install tests -e2e: install +e2e: .venv poetry run pytest -n $(CPU_CORES) --color=yes -v --cov=gh_release_install e2e -examples: install +examples: .venv poetry run ./examples.sh -ci-publish: install +ci-publish: .venv poetry publish --no-interaction --build From cc06dfbc34f46bcd66d8c5dc9ac60e538c2498e3 Mon Sep 17 00:00:00 2001 From: jo Date: Sat, 2 Mar 2024 12:41:33 +0100 Subject: [PATCH 2/2] chore: update pre-commit setup --- .github/workflows/actions/python/action.yml | 5 ++--- .github/workflows/ci.yml | 2 ++ .pre-commit-config.yaml | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/actions/python/action.yml b/.github/workflows/actions/python/action.yml index c57887f..4b45982 100644 --- a/.github/workflows/actions/python/action.yml +++ b/.github/workflows/actions/python/action.yml @@ -12,9 +12,8 @@ runs: with: python-version: ${{ inputs.python-version }} - - uses: snok/install-poetry@v1 - with: - virtualenvs-in-project: true + - run: pipx install poetry + shell: bash - uses: actions/cache@v4 with: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a006a1c..eeb358f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,8 @@ jobs: with: python-version: "3.10" + - run: make install + - uses: pre-commit/action@v3.0.1 - uses: pre-commit-ci/lite-action@v1.0.2 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8ea3f88..d87db13 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -50,7 +50,7 @@ repos: - id: format name: Format code description: Format code - entry: bash -c '[[ "$CI" != "true" ]] && make format || true' + entry: make format language: system pass_filenames: false always_run: true @@ -58,7 +58,7 @@ repos: - id: lint name: Lint code description: Lint code - entry: bash -c '[[ "$CI" != "true" ]] && make lint || true' + entry: make lint language: system pass_filenames: false always_run: true