alexgolec / schwab-py

Unofficial API wrapper for the Schwab HTTP API
MIT License
203 stars 48 forks source link

Pip automatically installs pre-release version when using python 3.9 #176

Open jasonfiammetta opened 1 month ago

jasonfiammetta commented 1 month ago

Description of Bug I've got multiple environments, one of which was using python 3.9. This is my fault for ignoring the 3.10 requirement, but the damage wasn't readily apparent. Using pip install schwab-py on version 3.9 will install pre-release version 0.0.0a25, as the latest version with requires Python >=3.8. There's no warning that this version is outdated.

Code to Reproduce

$ python3.9 -m venv .venv
$ source .venv/bin/activate
$ pip install schwab-py

Or with -v:

$ python3.9 -m venv .venv
$ source .venv/bin/activate
$ pip install -v schwab-py
...
Installing collected packages: schwab-py
Successfully installed schwab-py-0.0.0a25

Expected Behavior Either refusing to install without 3.10, or a warning somewhere obvious on version 0.0.0a25 (and prior versions) that it is outdated. (Especially when using the streaming API, which logs in and takes data just fine but mislabels all of it.)

For instance, on attempting to install the correct version on 3.9:

$ pip install schwab-py==1.3.0
ERROR: Ignored the following versions that require a different python version: 0.0.0a26 Requires-Python >=3.10; 0.0.0a27 Requires-Python >=3.10; 0.0.0a28 Requires-Python >=3.10; 0.0.0a29 Requires-Python >=3.10; 1.0.0 Requires-Python >=3.10; 1.0.1 Requires-Python >=3.10; 1.1.0 Requires-Python >=3.10; 1.2.0 Requires-Python >=3.10; 1.2.1 Requires-Python >=3.10; 1.3.0 Requires-Python >=3.10
ERROR: Could not find a version that satisfies the requirement schwab-py==1.3.0 (from versions: 0.0.0a0, 0.0.0a1, 0.0.0a2, 0.0.0a3, 0.0.0a4, 0.0.0a5, 0.0.0a6, 0.0.0a7, 0.0.0a8, 0.0.0a9, 0.0.0a10, 0.0.0a11, 0.0.0a13, 0.0.0a14, 0.0.0a15, 0.0.0a16, 0.0.0a17, 0.0.0a18, 0.0.0a19, 0.0.0a20, 0.0.0a21, 0.0.0a22, 0.0.0a23, 0.0.0a24, 0.0.0a25)
ERROR: No matching distribution found for schwab-py==1.3.0

Actual Behavior Installs outdated version without complaint.

Again, my fault, but maybe it'll save somebody else the trouble. I'm not sure if there are options on Pypi to address this, or if it'd be more appropriate to up the required version on all pre-releases too. Or add Python < 3.10 to their requirements.