Skip to content

Commit 336e8eb

Browse files
authored
Document UNIDEP_SKIP_LOCAL_DEPS environment variable (#249)
* Document UNIDEP_SKIP_LOCAL_DEPS environment variable - Add comprehensive documentation for UNIDEP_SKIP_LOCAL_DEPS in Build System Integration section - Include usage examples for hatch build, uv build, and python -m build - Explain the purpose: avoiding hardcoded file paths in wheel metadata when building for distribution - Clarify that actual dependencies are still included while local dependency references are skipped * chore(docs): update TOC --------- Co-authored-by: basnijholt <[email protected]>
1 parent 3af858c commit 336e8eb

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ Try it now and streamline your development process!
5454
- [Implementation](#implementation)
5555
- [`[project.dependencies]` in `pyproject.toml` handling](#projectdependencies-in-pyprojecttoml-handling)
5656
- [:jigsaw: Build System Integration](#jigsaw-build-system-integration)
57+
- [Environment Variables](#environment-variables)
58+
- [`UNIDEP_SKIP_LOCAL_DEPS`](#unidep_skip_local_deps)
5759
- [Example packages](#example-packages)
5860
- [Setuptools Integration](#setuptools-integration)
5961
- [Hatchling Integration](#hatchling-integration)
@@ -390,6 +392,26 @@ dependencies = [
390392
391393
`unidep` seamlessly integrates with popular Python build systems to simplify dependency management in your projects.
392394

395+
### Environment Variables
396+
397+
#### `UNIDEP_SKIP_LOCAL_DEPS`
398+
399+
When building wheels for distribution (e.g., for PyPI), you may want to exclude local dependencies to avoid hardcoded file paths in the wheel metadata. Set this environment variable to skip including local dependencies as `file://` URLs:
400+
401+
```bash
402+
# For hatch projects
403+
UNIDEP_SKIP_LOCAL_DEPS=1 hatch build
404+
405+
# For uv build
406+
UNIDEP_SKIP_LOCAL_DEPS=1 uv build
407+
408+
# For python -m build
409+
UNIDEP_SKIP_LOCAL_DEPS=1 python -m build
410+
```
411+
412+
> [!NOTE]
413+
> When this variable is set, local dependencies are skipped but their actual dependencies (extracted from `requirements.yaml` or `pyproject.toml`) are still included in the built wheel. This ensures the wheel remains functional while avoiding non-portable absolute paths.
414+
393415
### Example packages
394416

395417
Explore these installable [example](example/) packages to understand how `unidep` integrates with different build tools and configurations:

0 commit comments

Comments
 (0)