uv-to-pipfile

A tool and pre-commit hook to convert uv.lock files to Pipfile.lock format, allowing you to use uv for dependency resolution while maintaining compatibility with Pipenv workflows.

Installation

With pre-commit

Add this to your .pre-commit-config.yaml:

-   repo: https://github.com/FlavioAmurrioCS/uv-to-pipfile
    rev: v0.0.7  # Use the ref you want to point at
    hooks:
    -   id: uv-to-pipfile

How it works

Packages

The conversion process follows these steps:

Python Version Detection

The tool determines Python version requirements in the following order:

  1. Check for a .python-version file in the same directory as the uv.lock file
  2. Extract the requires-python field from the uv.lock (ignoring range markers such as >=)
  3. Default to Python 3.11 if no version information is found

Python Version Compatibility

This tool is compatible with Python 3.8 and later versions. The implementation is designed to work seamlessly across different Python environments:

The script can be executed in several ways:

Known Issues and Limitations

Development Roadmap

The following enhancements are planned for future releases:

Code Improvements

Testing Enhancements

Feature Development

Contributing

Contributions are welcome! Feel free to open issues or pull requests on GitHub.

License

MIT