diff --git a/.github/workflows/main-workflow.yaml b/.github/workflows/main-workflow.yaml index 9eaa47e..5e16c97 100644 --- a/.github/workflows/main-workflow.yaml +++ b/.github/workflows/main-workflow.yaml @@ -25,19 +25,19 @@ jobs: uses: actions/setup-python@v4 with: python-version: 3.11 - - - name: Install & configure poetry - run: | - python -m pip install poetry==1.7.1 - python -m poetry config virtualenvs.in-project true + + - name: Configure Poetry + uses: snok/install-poetry@v1 + with: + version: 1.7.1 + virtualenvs-create: true + virtualenvs-in-project: true - name: Cache poetry virtualenv uses: actions/cache@v4 with: path: ./.venv key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }} - restore-keys: | - ${{ runner.os }}-venv- - name: Install poetry dependencies run: | @@ -52,7 +52,6 @@ jobs: . !.git !.github - !.venv !node_modules verify: needs: setup @@ -69,30 +68,28 @@ jobs: uses: actions/download-artifact@v4 with: name: workspace - + - name: Set up python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.11 - - - name: Install & configure poetry - run: | - python -m pip install poetry==1.7.1 - python -m poetry config virtualenvs.in-project true - - - name: Cache poetry virtualenv + + - name: Configure Poetry + uses: snok/install-poetry@v1 + with: + version: 1.7.1 + virtualenvs-create: true + virtualenvs-in-project: true + + - name: Cache virtualenv uses: actions/cache@v4 with: path: ./.venv key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }} - restore-keys: | - ${{ runner.os }}-venv- - - - name: Install dependencies - run: python -m poetry install - + - name: Run ${{ matrix.task }} - run: python -m poetry run ${{ matrix.command }} + run: | + poetry run ${{ matrix.command }} test: needs: setup @@ -112,13 +109,18 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Install & configure poetry - run: | - python -m pip install poetry==1.7.1 - python -m poetry config virtualenvs.in-project true + - name: Configure Poetry + uses: snok/install-poetry@v1 + with: + version: 1.7.1 + virtualenvs-create: true + virtualenvs-in-project: true - - name: Install dependencies - run: python -m poetry install + - name: Cache virtualenv + uses: actions/cache@v4 + with: + path: ./.venv + key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }} - name: Run tests run: python -m poetry run make test @@ -159,11 +161,13 @@ jobs: with: python-version: 3.11 - - name: Install poetry + - name: Configure Poetry if: steps.release.outputs.released == 'true' - run: | - python -m pip install poetry==1.7.1 - python -m poetry config virtualenvs.in-project true + uses: snok/install-poetry@v1 + with: + version: 1.7.1 + virtualenvs-create: true + virtualenvs-in-project: true - name: Configure poetry credentials if: steps.release.outputs.released == 'true' diff --git a/.github/workflows/pull-request-workflow.yaml b/.github/workflows/pull-request-workflow.yaml index 7473c02..34d67f3 100644 --- a/.github/workflows/pull-request-workflow.yaml +++ b/.github/workflows/pull-request-workflow.yaml @@ -19,20 +19,22 @@ jobs: with: python-version: 3.11 - - name: Install & configure poetry - run: | - python -m pip install poetry==1.7.1 - python -m poetry config virtualenvs.in-project true + - name: Configure Poetry + uses: snok/install-poetry@v1 + with: + version: 1.7.1 + virtualenvs-create: true + virtualenvs-in-project: true - - name: Cache poetry virtualenv + - name: Cache virtualenv uses: actions/cache@v4 with: path: ./.venv key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }} - - name: Install poetry dependencies + - name: Install dependencies run: | - python -m poetry install + poetry install - name: Upload workspace uses: actions/upload-artifact@v4 @@ -43,8 +45,8 @@ jobs: . !.git !.github - !.venv !node_modules + !.venv verify: needs: setup @@ -67,23 +69,22 @@ jobs: with: python-version: 3.11 - - name: Install & configure poetry - run: | - python -m pip install poetry==1.7.1 - python -m poetry config virtualenvs.in-project true + - name: Configure Poetry + uses: snok/install-poetry@v1 + with: + version: 1.7.1 + virtualenvs-create: true + virtualenvs-in-project: true - - name: Cache poetry virtualenv + - name: Cache virtualenv uses: actions/cache@v4 with: path: ./.venv key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }} - - name: Install dependencies - run: python -m poetry install - - name: Run ${{ matrix.task }} - run: python -m poetry run ${{ matrix.command }} - timeout-minutes: 5 + run: | + poetry run ${{ matrix.command }} test: needs: setup @@ -102,17 +103,22 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + + - name: Configure Poetry + uses: snok/install-poetry@v1 + with: + version: 1.7.1 + virtualenvs-create: true + virtualenvs-in-project: true - - name: Install & configure poetry - run: | - python -m pip install poetry==1.7.1 - python -m poetry config virtualenvs.in-project true - - - name: Install dependencies - run: python -m poetry install + - name: Cache virtualenv + uses: actions/cache@v4 + with: + path: ./.venv + key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }} - name: Run tests - run: python -m poetry run make test + run: poetry run make test timeout-minutes: 5 semantic-release-dry-run: diff --git a/Makefile b/Makefile index e7cace9..11beb2b 100644 --- a/Makefile +++ b/Makefile @@ -8,10 +8,10 @@ generate: clean python scripts/generate_schemas.py test: - pytest + python -m pytest lint: - flake8 --statistics + python -m flake8 --statistics fix: black --line-length 120 . diff --git a/pyproject.toml b/pyproject.toml index cf058b9..44816bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,6 @@ pydantic = "^2.10" python-dateutil = "^2.9" requests = "^2.32" - [tool.poetry.group.dev.dependencies] openapi-generator-cli = "^7.10.0.post0" pytest = "^8.3.4"