Skip to content

Upgrade biblib to Python 3.12 - #189

Open
femalves wants to merge 3 commits into
masterfrom
upgrade/python-3.12
Open

Upgrade biblib to Python 3.12#189
femalves wants to merge 3 commits into
masterfrom
upgrade/python-3.12

Conversation

@femalves

@femalves femalves commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

These changes are in dev right now.

@coveralls

coveralls commented Apr 8, 2026

Copy link
Copy Markdown

Coverage Status

Coverage is 93.629%upgrade/python-3.12 into master. No base build found for master.

@femalves
femalves force-pushed the upgrade/python-3.12 branch from feeae19 to 5591744 Compare April 23, 2026 14:43
@femalves
femalves force-pushed the upgrade/python-3.12 branch 2 times, most recently from f2c19a2 to 2f41ee8 Compare May 1, 2026 18:52
@femalves
femalves requested a review from tjacovich May 1, 2026 18:58

@tjacovich tjacovich left a comment

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.

Looks like a solid upgrade. Just a couple of questions about specific implementation details.

Comment thread .github/workflows/python_actions.yml Outdated
- name: Install dependencies
run: |
python -m pip install "pip==24" setuptools==57.5.0 wheel
python -m pip install "pip==24" "setuptools>=62.0.0,<70.0.0" wheel

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.

Out of curiosity, what packages break with setuptools >70?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I ran some tests, and the <70 is no longer necessary, so I removed it.

from biblib.manage import DeleteObsoleteVersionsNumber, DeleteStaleUsers, DeleteObsoleteVersionsTime
from biblib.models import User, Library, Permissions, Notes
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy import text

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.

Is this strictly input sanitization?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment thread biblib/models.py

import uuid
from datetime import datetime
from datetime import datetime, timezone

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.

Did something change in sqlalchemy that now requires us to explicitly strip the timezone?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The change is in Python. datetime.utcnow() is deprecated and should be replaced with datetime.now(timezone.utc), but the former is timezone-naive, and the latter is timezone-aware. I'm stripping the timezone so the new version is the same as the previous one.

Comment thread config.py

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.

This is an interesting way to solve the relocated config. We can talk more about it at our next weekly and decide if this is how we want to do it going forward?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That bypassed my review. I just moved the config to the root so it can be found after the changes to adsmutils.

@femalves
femalves force-pushed the upgrade/python-3.12 branch 2 times, most recently from 2a6db28 to fdd04a0 Compare July 7, 2026 23:51
@femalves
femalves requested a review from tjacovich July 9, 2026 17:14
@femalves
femalves force-pushed the upgrade/python-3.12 branch from fdd04a0 to 1f3ee68 Compare July 21, 2026 17:02
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.

3 participants