Skip to content

Commit 80f4d6d

Browse files
authored
chore: migrate to poetry (#27)
1 parent 63dd4c5 commit 80f4d6d

16 files changed

+1444
-103
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Set up poetry
2+
description: Install poetry and python dependencies
3+
runs:
4+
using: "composite"
5+
steps:
6+
- uses: snok/install-poetry@v1
7+
with:
8+
version: 1.3.2
9+
virtualenvs-create: true
10+
virtualenvs-in-project: true
11+
12+
- name: Cache poetry dependencies
13+
id: cache-poetry-deps
14+
uses: actions/cache@v3
15+
with:
16+
path: .venv
17+
key: pydeps-${{ hashFiles('**/poetry.lock') }}
18+
19+
- name: Install poetry dependencies
20+
shell: bash
21+
run: poetry install --no-interaction --no-root --with=dev
22+
if: steps.cache-deps.outputs.cache-hit != 'true'
23+
24+
- name: Install scw_serverless
25+
shell: bash
26+
run: poetry install --no-interaction
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Set up Serverless Framework
2+
description: Install Serverless Framework & Scaleway Plugin
3+
runs:
4+
using: "composite"
5+
steps:
6+
- uses: actions/cache@v3
7+
id: npm-cache
8+
with:
9+
path: ~/.npm
10+
key: ${{ runner.os }}-build-${{ env.cache-name }}
11+
12+
- name: Install npm dependencies
13+
shell: bash
14+
run: npm install -g serverless serverless-scaleway-functions

.github/workflows/black.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/workflows/pytest-integration.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,19 @@ jobs:
1515
container: nikolaik/python-nodejs:python3.10-nodejs18
1616
steps:
1717
- uses: actions/checkout@v3
18-
- name: Setup terraform
18+
19+
- name: Install terraform
1920
uses: hashicorp/setup-terraform@v2
2021
with:
2122
terraform_wrapper: false
22-
- name: Install dependencies
23-
run: |
24-
pip install --editable .
25-
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
26-
npm install -g serverless serverless-scaleway-functions
23+
24+
- uses: ./.github/actions/setup-serverless-framework
25+
26+
- uses: ./.github/actions/setup-poetry
27+
2728
- name: Test with pytest
2829
working-directory: tests
29-
run: pytest integrations -n $(nproc --all)
30+
run: poetry run pytest integrations -n $(nproc --all)
3031
env:
3132
SCW_DEFAULT_ORGANIZATION_ID: ${{ secrets.SCW_DEFAULT_ORGANIZATION_ID }}
3233
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }}

.github/workflows/pytest.yml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,9 @@ jobs:
1515
container: nikolaik/python-nodejs:python3.10-nodejs18
1616
steps:
1717
- uses: actions/checkout@v3
18-
- name: Setup terraform
19-
uses: hashicorp/setup-terraform@v2
20-
with:
21-
terraform_wrapper: false
22-
- name: Install dependencies
23-
run: |
24-
pip install --editable .
25-
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
26-
npm install -g serverless serverless-scaleway-functions
18+
19+
- uses: ./.github/actions/setup-poetry
20+
2721
- name: Test with pytest
2822
working-directory: tests
29-
run: pytest -s --ignore=integrations
30-
env:
31-
SCW_DEFAULT_ORGANIZATION_ID: ${{ secrets.SCW_DEFAULT_ORGANIZATION_ID }}
32-
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }}
33-
SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY }}
23+
run: poetry run pytest -s --ignore=integrations

.github/workflows/python-publish.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@ jobs:
2121
container: python:3.10-alpine3.16
2222
steps:
2323
- uses: actions/checkout@v3
24-
- name: Install dependencies
25-
run: |
26-
python -m pip install --upgrade pip
27-
pip install build
28-
- name: Build package
29-
run: python -m build
30-
- name: Publish package
31-
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
24+
25+
- uses: snok/install-poetry@v1
3226
with:
33-
user: __token__
34-
password: ${{ secrets.PYPI_API_TOKEN }}
27+
version: 1.3.2
28+
virtualenvs-create: true
29+
virtualenvs-in-project: true
30+
31+
- name: Publish package
32+
run: poetry publish --build
33+
env:
34+
POETRY_HTTP_BASIC_PYPI_USERNAME: __token__
35+
POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}

.pre-commit-config.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,3 @@ repos:
4444
hooks:
4545
- id: python-bandit-vulnerability-check
4646
args: [--skip, "B101", --recursive, clumper]
47-
- repo: https://github.com/regebro/pyroma
48-
rev: "4.1"
49-
hooks:
50-
- id: pyroma

docs/Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,3 @@ help:
1818
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
1919
%: Makefile
2020
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
21-
22-
livehtml:
23-
sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/requirements.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)