Skip to content

Remove redundant dependencies, update versions and modernize Dockerfile#149

Closed
aditeyabaral wants to merge 1 commit into
pesu-dev:devfrom
aditeyabaral:bump-dependencies-may2026
Closed

Remove redundant dependencies, update versions and modernize Dockerfile#149
aditeyabaral wants to merge 1 commit into
pesu-dev:devfrom
aditeyabaral:bump-dependencies-may2026

Conversation

@aditeyabaral
Copy link
Copy Markdown
Member

📌 Description

  • Replaces pytz with the stdlib zoneinfo module (ZoneInfo) for timezone handling — removes an unnecessary third-party dependency since Python 3.9+ ships zoneinfo natively.
  • Modernises the Dockerfile: upgrades the base image to Python 3.13, drops pip in favour of uv, adds proper layer caching, and uses uv run to launch the app.
  • Bumps all pinned dependency versions in requirements.txt and regenerates uv.lock.

ℹ️ Fixes / Related Issues
Related: N/A

🧱 Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • ⚠️ Breaking change
  • 📝 Documentation update
  • 🧪 Test suite change
  • ⚙️ CI/CD pipeline update – Dockerfile rewritten to use uv and Python 3.13
  • 🧹 Code quality / Refactor – pytz → stdlib zoneinfo
  • 🐢 Performance improvement
  • 🕵️ Debug/logging enhancement
  • 🔧 Developer tooling
  • 🔒 Security fix
  • 🧰 Dependency update – removed pytz, bumped all pinned versions in requirements.txt and uv.lock

🧪 How Has This Been Tested?

  • Unit Tests (tests/unit/)
  • Functional Tests (tests/functional/)
  • Integration Tests (tests/integration/)
  • Manual Testing

⚙️ Test Configuration:

  • OS: Linux
  • Python: 3.13 via uv
  • Docker build tested

✅ Checklist

  • My code follows the CONTRIBUTING.md guidelines
  • I've performed a self-review of my changes
  • I've added/updated necessary comments and docstrings
  • I've updated relevant docs (README or endpoint docs)
  • No new warnings introduced
  • I've added tests to cover my changes
  • All tests pass locally (scripts/run_tests.py)
  • I've run linting and formatting (pre-commit run --all-files)
  • Docker image builds and runs correctly
  • Changes are backwards compatible (if applicable)
  • Feature flags or .env vars updated (if applicable)
  • I've tested across multiple environments (if applicable)
  • Benchmarks still meet expected performance (scripts/benchmark/benchmark_requests.py)

🛠️ Affected API Behaviour

  • app/app.py – Modified /authenticate route logic
  • app/pesu.py – Updated scraping or authentication handling

🧩 Models

(none)

🐳 DevOps & Config

  • Dockerfile – Upgraded to Python 3.13, replaced pip with uv, added layer caching
  • .github/workflows/*.yaml – CI/CD pipeline or deployment updates
  • pyproject.toml / requirements.txt – Removed pytz, bumped pinned versions
  • .pre-commit-config.yaml – Linting or formatting hook changes

📊 Benchmarks & Analysis

(none)

🧠 Additional Notes

  • zoneinfo is stdlib since Python 3.9 — no new dependency, no behaviour change. datetime.now(ZoneInfo("Asia/Kolkata")) is a drop-in replacement for
    datetime.now(pytz.timezone("Asia/Kolkata")).
  • The Dockerfile uses --no-install-project during the dependency install step so the project package itself isn't built until app code is present, enabling correct layer caching.
  • uv.lock minimum supported Python remains >=3.11 per pyproject.toml; the Docker runtime is 3.13.

@aditeyabaral aditeyabaral requested a review from a team as a code owner May 22, 2026 01:08
@aditeyabaral aditeyabaral changed the title chore: update dependency versions Remove redundant dependencies, update versions and modernize Dockerfile May 22, 2026
Comment thread Dockerfile
COPY README.md /README.md
COPY requirements.txt /requirements.txt
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we can try using multi-stage docker builds, please check this https://ashishb.net/programming/using-python-uv-inside-docker/

Comment thread requirements.txt
# httpx
# starlette
certifi==2025.7.14
certifi==2026.5.20
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

package uses uv.lock to install in new docker using uv sync --frozen --no-dev --no-install-project instead of requirements.xtxt

please run uv lock --upgrade

these packages will be upgraded to new versions:

anyio
certifi
click
fastapi
idna
pydantic
pydantic-core
selectolax
starlette
typing-extensions
typing-inspection
uvicorn
annotated-doc

Comment thread Dockerfile
COPY app ./app
COPY README.md ./

CMD ["uv", "run", "python", "-m", "app.app"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

uv run tries to sync again after uv sync --frozen --no-dev --no-install-project

this issue can be solved using the multi stage docker implementation

@aditeyabaral
Copy link
Copy Markdown
Member Author

This PR is closed because all changes have been absorbed into #151

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