Skip to content

Doesn't work when venv uses symlinks #5

@PerchunPak

Description

@PerchunPak

My .venv only contains symlinks, and p12y always says Patch appears to be already applied, skipping.... Same was with p12y commit, git didn't detect any changes, because it stores symlinks as a file with one line (path to another file)

.venv/lib/python3.14/site-packages
├── patch_package_py
│   ├── __init__.py -> /home/perchun/.cache/uv/archive-v0/wvYn-O7zDRl_-iwF7WF0X/patch_package_py/__init__.py
│   ├── __pycache__
│   │   ├── __init__.cpython-314.pyc
│   │   ├── cli.cpython-314.pyc
│   │   └── core.cpython-314.pyc
│   ├── cli.py -> /home/perchun/.cache/uv/archive-v0/wvYn-O7zDRl_-iwF7WF0X/patch_package_py/cli.py
│   └── core.py -> /home/perchun/.cache/uv/archive-v0/wvYn-O7zDRl_-iwF7WF0X/patch_package_py/core.py
└── patch_package_py-0.1.5.dist-info
    ├── entry_points.txt -> /home/perchun/.cache/uv/archive-v0/wvYn-O7zDRl_-iwF7WF0X/patch_package_py-0.1.5.dist-info/entry_points.txt
    ├── INSTALLER
    ├── METADATA -> /home/perchun/.cache/uv/archive-v0/wvYn-O7zDRl_-iwF7WF0X/patch_package_py-0.1.5.dist-info/METADATA
    ├── RECORD
    ├── REQUESTED
    └── WHEEL -> /home/perchun/.cache/uv/archive-v0/wvYn-O7zDRl_-iwF7WF0X/patch_package_py-0.1.5.dist-info/WHEEL

I have just noticed that symlink mode is discouraged, but I still wanted to report this for future users. One solution would be to replace symlink with a copy of the file (cat to_patch.py > to_patch2.py && mv to_patch2.py to_patch.py) before patching.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions