Skip to content

fix(deps): update dependency python-ulid to v4 - #371

Open
dreadnode-renovate-bot[bot] wants to merge 1 commit into
mainfrom
renovate/python-ulid-4.x
Open

dreadnode-renovate-bot[bot] wants to merge 1 commit into
mainfrom
renovate/python-ulid-4.x

Conversation

@dreadnode-renovate-bot

@dreadnode-renovate-bot dreadnode-renovate-bot Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
python-ulid (changelog) >=3.0.0,<4.0.0 → >=4.2.0,<4.3.0 age confidence

Release Notes

mdomke/python-ulid (python-ulid)

v4.2.0

Compare Source

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.

Fixed
  • import ulid works in frozen applications. Applications built with cx_Freeze or PyInstaller often leave out package metadata, which made import ulid fail with PackageNotFoundError. The version is now written into the package at build time.

  • ULID.parse(int(ulid)) now round-trips for every ULID. Previously only integers with exactly 37 digits were recognised as a full ULID, which covers ULIDs created between roughly 1996 and 2232 @​KuljeetSinghXDA.

  • Clear ValueErrors for out-of-range values instead of a bare OverflowError:

    >>> ULID.from_timestamp(-1.0)
    ValueError: Value is below minimum possible timestamp
    >>> ULID.from_int(2**128)
    ValueError: Value is outside the 128-bit range of a ULID
  • Pydantic validation always raises ValidationError for unsupported values such as a dict, a float or an out-of-range int, instead of leaking TypeError or OverflowError @​KuljeetSinghXDA.

  • The ULID constructor validates its input. bytearray and memoryview (as returned by many database drivers) are accepted and stored as immutable bytes. Other types, such as a 16-character str, now raise TypeError instead of creating a broken object @​KuljeetSinghXDA.

  • The ulid CLI reports invalid input without a traceback:

    $ ulid show not-a-ulid
    ulid: error: Encoded ULID has to be exactly 26 characters long.

    Invalid input exits with status 2, like other command-line argument errors.

  • ULID.from_datetime and 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.

Contributors

Thanks to @​KuljeetSinghXDA and @​arieleven for their contributions to this release!

Full changelog: mdomke/python-ulid@4.1.0...4.2.0

v4.1.0

Compare Source

Changed
  • Dropped support for Python 3.10.

⚠️ If you are still on Python 3.10: pin python-ulid<4.1 or upgrade to Python 3.11 or newer.

Fixed
  • The typing-extensions dependency is now also installed on Python 3.11, where it is required for typing_extensions.override.
  • Print generated and converted values when using python -m ulid, matching the ulid console command @​tongwentao.
  • ULID.from_str accepts lower case strings again, as the ULID spec defines the string representation as case insensitive. Lower case input has been rejected since 2.6.0 @​reyhaan07.

Full changelog: mdomke/python-ulid@4.0.1...4.1.0

v4.0.1

Compare Source

Changed
  • Renamed ULID.from_uuidv7 to ULID.from_uuid7 for naming symmetry with ULID.to_uuid7, correcting an inconsistency introduced in 3.2.0.

⚠️ If you adopted 3.2.0 or 4.0.0: update calls from ULID.from_uuidv7(...) to ULID.from_uuid7(...). This is the only change in this release.

For the full 4.0.0 feature set (the new ULIDGenerator, monotonicity policies, and default_generator), see the 4.0.0 release.

Full changelog: mdomke/python-ulid@4.0.0...4.0.1

v4.0.0

Compare Source

.. warning::

Breaking change: the ValueProvider class and the ULID.provider class attribute
have been removed. ULID generation is now handled by the new :class:.ULIDGenerator together
with pluggable monotonicity policies. To customize generation, construct a
:class:.ULIDGenerator (optionally with a custom clock, randomness source, or policy) and
either call its generate() method or assign it to ulid.default_generator.

Added

* Added a public :class:`.ULIDGenerator` class that encapsulates ULID generation and can be
  configured with a custom clock, randomness source, and monotonicity policy.
* Added pluggable monotonicity policies: :class:`.StrictMonotonicPolicy` (the default),
  :class:`.LaxMonotonicPolicy` and :class:`.PureRandomPolicy`, together with the
  :class:`.MonotonicityPolicy` protocol and the :class:`.BaseMonotonicPolicy` base class for
  implementing custom policies.
* Added a module-level ``ulid.default_generator`` that can be reassigned to route ``ULID()`` and
  the ``ULID.from_*`` constructors through a custom :class:`.ULIDGenerator`.

Removed
  • Removed the ValueProvider class and the ULID.provider attribute in favour of
    :class:.ULIDGenerator and the monotonicity policies. Code that replaced ULID.provider or
    subclassed ValueProvider must migrate to a custom :class:.ULIDGenerator assigned to
    ulid.default_generator.
  • Removed the internal validate_type decorator. The ULID.from_* constructors still raise
    TypeError for arguments of the wrong type, so runtime behaviour is unchanged.

v3.2.1

Compare Source

Fixed

* Corrected the build and publish pipeline and the generated source distribution. This release
  contains no changes to the library code.

`3.2.0`_ - 2026-07-17
---------------------
Added
  • Added transparent bidirectional UUIDv7 conversion methods (ULID.to_uuid7 and
    ULID.from_uuidv7) @pirate <https://github.com/pirate>_.
  • Added a --uuid7 option to the CLI's show command to convert and output a ULID as an
    RFC 4122 compliant UUIDv7.

Changed

* Dropped support for Python 3.9 and added support for Python 3.14
  `@Avihais12344 <https://github.com/Avihais12344>`_.
* Depend on ``typing-extensions`` only when running on Python < 3.11 `@musicinmybrain <https://github.com/musicinmybrain>`_.
* Migrated package and development workflow from Hatch to ``uv`` and ``poethepoet``.
* Configured Flox for bootstrapping the development environment.

Fixed
~~~~~
* Fixed a clock-skew bug where non-monotonic ULIDs could be generated when crossing a millisecond boundary between timestamp and randomness sampling `@gaoflow <https://github.com/gaoflow>`_.
* Fixed warning from ``uv`` during synchronization `@jaseemabid <https://github.com/jaseemabid>`_.
* Resolved various Ruff linter warnings and Pyrefly type checker issues.

`3.1.0`_ - 2025-08-18
---------------------
Changed
  • Added Python 3.13 to the trove classifiers.
  • Optimze @property to @cached_property @WH-2099 <https://github.com/WH-2099>_.
  • When generating ULIDs within the same millisecond, the library will ensure monotonic sort order by
    incrementing the randomness component by 1 bit. This process is descrbied in the
    spec <https://github.com/ulid/spec/blob/master/README.md#monotonicity>_.

Fixed

* Sharpen regular expression for Pydantic `@aplhk <https://github.com/aplhk>`_.
* Fix Sphinx warnings when referencing ULID from an external project. `@BoboTiG <https://github.com/BoboTiG>`_.

`3.0.0`_ - 2024-10-11
---------------------
Changed
  • Raise TypeError instead of ValueError if constructor is called with value of wrong type.
  • Update ruff linter rules and switch to hatch fmt.

Added

* Added :meth:`.ULID.parse`-method, which allows to create a :class:`.ULID`-instance from an
  arbitrary supported input value. `@perrotuerto <https://github.com/perrotuerto>`_.

Fixed
  • Documentation bug in the example of :meth:.ULID.milliseconds @tsugumi-sys <https://github.com/tsugumi-sys>_.

v3.2.0

Compare Source

Added
  • Added transparent bidirectional UUIDv7 conversion methods (ULID.to_uuid7 and ULID.from_uuidv7) @​pirate.
  • Added a --uuid7 option to the CLI's show command to convert and output a ULID as an RFC 4122 compliant UUIDv7.
Changed
  • Dropped support for Python 3.9 and added support for Python 3.14 @​Avihais12344.
  • Depend on typing-extensions only when running on Python < 3.11 @​musicinmybrain.
  • Migrated package and development workflow from Hatch to uv and poethepoet.
  • Configured Flox for bootstrapping the development environment.
Fixed
  • Fixed a clock-skew bug where non-monotonic ULIDs could be generated when crossing a millisecond boundary between timestamp and randomness sampling @​gaoflow.
  • Fixed warning from uv during synchronization @​jaseemabid.
  • Resolved various Ruff linter warnings and Pyrefly type checker issues.

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate CLI.

@dreadnode-renovate-bot dreadnode-renovate-bot Bot added area/python Changes to Python package configuration and dependencies type/digest Dependency digest updates labels Jul 22, 2026
@dreadnode-renovate-bot
dreadnode-renovate-bot Bot force-pushed the renovate/python-ulid-4.x branch from b4eef7a to 1228b26 Compare October 28, 2026 00:21
@dreadnode-renovate-bot

dreadnode-renovate-bot Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor Author

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: uv.lock
Using CPython 3.13.18 interpreter at: /opt/containerbase/tools/python/3.13.18/bin/python3
error: No solution found when resolving dependencies for split (markers: python_full_version == '3.10.*')
  cause: Because the requested Python version (>=3.10, <3.14) does not satisfy Python>=3.11 and python-ulid==4.2.0 depends on Python>=3.11, we can conclude that python-ulid==4.2.0 cannot be used.
         And because only python-ulid<=4.2.0 is available, we can conclude that python-ulid>=4.2.0 cannot be used.
         And because your project depends on python-ulid>=4.2.0 and your project requires dreadnode[all], we can conclude that your project's requirements are unsatisfiable.

hint: While the active Python version is 3.13, the resolution failed for other Python versions supported by your project. Consider limiting your project's supported Python versions using `requires-python`.

hint: The `requires-python` value (>=3.10, <3.14) includes Python versions that are not supported by your dependencies (e.g., python-ulid==4.2.0 only supports >=3.11). Consider using a more restrictive `requires-python` value (like >=3.11).

@dreadnode-renovate-bot
dreadnode-renovate-bot Bot force-pushed the renovate/python-ulid-4.x branch 2 times, most recently from 1513109 to 0e5d471 Compare November 11, 2026 00:21
| datasource | package     | from  | to    |
| ---------- | ----------- | ----- | ----- |
| pypi       | python-ulid | 3.1.0 | 4.2.0 |

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/python Changes to Python package configuration and dependencies type/digest Dependency digest updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants