Skip to content

Poetry user agent for all requests #8487

@Agalin

Description

@Agalin
  • I have searched the issues of this repo and believe that this is not a duplicate. There is a similar issue (Set user agent for pip install #2367) which is mostly about PyPI stats and no longer valid as pip is not used.
  • I have searched the FAQ and general documentation and believe that my question is not already covered.

Feature Request

Poetry should set its own user agent. Currently it makes all requests (both for package versions list retrieval and package download) with the default one provided by the requests library: python-requests/<version>, e.g. python-requests/2.31.0.

Lack of an unique user agent makes it tricky to differentiate between installer and human requests.

Why is it important?

We're using Devpi for our internal index. It supports both human-readable and simple listings of packages. Simple one is available through a dedicated suffix or if one of two requirements is matched - user agent is specific to installers or Accept header is set to installer-specific. See this code for currently supported values.

But there is another reason such a differentiation is useful - it makes it possible to show cached data to installers while avoiding stale results when traversed manually.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureFeature requests/implementations

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions