Skip to content

Commit

Permalink
Lock file maintenance (canonical#283)
Browse files Browse the repository at this point in the history
* Lock file maintenance

* Tweak renovate

* Pin python version

* Ignore renovate conf

* Poetry warning

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Dragomir Penev <[email protected]>
  • Loading branch information
renovate[bot] and dragomirp authored Nov 16, 2023
1 parent 7b539f4 commit ff7f9b9
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 92 deletions.
7 changes: 7 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
"reviewers": ["dragomirp", "marceloneppel", "taurus-forever"],
"packageRules": [
// Later rules override earlier rules
{
"matchPackageNames": ["pydantic"],
"allowedVersions": "<2.0.0"
}, {
"matchPackageNames": ["python"],
"allowedVersions": "<3.11"
}
],
"regexManagers": [
{
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- '.jujuignore'
- 'LICENSE'
- '**.md'
- 'renovate.json'
- .github/renovate.json5
schedule:
- cron: '53 0 * * *' # Daily at 00:53 UTC
# Triggered on push to branch "main" by .github/workflows/release.yaml
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ on:
paths-ignore:
- 'tests/**'
- 'docs/**'
- renovate.json
- poetry.lock
- .github/renovate.json5
- pyproject.toml
- '.github/workflows/ci.yaml'
- '.github/workflows/lib-check.yaml'
Expand Down
116 changes: 47 additions & 69 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ homepage = "https://charmhub.io/postgresql"
repository = "https://github.com/canonical/postgresql-operator"

[tool.poetry.dependencies]
python = "^3.10.6"
python = "^3.10"
ops = "^2.8.0"
cryptography = "^41.0.5"
boto3 = "^1.28.70"
Expand Down
2 changes: 1 addition & 1 deletion src/backups.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def _are_backup_settings_ok(self) -> Tuple[bool, Optional[str]]:
"Relation with s3-integrator charm missing, cannot create/restore backup.",
)

s3_parameters, missing_parameters = self._retrieve_s3_parameters()
_, missing_parameters = self._retrieve_s3_parameters()
if missing_parameters:
return False, f"Missing S3 parameters: {missing_parameters}"

Expand Down
2 changes: 1 addition & 1 deletion src/relations/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def set_up_relation(self, relation: Relation) -> bool:
"""Set up the relation to be used by the application charm."""
# Do not allow apps requesting extensions to be installed
# (let them now about config options).
required_extensions, disabled_extensions = self._get_extensions(relation)
_, disabled_extensions = self._get_extensions(relation)
if disabled_extensions:
logger.error(
f"ERROR - `extensions` ({', '.join(disabled_extensions)}) cannot be requested through relations"
Expand Down
34 changes: 17 additions & 17 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ commands_post =
[testenv:format]
description = Apply coding style standards to code
commands_pre =
poetry install --only format
poetry install --only format --no-root
commands =
poetry lock --no-update
poetry run ruff --fix {[vars]all_path}
Expand All @@ -45,7 +45,7 @@ allowlist_externals =
{[testenv]allowlist_externals}
find
commands_pre =
poetry install --only lint,format
poetry install --only lint,format --no-root
commands =
poetry check --lock
poetry run codespell {[vars]all_path}
Expand All @@ -58,7 +58,7 @@ description = Run unit tests
set_env =
{[testenv]set_env}
commands_pre =
poetry install --only main,charm-libs,unit
poetry install --only main,charm-libs,unit --no-root
commands =
poetry run coverage run --source={[vars]src_path} \
-m pytest -v --tb native -s {posargs} {[vars]tests_path}/unit
Expand All @@ -77,7 +77,7 @@ pass_env =
allowlist_externals =
{[testenv:pack-wrapper]allowlist_externals}
commands_pre =
poetry install --only integration
poetry install --only integration --no-root
{[testenv:pack-wrapper]commands_pre}
commands =
poetry run pytest -v --tb native --log-cli-level=INFO -s {posargs} {[vars]tests_path}/integration/test_backups.py
Expand All @@ -96,7 +96,7 @@ pass_env =
allowlist_externals =
{[testenv:pack-wrapper]allowlist_externals}
commands_pre =
poetry install --only integration
poetry install --only integration --no-root
{[testenv:pack-wrapper]commands_pre}
commands =
poetry run pytest -v --tb native --log-cli-level=INFO -s {posargs} {[vars]tests_path}/integration/test_charm.py
Expand All @@ -115,7 +115,7 @@ pass_env =
allowlist_externals =
{[testenv:pack-wrapper]allowlist_externals}
commands_pre =
poetry install --only integration
poetry install --only integration --no-root
{[testenv:pack-wrapper]commands_pre}
commands =
poetry run pytest -v --tb native --log-cli-level=INFO -s {posargs} {[vars]tests_path}/integration/new_relations/test_new_relations.py
Expand All @@ -134,7 +134,7 @@ pass_env =
allowlist_externals =
{[testenv:pack-wrapper]allowlist_externals}
commands_pre =
poetry install --only integration
poetry install --only integration --no-root
{[testenv:pack-wrapper]commands_pre}
commands =
poetry run pytest -v --tb native --log-cli-level=INFO -s {posargs} {[vars]tests_path}/integration/test_db.py
Expand All @@ -153,7 +153,7 @@ pass_env =
allowlist_externals =
{[testenv:pack-wrapper]allowlist_externals}
commands_pre =
poetry install --only integration
poetry install --only integration --no-root
{[testenv:pack-wrapper]commands_pre}
commands =
poetry run pytest -v --tb native --log-cli-level=INFO -s {posargs} {[vars]tests_path}/integration/test_db_admin.py
Expand All @@ -172,7 +172,7 @@ pass_env =
allowlist_externals =
{[testenv:pack-wrapper]allowlist_externals}
commands_pre =
poetry install --only integration
poetry install --only integration --no-root
{[testenv:pack-wrapper]commands_pre}
commands =
poetry run pytest -v --tb native --log-cli-level=INFO -s {posargs} {[vars]tests_path}/integration/ha_tests/test_replication.py
Expand All @@ -191,7 +191,7 @@ pass_env =
allowlist_externals =
{[testenv:pack-wrapper]allowlist_externals}
commands_pre =
poetry install --only integration
poetry install --only integration --no-root
{[testenv:pack-wrapper]commands_pre}
commands =
poetry run pytest -v --tb native --log-cli-level=INFO -s {posargs} {[vars]tests_path}/integration/ha_tests/test_self_healing.py
Expand All @@ -210,7 +210,7 @@ pass_env =
allowlist_externals =
{[testenv:pack-wrapper]allowlist_externals}
commands_pre =
poetry install --only integration
poetry install --only integration --no-root
{[testenv:pack-wrapper]commands_pre}
commands =
poetry run pytest -v --tb native --log-cli-level=INFO -s {posargs} {[vars]tests_path}/integration/ha_tests/test_restore_cluster.py
Expand All @@ -229,7 +229,7 @@ pass_env =
allowlist_externals =
{[testenv:pack-wrapper]allowlist_externals}
commands_pre =
poetry install --only integration
poetry install --only integration --no-root
{[testenv:pack-wrapper]commands_pre}
commands =
poetry run pytest -v --tb native --log-cli-level=INFO -s {posargs} {[vars]tests_path}/integration/test_password_rotation.py
Expand All @@ -248,7 +248,7 @@ pass_env =
allowlist_externals =
{[testenv:pack-wrapper]allowlist_externals}
commands_pre =
poetry install --only integration
poetry install --only integration --no-root
{[testenv:pack-wrapper]commands_pre}
commands =
poetry run pytest -v --tb native --log-cli-level=INFO -s {posargs} {[vars]tests_path}/integration/test_plugins.py
Expand All @@ -267,7 +267,7 @@ pass_env =
allowlist_externals =
{[testenv:pack-wrapper]allowlist_externals}
commands_pre =
poetry install --only integration
poetry install --only integration --no-root
{[testenv:pack-wrapper]commands_pre}
commands =
poetry run pytest -v --tb native --log-cli-level=INFO -s {posargs} {[vars]tests_path}/integration/test_tls.py
Expand All @@ -286,7 +286,7 @@ pass_env =
allowlist_externals =
{[testenv:pack-wrapper]allowlist_externals}
commands_pre =
poetry install --only integration
poetry install --only integration --no-root
{[testenv:pack-wrapper]commands_pre}
commands =
poetry run pytest -v --tb native --log-cli-level=INFO -s {posargs} {[vars]tests_path}/integration/ha_tests/test_upgrade.py
Expand All @@ -305,7 +305,7 @@ pass_env =
allowlist_externals =
{[testenv:pack-wrapper]allowlist_externals}
commands_pre =
poetry install --only integration
poetry install --only integration --no-root
{[testenv:pack-wrapper]commands_pre}
commands =
poetry run pytest -v --tb native --log-cli-level=INFO -s {posargs} {[vars]tests_path}/integration/ha_tests/test_upgrade_from_stable.py
Expand All @@ -325,7 +325,7 @@ pass_env =
allowlist_externals =
{[testenv:pack-wrapper]allowlist_externals}
commands_pre =
poetry install --only integration
poetry install --only integration --no-root
{[testenv:pack-wrapper]commands_pre}
commands =
poetry run pytest -v --tb native --log-cli-level=INFO -s --ignore={[vars]tests_path}/unit/ {posargs}
Expand Down

0 comments on commit ff7f9b9

Please sign in to comment.