Metadata-Version: 2.4
Name: pip-mark-installed
Version: 0.0.1
Summary: Tool to mark packages as installed in pip without actually installing them.
Project-URL: Home, https://github.com/sitic/pip-mark-installed
Author-email: Jan Lebert <mail@janlebert.com>
License: Copyright (c) 2025 Jan Lebert
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE.md
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Build Tools
Description-Content-Type: text/markdown

# pip-mark-installed

A utility tool to mark packages as installed in pip without actually installing them.

## Description

`pip-mark-installed` creates the necessary metadata files to make pip believe that a package is installed, without actually installing any of the package code. This is particularly useful for resolving conflicts between different package variants that share the same namespace (e.g., different OpenCV distributions, system installations of pytorch etc.).

## Installation

Grab the [pip-mark-installed.py](https://raw.githubusercontent.com/sitic/pip-mark-installed/main/pip-mark-installed.py) script or install it via pip:

```bash
pip install pip-mark-installed
```

## Usage

```bash
pip-mark-installed PACKAGE_SPEC [PACKAGE_SPEC ...]
```

Where `PACKAGE_SPEC` can be either:
- `PACKAGE_NAME` (uses a default future version)
- `PACKAGE_NAME==VERSION`

### Examples

Mark a package with default version:
```bash
pip-mark-installed.py opencv-python
```

Mark multiple packages with specific versions:
```bash
pip-mark-installed.py opencv-python-headless==4.5.1 opencv-contrib-python==4.5.1
```

Specify a custom site-packages directory:
```bash
pip-mark-installed.py --site-packages /path/to/site-packages some-package
```

## Common Use Cases

For example, OpenCV has several Python package variants that conflict with each other:
- `opencv-python` (standard build)
- `opencv-python-headless` (without GUI)
- `opencv-contrib-python` (with extra modules)
- `opencv-contrib-python-headless` (extra modules, no GUI)

Different dependencies might specify different variants, leading to accidental file overwrites and runtime errors. `pip-mark-installed` can help you resolve these conflicts by marking undesired packages as installed without actually installing them:

```bash
# First install the variant you actually want
pip install opencv-python-headless

# Then mark the conflicting package as installed
pip-mark-installed opencv-python
```

## How It Works

The script creates the necessary `.dist-info` directory structure and metadata files that pip uses to determine if a package is installed.

## License

MIT
