Skip to content

Conversation

@trispera
Copy link
Member

@trispera trispera commented Jan 22, 2026

Related to tesk-core this and this

Summary by Sourcery

Update container images and Python dependencies for tesk-core to support newer urllib3 and boto3 versions and align with newer Python/Alpine environments.

Enhancements:

  • Upgrade filer and taskmaster Docker images to Alpine 3.19 and ensure pip is available in both build and runtime stages.
  • Relax and conditionalize urllib3 and boto3 version constraints based on Python version for broader compatibility.
  • Add AWS checksum-related environment variables for S3 mounts to improve compatibility with newer AWS SDK behavior.

Tests:

  • Constrain moto test dependency to versions below 5 to remain compatible with the updated dependency stack.

@sourcery-ai
Copy link

sourcery-ai bot commented Jan 22, 2026

Reviewer's Guide

Updates container images to Alpine 3.19, modernizes Python/pip installation in Dockerfiles, relaxes and makes conditional the urllib3 and boto3 version constraints to support newer versions and multiple Python runtimes, pins moto<5 for tests, and adjusts S3-related environment variables to be compatible with newer AWS SDK checksum behavior.

File-Level Changes

Change Details Files
Upgrade filer and taskmaster Docker images to Alpine 3.19 and adjust Python/pip installation commands.
  • Change base images from alpine:3.10 to alpine:3.19 for both builder and runtime stages in filer and taskmaster Dockerfiles.
  • Install both python3 and py3-pip via apk in builder and runtime images instead of just python3.
  • Add --break-system-packages flag to pip install commands in builder and runtime stages to accommodate Alpine/system Python packaging constraints.
source/tesk-core/containers/filer.Dockerfile
source/tesk-core/containers/taskmaster.Dockerfile
Relax and conditionalize urllib3 and boto3 dependency constraints and adjust test dependency on moto.
  • Replace fixed urllib3==1.26.19 with Python-version-dependent constraints: <2 for Python<3.10 and >=2,<3 for Python>=3.10.
  • Replace fixed boto3==1.16.18 with Python-version-dependent constraints: <=1.28 for Python==3.8 and >=1.28 for Python>=3.9.
  • Constrain moto test dependency to moto<5 to maintain compatibility with the updated boto3/urllib3 stack.
source/tesk-core/setup.py
Adjust S3 filer environment configuration for compatibility with newer AWS SDK checksum handling.
  • Add AWS_REQUEST_CHECKSUM_CALCULATION environment variable set to WHEN_REQUIRED when configuring the S3 mount.
  • Add AWS_RESPONSE_CHECKSUM_VALIDATION environment variable set to WHEN_REQUIRED when configuring the S3 mount.
source/tesk-core/src/tesk_core/filer_class.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue, and left some high level feedback:

  • Using --break-system-packages in the Dockerfiles may be unnecessary (since these are isolated container images) and could mask packaging issues; consider dropping it unless there is a specific constraint that requires overriding the system Python packages.
  • The new urllib3/boto3 environment markers leave Python versions <3.8 without an explicit constraint and treat 3.8 specially; it may be worth aligning these markers with the actual set of supported Python versions (e.g., via python_requires) so dependency resolution is predictable across all intended runtimes.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Using `--break-system-packages` in the Dockerfiles may be unnecessary (since these are isolated container images) and could mask packaging issues; consider dropping it unless there is a specific constraint that requires overriding the system Python packages.
- The new `urllib3`/`boto3` environment markers leave Python versions `<3.8` without an explicit constraint and treat `3.8` specially; it may be worth aligning these markers with the actual set of supported Python versions (e.g., via `python_requires`) so dependency resolution is predictable across all intended runtimes.

## Individual Comments

### Comment 1
<location> `source/tesk-core/setup.py:18-20` </location>
<code_context>
+                'urllib3>=2.0,<3.0 ; python_version >= "3.10"',
+
+                # boto3 constraint
+                'boto3<=1.28 ; python_version == "3.8"',
+                'boto3>=1.28 ; python_version >= "3.9"',
                 ]
 TEST_DEPS = [ 'pytest',
</code_context>

<issue_to_address>
**suggestion (bug_risk):** The asymmetric boto3 bounds may allow future breaking changes on Python ≥3.9 without any upper limit.

For 3.8, boto3 is capped at 1.28, but for ≥3.9 it’s unbounded on the upper side, so a future boto3 major release with breaking changes would still satisfy this spec. If 1.28 is a known compatibility ceiling, consider adding a similar upper bound for ≥3.9 (e.g. `<2.0` or `<1.29`), or clarify why only 3.8 is constrained while newer Python versions are not.

```suggestion
                # boto3 constraint
                'boto3<=1.28 ; python_version == "3.8"',
                'boto3>=1.28,<2.0 ; python_version >= "3.9"',
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +18 to +20
# boto3 constraint
'boto3<=1.28 ; python_version == "3.8"',
'boto3>=1.28 ; python_version >= "3.9"',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (bug_risk): The asymmetric boto3 bounds may allow future breaking changes on Python ≥3.9 without any upper limit.

For 3.8, boto3 is capped at 1.28, but for ≥3.9 it’s unbounded on the upper side, so a future boto3 major release with breaking changes would still satisfy this spec. If 1.28 is a known compatibility ceiling, consider adding a similar upper bound for ≥3.9 (e.g. <2.0 or <1.29), or clarify why only 3.8 is constrained while newer Python versions are not.

Suggested change
# boto3 constraint
'boto3<=1.28 ; python_version == "3.8"',
'boto3>=1.28 ; python_version >= "3.9"',
# boto3 constraint
'boto3<=1.28 ; python_version == "3.8"',
'boto3>=1.28,<2.0 ; python_version >= "3.9"',

@trispera trispera requested a review from lvarin January 22, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants