python-readiness


Namepython-readiness JSON
Version 2.2 PyPI version JSON
download
home_pageNone
SummaryAre your dependencies ready for new Python?
upload_time2024-10-10 07:08:15
maintainerNone
docs_urlNone
authorShantanu Jain
requires_python>=3.9
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # python_readiness

Are your dependencies ready for new Python?

## Installation

```bash
pip install python_readiness
```

Alternatives include:
- `uvx python_readiness`
- It's a single file script that contains PEP 723 metadata

## Usage

**Check if a specific package is ready for a specific Python:**
```bash
python_readiness -p numpy --python 3.11
```

This will print the requirement you need to ensure that numpy supports that Python:
```bash
λ python_readiness -p numpy --python 3.13
numpy>=2.1.0      # has_classifier_and_explicit_wheel
λ python_readiness -p numpy --python 3.12
numpy>=1.26.0     # has_classifier_and_explicit_wheel
λ python_readiness -p numpy --python 3.11
numpy>=1.23.3     # has_classifier_and_explicit_wheel
λ python_readiness -p 'numpy>=2' --python 3.11
numpy>=2          # has_classifier_and_explicit_wheel (existing requirement ensures support)
```

**Check if a requirements file is ready for a specific Python:**
```bash
python_readiness -r requirements.txt --python 3.13
```

This will output new requirements that ensure your environment is restricted to versions that
will support the specified Python version. In particular, look at lines containing "previously".
These are the minimum versions you will need to upgrade to for support.

I find this really useful for updating constraints files when incrementally upgrading a large
codebase to a new Python.

**Check if your current environment is ready for the latest Python:**
```bash
python_readiness
```

**Check if another virtual environment is ready for the latest Python:**
```bash
python_readiness -e path/to/.venv
```

**See all options:**
```bash
python_readiness --help
```

## What are the exact definitions of readiness this uses?

Take a look at the code, in particular `support_from_files`.

It's primarily based on wheel tags and classifiers, but looks at some other metadata and has a
few interesting tricks.

`python_readiness` currently classifies package versions as one of the following levels of support:

Explicitly supported:
- `has_classifier_and_explicit_wheel`\
  Both `has_classifier` and `has_explicit_wheel` are true.
- `has_classifier`\
  Has a trove classifier for the corresponding Python version.
- `has_explicit_wheel`\
  Has a wheel that specifically supports the corresponding Python version (includes abi3 wheels targeting specifically that Python)
- `is_requires_python_lower_bound`\
  Niche, but if `Requires-Python: >=3.9` then the package explicitly supports 3.9.

Potentially supported:
- `has_viable_wheel`\
  Has a wheel that is installable on the Python version, but has no explicit indication that upstream has ever run it with that Python version.
- `totally_unknown`\
  This is usually because the package only provides an sdist.

Unsupported:
- `unsupported`

Also, if you're interested in looking at the code — the bisection code we use to find earliest
supported versions is interesting, since it can handle non-monotonic support, e.g. in the case of
backports.


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "python-readiness",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "Shantanu Jain",
    "author_email": "hauntsaninja@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/70/ec/b47eddc8ded58f7e18f7ebbdc3f618e5017c453a9bd01b594918cb6ca8bd/python_readiness-2.2.tar.gz",
    "platform": null,
    "description": "# python_readiness\n\nAre your dependencies ready for new Python?\n\n## Installation\n\n```bash\npip install python_readiness\n```\n\nAlternatives include:\n- `uvx python_readiness`\n- It's a single file script that contains PEP 723 metadata\n\n## Usage\n\n**Check if a specific package is ready for a specific Python:**\n```bash\npython_readiness -p numpy --python 3.11\n```\n\nThis will print the requirement you need to ensure that numpy supports that Python:\n```bash\n\u03bb python_readiness -p numpy --python 3.13\nnumpy>=2.1.0      # has_classifier_and_explicit_wheel\n\u03bb python_readiness -p numpy --python 3.12\nnumpy>=1.26.0     # has_classifier_and_explicit_wheel\n\u03bb python_readiness -p numpy --python 3.11\nnumpy>=1.23.3     # has_classifier_and_explicit_wheel\n\u03bb python_readiness -p 'numpy>=2' --python 3.11\nnumpy>=2          # has_classifier_and_explicit_wheel (existing requirement ensures support)\n```\n\n**Check if a requirements file is ready for a specific Python:**\n```bash\npython_readiness -r requirements.txt --python 3.13\n```\n\nThis will output new requirements that ensure your environment is restricted to versions that\nwill support the specified Python version. In particular, look at lines containing \"previously\".\nThese are the minimum versions you will need to upgrade to for support.\n\nI find this really useful for updating constraints files when incrementally upgrading a large\ncodebase to a new Python.\n\n**Check if your current environment is ready for the latest Python:**\n```bash\npython_readiness\n```\n\n**Check if another virtual environment is ready for the latest Python:**\n```bash\npython_readiness -e path/to/.venv\n```\n\n**See all options:**\n```bash\npython_readiness --help\n```\n\n## What are the exact definitions of readiness this uses?\n\nTake a look at the code, in particular `support_from_files`.\n\nIt's primarily based on wheel tags and classifiers, but looks at some other metadata and has a\nfew interesting tricks.\n\n`python_readiness` currently classifies package versions as one of the following levels of support:\n\nExplicitly supported:\n- `has_classifier_and_explicit_wheel`\\\n  Both `has_classifier` and `has_explicit_wheel` are true.\n- `has_classifier`\\\n  Has a trove classifier for the corresponding Python version.\n- `has_explicit_wheel`\\\n  Has a wheel that specifically supports the corresponding Python version (includes abi3 wheels targeting specifically that Python)\n- `is_requires_python_lower_bound`\\\n  Niche, but if `Requires-Python: >=3.9` then the package explicitly supports 3.9.\n\nPotentially supported:\n- `has_viable_wheel`\\\n  Has a wheel that is installable on the Python version, but has no explicit indication that upstream has ever run it with that Python version.\n- `totally_unknown`\\\n  This is usually because the package only provides an sdist.\n\nUnsupported:\n- `unsupported`\n\nAlso, if you're interested in looking at the code \u2014 the bisection code we use to find earliest\nsupported versions is interesting, since it can handle non-monotonic support, e.g. in the case of\nbackports.\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Are your dependencies ready for new Python?",
    "version": "2.2",
    "project_urls": {
        "homepage": "https://github.com/hauntsaninja/python_readiness",
        "repository": "https://github.com/hauntsaninja/python_readiness"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "24e9a717577f622e810d6a0ca616c99dce71509a200472d0124fc1e59605ecc9",
                "md5": "8cd7d033b5d6bb59631cc35eaca51866",
                "sha256": "20b2ce042bdd054c8df437ef4bac553d81c9a97587847afc446c5825c35c68c8"
            },
            "downloads": -1,
            "filename": "python_readiness-2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8cd7d033b5d6bb59631cc35eaca51866",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 11769,
            "upload_time": "2024-10-10T07:08:13",
            "upload_time_iso_8601": "2024-10-10T07:08:13.694650Z",
            "url": "https://files.pythonhosted.org/packages/24/e9/a717577f622e810d6a0ca616c99dce71509a200472d0124fc1e59605ecc9/python_readiness-2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "70ecb47eddc8ded58f7e18f7ebbdc3f618e5017c453a9bd01b594918cb6ca8bd",
                "md5": "56f99b0b7bfd48b55a74f9d260add08c",
                "sha256": "d34a471edd937eb0a64eee68796b4216b3ae0e69e3b93cd48f606cd85e048f60"
            },
            "downloads": -1,
            "filename": "python_readiness-2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "56f99b0b7bfd48b55a74f9d260add08c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 11876,
            "upload_time": "2024-10-10T07:08:15",
            "upload_time_iso_8601": "2024-10-10T07:08:15.415812Z",
            "url": "https://files.pythonhosted.org/packages/70/ec/b47eddc8ded58f7e18f7ebbdc3f618e5017c453a9bd01b594918cb6ca8bd/python_readiness-2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-10 07:08:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hauntsaninja",
    "github_project": "python_readiness",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "python-readiness"
}
        
Elapsed time: 0.30346s