Skip to content

Commit 4c32f44

Browse files
Pin dependencies (#257)
1 parent 50d13cb commit 4c32f44

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+84
-86
lines changed

.github/workflows/integration_test.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ jobs:
99
secrets: inherit
1010
with:
1111
modules: '["discourse", "reconcile", "conflict", "migrate"]'
12-
juju-channel: 3.1/stable
13-
channel: 1.28-strict/stable
12+
juju-channel: 3.6/stable
13+
channel: 1.31-strict/stable

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33
FROM python:3.12-slim
44

action.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33
name: Upload Charm Docs
44
description: Upload charm documentation to charmhub

dev-requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ pytest-operator
33
factory_boy>=3,<4
44
pytest-asyncio>=0.21,<0.22
55
pytest>=8,<9
6-
juju==3.1.2.0
6+
juju

generate-src-docs.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
# Copyright 2024 Canonical Ltd.
3+
# Copyright 2025 Canonical Ltd.
44
# See LICENSE file for licensing details.
55

66
rm -rf src-docs

main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22

3-
# Copyright 2024 Canonical Ltd.
3+
# Copyright 2025 Canonical Ltd.
44
# See LICENSE file for licensing details.
55

66
"""Main execution for the action."""

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
[project]

requirements.txt

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
GitPython>=3.1,<3.2
2-
pydiscourse>=1.7,<1.8
3-
PyGithub>=2.3,<2.4
4-
PyYAML>=6.0,<6.1
5-
requests>=2.32,<2.33
6-
more-itertools>=10.3,<10.4
1+
GitPython==3.1.44
2+
pydiscourse==1.7.0
3+
PyGithub==2.5.0
4+
PyYAML<=6.0
5+
requests==2.32.3
6+
more-itertools==10.6.0

src-docs/check.py.md

+1-1

src/gatekeeper/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Library for uploading docs to charmhub."""

src/gatekeeper/action.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Module for taking the required actions to match the server state with the local state."""

src/gatekeeper/check.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Module for running checks."""
@@ -168,7 +168,7 @@ def conflicts(actions: Iterable[AnyAction]) -> Iterator[Problem]:
168168
some changes on the server that have not been merged into git yet and the branch is proposing
169169
to make changes to the documentation as well. This means that there could be changes made on
170170
the server which logically conflict with proposed changes in the PR. These conflicts can be
171-
supppressed using the discourse-ahead-ok tag on the commit that the action is running on.
171+
suppressed using the discourse-ahead-ok tag on the commit that the action is running on.
172172
173173
Args:
174174
actions: The actions to check.

src/gatekeeper/clients.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Module for Client class."""

src/gatekeeper/commit.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Module for handling interactions with git commit."""

src/gatekeeper/constants.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Shared constants.

src/gatekeeper/content.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Module for checking conflicts using 3-way merge and create content based on a 3 way merge."""

src/gatekeeper/discourse.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Interface for Discourse interactions."""

src/gatekeeper/docs_directory.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Class for reading the docs directory."""

src/gatekeeper/download.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Library for downloading docs folder from charmhub."""

src/gatekeeper/exceptions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Exceptions for uploading docs to charmhub."""

src/gatekeeper/index.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Execute the uploading of documentation."""

src/gatekeeper/metadata.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Module for parsing metadata.yaml file."""

src/gatekeeper/migration.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Module for migrating remote documentation into local git repository."""

src/gatekeeper/navigation_table.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Module for parsing and rendering a navigation table."""

src/gatekeeper/reconcile.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Module for calculating required changes based on docs directory and navigation table."""

src/gatekeeper/repository.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Module for handling interactions with git repository."""

src/gatekeeper/sort.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Sort items for publishing."""

src/gatekeeper/types_.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Types for uploading docs to charmhub."""

tests/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Tests for uploading docs to charmhub."""

tests/conftest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Fixtures for all tests."""

tests/factories.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Factories for generating test data."""

tests/integration/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Integration tests for uploading docs to charmhub."""

tests/integration/conftest.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Fixtures for integration tests."""
@@ -104,13 +104,12 @@ async def create_discourse_admin_account(discourse: Application, email: str):
104104
Returns:
105105
The credentials of the admin user.
106106
"""
107-
password = secrets.token_urlsafe(16)
108107
discourse_unit: Unit = discourse.units[0]
109-
action: Action = await discourse_unit.run_action(
110-
"add-admin-user", email=email, password=password
111-
)
108+
action: Action = await discourse_unit.run_action("create-user", admin=True, email=email)
112109
await action.wait()
113-
return types.Credentials(email=email, username=email.split("@")[0], password=password)
110+
return types.Credentials(
111+
email=email, username=email.split("@")[0], password=action.results["password"]
112+
)
114113

115114

116115
async def create_discourse_admin_api_key(

tests/integration/test___init__run_conflict.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Integration tests for running the action where there is a merge conflict."""

tests/integration/test___init__run_migrate.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Integration tests for running the migrate action."""
@@ -43,7 +43,7 @@ async def test_run_migrate(
4343
monkeypatch,
4444
charm_id: str,
4545
charm_dir: str,
46-
):
46+
): # pylint: disable=too-many-positional-arguments
4747
"""
4848
arrange: given running discourse server
4949
act: when run is called with:

tests/integration/test___init__run_reconcile.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Integration tests for running the reconcile portion of the action."""
@@ -38,7 +38,7 @@ async def test_run(
3838
mock_github_repo: MagicMock,
3939
charm_id: str,
4040
charm_dir: str,
41-
):
41+
): # pylint: disable=too-many-positional-arguments
4242
"""
4343
arrange: given running discourse server
4444
act: when run is called with:

tests/integration/test_discourse.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Integration tests for discourse."""

tests/integration/types.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Useful types for integration tests."""

tests/types.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Useful types for tests."""

tests/unit/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Unit tests for uploading docs to charmhub."""

tests/unit/action/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Unit tests for actions."""

tests/unit/action/test_other_actions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Unit tests for action."""

tests/unit/action/test_update_action.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Unit tests for action."""

tests/unit/conftest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Fixtures for all unit tests."""

tests/unit/helpers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Helper functions for tests."""

tests/unit/test___init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33
# pylint: disable=too-many-lines
44
"""Unit tests for execution."""

tests/unit/test_check.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Unit tests for check."""

tests/unit/test_commit.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Unit tests for commit module."""

tests/unit/test_content.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Unit tests for content."""

tests/unit/test_discourse.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Unit tests for discourse."""
@@ -350,15 +350,14 @@ def test_check_topic_write_permission_user_deleted(
350350
],
351351
)
352352
# All arguments needed to be able to parametrize tests
353-
# pylint: disable=too-many-arguments
354353
def test_check_topic_success(
355354
monkeypatch: pytest.MonkeyPatch,
356355
function_: str,
357356
topic_data,
358357
expected_return_value,
359358
discourse: Discourse,
360359
topic_url: str,
361-
):
360+
): # pylint: disable=too-many-arguments,too-many-positional-arguments
362361
"""
363362
arrange: given a mocked discourse client that returns given data for a topic
364363
act: when given function is called
@@ -573,7 +572,7 @@ def test_function_discourse_error(
573572
kwargs: dict,
574573
expected_error_msg_contents: tuple[str, ...],
575574
discourse: Discourse,
576-
): # pylint: disable=too-many-arguments
575+
): # pylint: disable=too-many-arguments,too-many-positional-arguments
577576
"""
578577
arrange: given mocked discourse client that raises an error
579578
act: when the given function is called

tests/unit/test_docs_directory.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Unit tests for docs directory module."""

tests/unit/test_download.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
"""Unit tests for download."""

0 commit comments

Comments
 (0)