CEP idea: Standardized user agent strings
- Dominant language
- No language data
- Stars
- 34
- Forks
- 41
- Avg merge
- 1h 46m
- Merged PRs (30d)
- 1
Description
It's really tricky to get accurate usage or download data for given package versions, platforms, etc, that can inform decision making (e.g. [dropping osx-64](https://github.com/conda-forge/conda-forge.github.io/issues/2646)).
Different conda clients are using different user agent strings for their repodata and package downloads so, even [if we could query those](https://github.com/conda/infrastructure/issues/1018), we could only do so for `conda` requests. Other tools like `mamba`, `pixi` or `rattler-build` are not providing as much information. We would also need a mechanism for specific contexts to extend the user agent with custom values (e.g. conda-forge might want to [flag their internal CI jobs](https://github.com/anaconda/anaconda-package-data/issues/64) so they don't add noise to the real user data).
For example, in `conda`, the lack of a standard way to do so results in [runtime patches like this](https://github.com/anaconda/anaconda-anon-usage/blob/main/anaconda_anon_usage/patch.py).
I propose two things:
- Standardize which contents must be present in every user agent
- Recommend a mechanism to extend it with added value pairs (similar to [`pip`'s custom JSON user agent strings](https://github.com/pypa/pip/pull/5550))
References:
- https://github.com/anaconda/anaconda-package-data/issues/64
- https://github.com/conda/infrastructure/issues/1018
- https://discuss.python.org/t/pre-pep-user-agent-schema-for-http-requests-against-remote-package-indices/104006
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.