Skip to content

Commit cde9913

Browse files
committed
enhance setup & clarify readme
1 parent bc7598c commit cde9913

File tree

5 files changed

+41
-7
lines changed

5 files changed

+41
-7
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
python-version: ${{ matrix.python-version }}
2020
- run: python -m pip install --upgrade pip
2121
- run: pip install build pytest
22+
- run: pip install -e .
2223
- run: pytest
2324
build:
2425
runs-on: ubuntu-latest

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ cython_debug/
186186
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187187
# and can be added to the global gitignore or merged into this file. However, if you prefer,
188188
# you could uncomment the following to ignore the entire vscode folder
189-
# .vscode/
189+
.vscode/
190190

191191
# Ruff stuff:
192192
.ruff_cache/

README.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,37 @@
1-
# pyupgradecheck
1+
# 🐍 pyupgradecheck
22

3-
"Is there a tool for checking Python upgrade-compatibility?" — people explicitly asking for utilities to check if packages support a target Python version.
3+
Quickly see which of your installed packages are ready for your next Python version.
4+
5+
### Example
6+
7+
```bash
8+
$ pyupgradecheck 3.13
9+
requests 2.32.3: supported (PyPI requires_python: >=3.7)
10+
some-old-lib 1.2.0: incompatible (PyPI requires_python: <3.10)
11+
```
12+
13+
### Install
14+
15+
```bash
16+
pip install pyupgradecheck
17+
```
18+
19+
### Use programmatically
20+
21+
```python
22+
from pyupgradecheck import check_environment
23+
print(check_environment("3.13"))
24+
```
25+
26+
### CLI help
27+
28+
```bash
29+
pyupgradecheck --help
30+
```
31+
32+
### Contributing
33+
PRs welcome 💖 — run tests with:
34+
35+
```bash
36+
pytest
37+
```

pyupgradecheck/checker.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from typing import Dict, List, Optional, Tuple
77

88
try:
9-
# py3.8+
109
from importlib import metadata as importlib_metadata
1110
except Exception:
1211
import importlib_metadata
@@ -68,7 +67,7 @@ def check_pkg_compatibility(
6867
req = fetch_pypi_requires_python(pkg)
6968
spec = parse_requires_python(req)
7069
if spec is not None:
71-
# packaging accepts versions like '>=3.8'
70+
# packaging accepts versions like '>=3.9'
7271
try:
7372
target_v = Version(target_python)
7473
except InvalidVersion:

pyupgradecheck/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ def main():
99
prog="pyupgradecheck",
1010
description="Check installed packages for Python version compatibility.",
1111
)
12-
p.add_argument("target", help="Target Python version (e.g. 3.11)")
12+
p.add_argument("target", help="Target Python version (e.g. 3.13)")
1313
p.add_argument("--packages", "-p", nargs="+", help="Specific packages to check")
14-
p.add_argument("--json", action="store_true", help="Emit json")
14+
p.add_argument("--json", action="store_true", help="Emit json output")
1515
args = p.parse_args()
1616
report = check_environment(args.target, args.packages)
1717
if args.json:

0 commit comments

Comments
 (0)