Skip to main content

An mxdev hook to update pyproject.toml for uv workflows

Project description

mxdev-uv-pyproject-updater

An mxdev extension hook that automatically updates pyproject.toml during the mxdev write phase to support uv workflows.

Installation

You must install this package in the same environment as mxdev.

If you are using uv to run mxdev globally, you can install the hook via uv tool install:

uv tool install mxdev --with mxdev-uv-pyproject-updater

Or if you are running mxdev via a local virtual environment:

uv pip install mxdev mxdev-uv-pyproject-updater

Usage

Because it registers an mxdev entry point, this hook runs automatically whenever you run mxdev. It will automatically detect packages defined in your mx.ini file and write the corresponding configuration to your pyproject.toml file.

Features

  1. Automatic uv Source Mapping It natively configures the [tool.uv.sources] table in your pyproject.toml. It handles mxdev's absolute vs relative directories and automatically respects the install-mode setting (editable, fixed, or skip). It perfectly supports mxdev subdirectory parameters too.

    [tool.uv.sources]
    "plone.app.discussion" = {path = "sources/plone.app.discussion", editable = true}
    
  2. Smart Dependency Injection The hook safely inserts your checked-out packages directly into your [project] dependencies array.

    It implements strict PEP 503 normalization (converting -, _, and . equivalently) to intelligently ensure packages aren't duplicated, even if the dependency is already specified in your pyproject.toml with version specifiers or extras.

    [project]
    dependencies = [
        "plone.app.discussion"
    ]
    
  3. Format Preservation Built on tomlkit, it safely updates pyproject.toml while perfectly preserving all your existing user formatting, arrays, spacing, and comments.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mxdev_uv_pyproject_updater-0.1.0.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mxdev_uv_pyproject_updater-0.1.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file mxdev_uv_pyproject_updater-0.1.0.tar.gz.

File metadata

File hashes

Hashes for mxdev_uv_pyproject_updater-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cc0cffa2963542f7bd41dd313b0bbc2d85a1ac457802a6f0824e10ce97263cb7
MD5 6ecf1bac488802388870b71421d112cc
BLAKE2b-256 57daed998e1703bc955f76f42632a1759ec2cafabd5cce8191b25504155f07f8

See more details on using hashes here.

File details

Details for the file mxdev_uv_pyproject_updater-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mxdev_uv_pyproject_updater-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4426e277bb57d3006b102630c1a22f95566ce4c60da0e5d94c35e7c07e6f27c0
MD5 d4a66524dbb2665427f06a70a8717e0c
BLAKE2b-256 c02117abb4be20f22043bc67906bd9cfb65f8b8a6e87ac5b42ea041f3e39d3a8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page