Use mac version from python for linehaul information#2509
Conversation
|
Note, it's not quite just major.minor, it should include the product version from the plist as-is based on my testing with pip. os_info got this right, hence why I used it for testing 😅 |
|
Oh interesting, i'd need some mac user to test this then |
|
🤔 |
|
@trag1c platform.mac version can include more. You're in 14.4 which got released, so its only major.minor (currently) Once 14.4.1 gets released you'll get 14.4.1. |
|
Yeah I'm aware (I just recently updated from 14.2.1, what a shame 😢), but I thought you were referring to even more data than just |
|
@konstin If we want to use python and be compatible, we should just use the raw output of platform.mac_ver()[0]. That should take care of the test failing right now. |
I'm guessing beta releases could be different 🤔 |
Sounds good, though it needs a mac user as reviewer |
|
What do you want me to test? |
|
As @samypr100 said, we should pass |
|
I get |
|
Here's what I get on an 14.3.1 mac |
|
Let's just send |
|
Agreed, that's exactly what Pip does too https://github.com/pypa/pip/blob/24.0/src/pip/_internal/network/session.py#L159 |
|
I guess this isn't trivial because we're not currently storing patch versions on uv/crates/platform-tags/src/platform.rs Line 46 in c296da3 I'm not sure linehaul information justifies further changes here... patch macOS versions are not used afaik. We generate platform tags based on a major minor tuple (which is why we don't bother storing the optional patch version now). I think we should consider documenting this caveat and moving on? |
|
@zanieb the code currently behaves as expected per #2493 and it's fully compatible with linehaul. No more changes are technically needed. Since it seems its not, I'd proposed we don't merge this change at this time to avoid sending invalid linehaul statistics which could be undesired. |
|
I'd prefer to use all the information we're already getting from Python (as we do here). I feel like we should see if the patch version is actually important to them. It seems weird that they'd have e.g. |
|
Fair, I don't think their parser cares and will use the value as-is, so I think it should be ok from a parser perspective. My original concern was more that it could inflate statistics a bit biased towards versions without For example, say you have a 100 users using pip and uv where 50 of them have OSX version For what it's worth, they do test with osx patch versions https://github.com/pypi/linehaul-cloud-function/blob/main/tests/unit/ua/fixtures/pip.yml. Worth asking @pradyunsg, as the original issue creator, does having the patch version matter in OSX in distro? |
|
I think it's OK to not have the patch version, but I'm also not a MacOS expert. |
ee3e87f to
e6c2cc4
Compare
|
I hope you don't mind I pushed 637a9ce in an attempt to resolve the error you were encountering. We really ought to use snapshots for these lineinfo tests though. |
|
Thanks I'm merging it now with the |
See #2493 (review).