Skip to content

chore: bump python-ulid from 4.1.0 to 4.2.0 - #452

Merged
gregoryfoster merged 1 commit into
mainfrom
dependabot/uv/python-ulid-4.2.0
Nov 20, 2026
Merged

gregoryfoster merged 1 commit into
mainfrom
dependabot/uv/python-ulid-4.2.0

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Bumps python-ulid from 4.1.0 to 4.2.0.

Release notes

Sourced from python-ulid's releases.

4.2.0

This release adds a SQLAlchemy column type, support for Python 3.15, and a batch of fixes that make invalid input fail with clear errors instead of OverflowErrors, broken objects or tracebacks.

Added

  • SQLAlchemy and SQLModel support. The new ulid.sqlalchemy.ULIDType column type stores ULID values and always loads them back as ULID. Install it with the new extra:

    pip install python-ulid[sqlalchemy]
    from sqlalchemy import select
    from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column
    from ulid import ULID
    from ulid.sqlalchemy import ULIDType
    class Base(DeclarativeBase):
    pass
    class Order(Base):
    tablename = "orders"
    id: Mapped[ULID] = mapped_column(ULIDType(), primary_key=True, default=ULID)
    customer: Mapped[str]
    
    ULIDs sort by creation time, so the newest order is simply the largest ID
    newest = session.scalars(select(Order).order_by(Order.id.desc())).first()
    Filters accept a ULID, a UUID, bytes, an int or any string representation
    session.scalars(select(Order).where(Order.id == "01KA6Q4C1D8M2Z3N4P5Q6R7S8T"))

    By default values are stored as a UUID: a native UUID column on PostgreSQL and CHAR(32) elsewhere. Use ULIDType(storage="binary") for a compact BINARY(16) column, or ULIDType(storage="string") to see the familiar 26-character ULID in your database. All storage options keep the database sort order identical to the ULID order (except for SQL Server's native UNIQUEIDENTIFIER).

    With SQLModel, ULID works as a field type directly; only the column type needs to be passed:

    from sqlmodel import Field, SQLModel
    class Hero(SQLModel, table=True):
    id: ULID = Field(default_factory=ULID, primary_key=True, sa_type=ULIDType)
    name: str

  • Python 3.15 is now officially supported and tested.

... (truncated)

Changelog

Sourced from python-ulid's changelog.

4.2.0_ - 2026-11-17

Added

* Added support for Python 3.15.
* :class:`~ulid.sqlalchemy.ULIDType`, a SQLAlchemy column type for :class:`.ULID` values that can
  also be used with SQLModel. It stores values as UUID by default, or as binary or string. Install
  it with the new ``sqlalchemy`` extra (``pip install python-ulid[sqlalchemy]``).

Fixed

  • The :class:.ULID constructor now accepts :class:bytes and bytes-like values (bytearray and memoryview), which are stored as immutable :class:bytes. A 16-character string or an integer was previously accepted and produced an object whose str() failed or that was unhashable, so other types now raise :exc:TypeError @KuljeetSinghXDA <https://github.com/KuljeetSinghXDA>_.
  • Pydantic validation of unsupported values such as dict, float or an out-of-range int now raises pydantic.ValidationError instead of leaking :exc:TypeError or :exc:OverflowError @KuljeetSinghXDA <https://github.com/KuljeetSinghXDA>_.
  • :meth:.ULID.parse now treats any integer in the unsigned 128-bit range as a full ULID integer, instead of guessing from the number of decimal digits. Previously only integers with exactly 37 digits were accepted, so ULID.parse(int(ulid)) failed for most ULIDs @KuljeetSinghXDA <https://github.com/KuljeetSinghXDA>_.
  • :meth:.ULID.from_datetime and :meth:.ULID.from_timestamp no longer land one millisecond early when a value on an exact millisecond multiplies to just below that integer as a float @arieleven <https://github.com/arieleven>_.
  • :meth:.ULID.from_datetime and :meth:.ULID.from_timestamp raise a :exc:ValueError for values before the Unix epoch instead of a bare :exc:OverflowError.
  • :meth:.ULID.from_int raises a :exc:ValueError for integers outside the unsigned 128-bit range instead of a bare :exc:OverflowError.
  • The ulid command line tool reports invalid input as a short error message with exit status 2 instead of a Python traceback.
  • import ulid no longer fails when the package metadata is missing, e.g. in applications frozen with cx_Freeze or PyInstaller. The version is now written into the package at build time.
Commits
  • 4afe4bb chore: Release 4.2.0
  • 4c00db0 fix: report invalid CLI input without a traceback (#82)
  • 5a42522 fix: raise ValueError for out-of-range integers in ULID.from_int (#81)
  • aa949e4 fix: reject non-bytes values in the ULID constructor (#79)
  • 9a2fb14 fix: raise ValidationError for unsupported Pydantic values (#78)
  • c31f064 fix: parse any 128-bit integer as a full ULID (#77)
  • 45153a9 fix: import ulid without package metadata (#80)
  • 37908e1 feat: add SQLAlchemy column type for ULID values (#76)
  • 3a0cb36 chore: add Python 3.15 support and rely on uv.lock for dev dependencies (#75)
  • b2cc4b7 fix: raise ValueError for timestamps before the Unix epoch (#74)
  • Additional commits viewable in compare view

@dependabot dependabot Bot added dependencies Pull requests that update a dependency file python:uv Pull requests that update python:uv code labels Nov 20, 2026
@gregoryfoster

Copy link
Copy Markdown
Member

@dependabot rebase

Bumps [python-ulid](https://github.com/mdomke/python-ulid) from 4.1.0 to 4.2.0.
- [Release notes](https://github.com/mdomke/python-ulid/releases)
- [Changelog](https://github.com/mdomke/python-ulid/blob/main/CHANGELOG.rst)
- [Commits](mdomke/python-ulid@4.1.0...4.2.0)

---
updated-dependencies:
- dependency-name: python-ulid
  dependency-version: 4.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot
dependabot Bot force-pushed the dependabot/uv/python-ulid-4.2.0 branch from d7d7a34 to dd4f305 Compare November 20, 2026 17:35
@gregoryfoster
gregoryfoster merged commit 54c8a78 into main Nov 20, 2026
5 checks passed
@gregoryfoster
gregoryfoster deleted the dependabot/uv/python-ulid-4.2.0 branch November 20, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file python:uv Pull requests that update python:uv code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant