Luke Tainton 6421a3923f
Some checks failed
Security / sonarqube (push) Failing after 22s
Security / snyk (push) Successful in 54s
feat!(deps): upgrade dependencies (#488)
Okay, let's break down this Git diff. I'll explain the changes in the context of the overall project.

**Overall:**

This pull request appears to be updating dependencies, and making a corresponding code change to reflect an API change in one of those dependencies, `webexteamssdk`. The project seems to be a Webex bot application, utilizing the Webex Teams SDK to interact with Webex.

**File Breakdown:**

1.  `app/meme.py`

    ```diff
    --- a/app/meme.py
    +++ b/app/meme.py
    @@ -2,10 +2,10 @@

     from webex_bot.models.command import Command
     from webex_bot.models.response import Response, response_from_adaptive_card
-    from webexteamssdk.models.cards import (
+    from webexpythonsdk.models.cards import (
         AdaptiveCard,
         Choice,
-        Choices,
+        ChoiceSet,
         Column,
         ColumnSet,
         FontSize,
@@ -13,7 +13,7 @@ from webexteamssdk.models.cards import (
         Text,
         TextBlock,
     )
-    from webexteamssdk.models.cards.actions import OpenUrl, Submit
+    from webexpythonsdk.models.cards.actions import OpenUrl, Submit

     from app import img

    @@ -70,7 +70,7 @@ class MakeMemeCommand(Command):
                         Column(
                             width=1,
                             items=[
-                                Choices(
+                                ChoiceSet(
                                     id="meme_type",
                                     isMultiSelect=False,
                                     choices=[Choice(title=x["name"], value=x["choiceval"]) for x in TEMPLATES],
    ```

    *   **`import` statement update:**

        *   `webexteamssdk` is replaced with `webexpythonsdk`.  This indicates that the code is migrating to use a potentially renamed or reorganized SDK.
        *   The import paths for card models and actions are updated to reflect the new SDK structure (e.g., `webexteamssdk.models.cards` becomes `webexpythonsdk.models.cards`).
    *   **`Choices` to `ChoiceSet`:**

        *   The code changes from using a class named `Choices` to `ChoiceSet`. The `Choices` class was probably renamed to `ChoiceSet` in the new SDK.  This change is found in the `MakeMemeCommand` class, within the adaptive card definition.
        *   The purpose of this code is likely to present a user with a set of options to select a meme type, and the `ChoiceSet` renders a dropdown or radio button group in the adaptive card.

2.  `uv.lock`

    This file is a lock file for the uv package manager, similar to `requirements.txt` with hashes.  It specifies the exact versions and dependencies of Python packages used in the project. The changes in this file reflect an update to the project's dependencies. The major changes are:

    *   **Removal of `revision = 2`:** This line is removed, indicating a change in the lock file's metadata.
    *   **Version bumps:** Several packages have their versions updated. Some examples include:
        *   `certifi` updated from `2025.1.31` to `2025.4.26`
        *   `charset-normalizer` updated from `3.4.1` to `3.4.2`
        *   `click` updated from `8.1.8` to `8.2.1`
        *   `coverage` updated from `7.8.0` to `7.8.2`
        *   `dill` updated from `0.3.9` to `0.4.0`
        *   `identify` updated from `2.6.9` to `2.6.12`
        *   `mypy-extensions` updated from `1.0.0` to `1.1.0`
        *   `packaging` updated from `24.2` to `25.0`
        *   `pluggy` updated from `1.5.0` to `1.6.0`
        *   `pylint` updated from `3.3.6` to `3.3.7`
        *   `urllib3` updated to `2.4.0`
        *   `webex-bot` updated from `0.5.2` to `0.6.2`
        *   `webexteamssdk` replaced by `webexpythonsdk` updated to `2.0.4`
    *   **Removal of `future` package:** This package is removed from the dependencies.
    *   **Addition of `pygments` package:** This package is added as a dependency with version `2.19.1`.
    *   **Hash changes:**  The hashes for all the updated packages have also changed, which is expected since the package versions are different. The inclusion of hashes ensures that the correct, unaltered versions of the packages are installed.

**Impact and Justification:**

*   **Dependency Updates:** Keeping dependencies up-to-date is a standard security practice. Newer versions often include bug fixes, performance improvements, and security patches.
*   **API Alignment:** The code change in `app/meme.py` is essential. If `webexteamssdk` was indeed renamed or its API significantly altered in the newer version, the code needs to adapt to use the new class names and import paths. Failing to do so would likely break the meme-making functionality.
*   **Lockfile Integrity:** Updating the lockfile (`uv.lock`) is crucial.  It ensures that every environment where this project is deployed uses the *exact* same versions of the dependencies, preventing unexpected behavior.
*   **Removal of `future`:** The removal of `future` suggests that the code might have been updated to be fully compatible with Python 3, and the package is no longer needed.
*   **Addition of `pygments`:** The addition of `pygments` indicates that the code will now use this library.

**In Summary:**

This pull request updates dependencies, adapts the code to API changes in `webexpythonsdk`, adds `pygments` and removes the `future` package, while ensuring dependency consistency through the lockfile. It's a necessary step for maintaining the application's functionality, security, and compatibility with the latest libraries.

Reviewed-on: #488
2025-06-06 19:53:36 +02:00
2024-08-04 19:04:40 +01:00
2024-11-28 21:00:21 +00:00
2023-07-21 22:57:14 +01:00
2025-01-03 19:13:04 +01:00
2025-01-02 22:54:22 +00:00
2025-02-17 11:57:39 +01:00

webexmemebot

Description

Webex-based meme generation bot using memegen.link.

How to install

  1. Clone the repository
  2. Copy .env.default to .env
  3. Edit .env as required:
    • WEBEX_API_KEY - Webex API key

How to use

  1. Install Docker and Docker Compose
  2. Run docker-compose up -d
Description
Webex-based meme generation bot using memegen.link.
Readme 3.7 MiB
v0.40.2 Latest
2025-05-10 22:28:55 +02:00
Languages
Python 95.4%
Dockerfile 4.6%