Metadata-Version: 2.4
Name: entryclash
Version: 0.1.3
Summary: Find Python packages that would install the same command.
Author: park-bit
License: MIT License
        
        Copyright (c) 2026 park-bit and contributors
        
        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.
        
Project-URL: Repository, https://github.com/park-bit/entryclash
Project-URL: Issues, https://github.com/park-bit/entryclash/issues
Keywords: python-packaging,wheel,entry-points,cli
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# EntryClash

Two Python packages can both install a command called `dotenv`. `which dotenv` (or `where.exe dotenv` on Windows) shows the launcher on your path. EntryClash shows **which packages claim that name**, including in wheels you haven't installed yet.

Run it with Python 3.10 or newer. The [single-file CLI](https://github.com/park-bit/entryclash/releases/latest/download/entryclash.py) uses only the standard library.

## Try a real clash

From a checkout, download two small wheels into an empty `wheelhouse` directory. Neither package needs to be installed.

```sh
python -m pip download --no-cache-dir --no-deps --only-binary=:all: --require-hashes -r examples/dotenv.txt -d wheelhouse
python entryclash.py wheelhouse
```

```text
SIKE!!
dotenv
  dotenv-cli==3.4.1 -> dotenv_cli.cli:main
  python-dotenv==1.0.1 -> dotenv.__main__:cli
Packages checked: 2 | Conflicting commands: 1
```

The second command exits with `1`: either package installed into the same scripts directory would have to share the `dotenv` launcher. If you need both CLIs, give each its own virtual environment and invoke each environment's executable explicitly.

## Everyday use

| Question | Command |
| --- | --- |
| Does anything in this environment clash? | `python entryclash.py` |
| Who claims `pytest` here? | `python entryclash.py --command pytest` |
| What would clash after installing these wheels here? | `python entryclash.py --against-env wheelhouse` |
| Which script filenames do these wheels have in common? | `python entryclash.py --json wheelhouse` |

Use the `python` **from the environment you want to inspect**. A wheel directory is read one level deep. Supply one wheel per distribution for a single target environment; alternative builds aren't installed together. In `--against-env` mode a wheel replaces the installed version's declarations, just as an upgrade would. The report includes any existing clashes that would remain. Wheels alone are compared only with one another. EntryClash does not download dependencies.

In CI, use it as a GitHub Action on your built wheels (or run `entryclash.py` directly):

```yaml
- uses: park-bit/entryclash@v0.1.3
  with:
    wheels: wheelhouse/
```

Exit codes: **0** = no matching collision found, **1** = at least one collision, **2** = unusable input. `--command NAME` accepts a command name or its launcher filename. `--json` includes the package, version and source of each claim.

### What gets checked?

- **Entry points:** `console_scripts` and `gui_scripts` generate launchers. EntryClash compares their filenames on the OS where you run it, including `.exe` on Windows.
- **Files shipped in a wheel:** If two wheels both ship `report.cmd` in their own `.data/scripts/` directories, the report names both wheels and prints the archive paths. In JSON the group is `wheel_scripts`. A nested file like `helpers/report.cmd` keeps its subdirectory, so it doesn't clash with `report.cmd` at the top level.
- **Already installed:** If a distribution has a `RECORD` file, EntryClash checks its recorded paths under the current interpreter's scripts directory. These show up as `installed_scripts`; a generated launcher already counted by its entry point is counted only once. Without `RECORD`, only its entry points are visible. [How to check a copied script when `RECORD` is missing](docs/missing-record.md).

The report tells you who claims a filename, not which copy is on disk or which command your shell will run. Files outside that scripts directory, shell aliases and ordinary Python modules aren't checked. `--ignore-case` and `--no-ignore-case` change filename comparison; they don't change which launchers the host OS generates.

## Credits and feedback

Daniel Habenicht [described the CLI overwrite problem in pip](https://github.com/pypa/pip/issues/10863). The reader follows the PyPA specifications for [entry points](https://packaging.python.org/en/latest/specifications/entry-points/), [wheel installation paths](https://packaging.python.org/en/latest/specifications/binary-distribution-format/), and [installed file records](https://packaging.python.org/en/latest/specifications/recording-installed-packages/). Bundled entry-point wrappers follow [pip's installer behavior](https://github.com/pypa/pip/blob/24.0/src/pip/_internal/operations/install/wheel.py). The demo uses published wheels from [dotenv-cli](https://github.com/venthur/dotenv-cli) and [python-dotenv](https://github.com/theskumar/python-dotenv); neither is bundled here.

If a launcher gives a surprising result, [open an issue](https://github.com/park-bit/entryclash/issues) with the package names and versions, OS, command you ran, and what you expected. To run the tests: `python -m unittest discover -s tests -v`.

Maintained by [park-bit](https://github.com/park-bit). [MIT license](LICENSE).
