Skip to content

Commit

Permalink
Add poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
dragomirp committed Aug 26, 2024
1 parent 1ae029f commit 837bfb0
Show file tree
Hide file tree
Showing 6 changed files with 242 additions and 30 deletions.
5 changes: 5 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>canonical/data-platform//renovate_presets/charm.json5"],
"reviewers": ["team:data-platform-postgresql"],
}
15 changes: 1 addition & 14 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,8 @@ on:
pull_request:

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install tox
run: pipx install tox
- name: Run linters
run: tox run -e lint

build:
name: Build snap
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
uses: canonical/data-platform-workflows/.github/workflows/[email protected]

smoke:
name: Smoke test snap
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:
push:
branches:
- 14/edge
paths:
- snap

jobs:
build:
Expand Down
192 changes: 192 additions & 0 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2024 Canonical Ltd.
# See LICENSE file for licensing details.

[tool.poetry]
package-mode = false

[tool.poetry.dependencies]
python = "^3.10"

[tool.poetry.group.format]
optional = true

[tool.poetry.group.format.dependencies]

[tool.poetry.group.lint]
optional = true

[tool.poetry.group.lint.dependencies]
yamllint = "^1.35.1"

[tool.poetry.group.unit]
optional = true

[tool.poetry.group.unit.dependencies]
pytest = "^8.3.2"
pyyaml = "^6.0.2"
32 changes: 16 additions & 16 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
[tox]
requires =
tox>=4
env_list = lint
no_package = True
env_list = lint,smoke

[testenv]
setenv =
version=14.0
channel=14.0/edge
vm-repo=https://github.com/canonical/postgresql-operator.git
allowlist_externals =
poetry

[testenv:lint]
description = run linters
skip_install = true
deps =
yamllint
commands =
yamllint --no-warnings ./snap/
description = Check code against coding style standards
allowlist_externals =
{[testenv]allowlist_externals}
find
commands_pre =
poetry install --only lint,format --no-root
commands =
poetry check --lock
poetry run yamllint --no-warnings ./snap/

[testenv:smoke]
description = smoke test for snap
skip_install = true
deps =
pytest
pyyaml
allowlist_externals =
pytest
commands_pre =
poetry install --only unit --no-root
commands =
pytest -vv --no-header --tb native --log-cli-level=INFO tests/test_smoke.py -s
poetry run pytest -vv --no-header --tb native --log-cli-level=INFO tests/test_smoke.py -s

0 comments on commit 837bfb0

Please sign in to comment.