Metadata-Version: 2.5
Name: upcheck
Version: 0.1.1
Summary: Check whether your dependencies install on a target Python version, ABI and platform.
Project-URL: Homepage, https://github.com/immutabilityjuniper/upcheck
Project-URL: Repository, https://github.com/immutabilityjuniper/upcheck
Project-URL: Issues, https://github.com/immutabilityjuniper/upcheck/issues
Project-URL: Changelog, https://github.com/immutabilityjuniper/upcheck/blob/main/CHANGELOG.md
Author-email: pydev88 <pydev88@proton.me>
License-Expression: MIT
License-File: LICENSE
Keywords: arm64,ci,free-threading,packaging,python-version,upgrade,wheels
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Topic :: Software Development :: Build Tools
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: packaging>=24.2
Description-Content-Type: text/markdown

# upcheck

[![CI](https://github.com/immutabilityjuniper/upcheck/actions/workflows/ci.yml/badge.svg)](https://github.com/immutabilityjuniper/upcheck/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/upcheck.svg)](https://pypi.org/project/upcheck/)
[![Python versions](https://img.shields.io/pypi/pyversions/upcheck.svg)](https://pypi.org/project/upcheck/)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

**Will your dependencies install on that Python?** `upcheck` answers before you
upgrade, not after `pip` fails.

It reads your requirements, asks PyPI which wheels exist, and reports the
packages that have no compatible wheel for a target Python version, ABI
(free-threaded) and platform:

```console
$ upcheck . --python 3.15 --platform windows-arm64
target    Python 3.15 (GIL) on windows-arm64
packages  3

BLOCKERS (1)
  grpcio                     1.85.4       no compatible wheel
WARNINGS (1)
  psycopg2-binary            2.9.13       sdist only: needs a build toolchain
OK (1)
  packaging                  26.4         wheel available

result    1 ok, 1 warnings, 1 blockers
```

## Install

```console
pip install upcheck
# or
uv tool install upcheck
```

## Usage

```console
upcheck [PATH] [--python 3.15] [--platform windows-arm64] [--json]
```

`PATH` may be a project directory (reads `pyproject.toml`, then
`requirements.txt`), a `pyproject.toml`, or a requirements file.

| Flag | Meaning |
| --- | --- |
| `-p`, `--python` | Target version: `3.15`, `315`, `cp315`, or `3.15t` for free-threaded |
| `--platform` | `windows-arm64`, `windows-x86_64`, `linux-x86_64`, `linux-aarch64`, `macos-arm64`, `macos-x86_64`, `any` |
| `--free-threaded` | Force a free-threaded (GIL-disabled) target |
| `--no-sdist` | Treat source-only releases as blockers instead of warnings |
| `--no-suggest` | Skip scanning older releases for a version that does have a wheel |
| `--json` | Machine-readable output |
| `-j`, `--jobs` | Concurrent PyPI requests (default 8) |
| `--timeout` | Per-request timeout in seconds (default 20) |

Both `--python` and `--platform` default to the interpreter and machine running
the command.

### Exit codes

| Code | Meaning |
| --- | --- |
| `0` | Nothing blocks the target (warnings and unknown packages are allowed) |
| `1` | At least one blocker |
| `2` | Bad arguments, unreadable project, or unsupported requirements |

### In CI

```yaml
- name: Check the next Python
  run: |
    pipx run upcheck . --python 3.15 --platform linux-x86_64
```

Use `--json` when you want to post-process the result:

```json
{
  "target": {"python": "3.15", "free_threaded": false, "platform": "windows-arm64"},
  "summary": {"ok": 41, "warnings": 1, "blockers": 1, "unknown": 0},
  "packages": [
    {
      "name": "grpcio",
      "requested": ">=1.80",
      "version": "1.85.4",
      "status": "blocker",
      "detail": "no compatible wheel",
      "wheel": null,
      "suggestion": null
    }
  ],
  "exit_code": 1
}
```

## What it checks

1. Direct requirements from `[project].dependencies` or a requirements file.
2. Environment markers (`sys_platform`, `python_version`, …) against the target.
3. The newest release satisfying each specifier.
4. Whether that release ships a wheel whose tags fit the target:
   - CPython ABI: `cp315` on 3.15, `abi3` forward-compatible, `abi3t` for
     free-threaded 3.15+
   - platforms: `win_arm64`, `manylinux`/`musllinux`, `macosx` + `universal2`
5. If not, an sdist means "warning"; nothing means "blocker".
6. Optional: the newest older release that does have a compatible wheel.

## Limitations (v0.1)

- Direct dependencies only; transitive resolution is left to pip/uv.
- Manylinux and macOS deployment targets are not version-ranked.
- Private indexes are not configurable yet (the client supports it, the CLI
  does not).
- `uv.lock`/`pylock.toml` are not read yet.
- No source-level API checks: this release answers "can it install?", not
  "will it run?".

## Development

```console
uv sync
uv run pytest
uv run ruff check . && uv run ruff format .
uv run mypy
```

Without uv:

```console
python -m venv .venv
.venv\Scripts\activate          # Windows (bash: source .venv/Scripts/activate)
pip install -e . --group dev
pytest
```

## Release

Token-based upload (works with or without a git host):

1. Bump `version` in `pyproject.toml` and add a `CHANGELOG.md` entry.
2. `python -m build`
3. `python -m twine check --strict dist/*`
4. `python -m twine upload --repository testpypi dist/*`   ← dry run
5. `python -m twine upload dist/*`                          ← real PyPI

Credentials live in `~/.pypirc` (`__token__` + a `pypi-…` API token from the
respective site). PyPI never accepts the same version twice — any fix means a
version bump.

Optional, now that the source lives at `immutabilityjuniper/upcheck`:
configure **Trusted Publishing** on PyPI (Account → Publishing → add a pending
publisher: owner `immutabilityjuniper`, repository `upcheck`, workflow
`release.yml`, environment `pypi`) and the bundled workflow publishes on every
`v*` tag with no API token at all.

## License

MIT — see [LICENSE](LICENSE).
