Skip to content

Add a recommended-packages.txt file #76079

Open

Description

@ncoghlan
BPO 31898
Nosy @ncoghlan, @merwok, @pganssle, @tirkarthi, @nanjekyejoannah

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2017-10-30.05:17:27.235>
labels = ['3.8', 'type-feature', '3.7', 'docs']
title = 'Add a `recommended-packages.txt` file'
updated_at = <Date 2020-07-05.00:08:25.340>
user = 'https://github.com/ncoghlan'

bugs.python.org fields:

activity = <Date 2020-07-05.00:08:25.340>
actor = 'nanjekyejoannah'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2017-10-30.05:17:27.235>
creator = 'ncoghlan'
dependencies = []
files = []
hgrepos = []
issue_num = 31898
keywords = []
message_count = 7.0
messages = ['305210', '305212', '305285', '305288', '305534', '321107', '372501']
nosy_count = 5.0
nosy_names = ['ncoghlan', 'eric.araujo', 'p-ganssle', 'xtreak', 'nanjekyejoannah']
pr_nums = []
priority = 'normal'
resolution = None
stage = 'needs patch'
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue31898'
versions = ['Python 3.7', 'Python 3.8']

Possible follow-up: #76080

Activity

  1. ncoghlan commented on Oct 30, 2017

    @ncoghlan
    ContributorAuthor

    As per the python-ideas thread starting at https://mail.python.org/pipermail/python-ideas/2017-October/047508.html, this is proposal to add a pip -r compatible recommended-packages.txt file to the venv documentation that summarises replacement module recommendations in other parts of the standard library documentation.

    Suggested entries are:

    requests # Recommendation in urllib.request docs
    regex # Recommendation in re docs
    cffi # More typesafe alternative to ctypes
    six # Python 2/3 compatibility library
    setuptools # Alternative to distutils that supports modern packaging standards

    I'm also tempted to suggest pytz as the preferred source of up-to-date named timezones, but I'm not sure how often that's really needed in situations where you can't just depend on it explicitly instead.

  2. self-assigned this
    on Oct 30, 2017
  3. added
    3.7 (EOL)
    3.8 (EOL)
    docs
    type-feature
    on Oct 30, 2017
  4. ncoghlan commented on Oct 30, 2017

    @ncoghlan
    ContributorAuthor

    https://bugs.python.org/issue31899 is a follow-up issue to discuss whether or not it would make sense to expand these recommendations to cover explicit compatibility testing against these libraries for CPython updates

  5. ncoghlan commented on Oct 31, 2017

    @ncoghlan
    ContributorAuthor

    As part of this, a new subsection would be added to https://docs.python.org/devguide/stdlibchanges.html to document the process for adding new packages to the recommended packages list: propose them for standard library inclusion, and while "No" is still the most likely outcome, being added to the recommended packages list would be a potential middle ground for "Approved in principle, but the actual logistics of doing so probably don't work".

  6. ncoghlan commented on Oct 31, 2017

    @ncoghlan
    ContributorAuthor

    Thinking about it further, this list is actually going to be version independent, suggest it may actually belong somewhere outside the main documentation.

    The Developer's Guide may be a reasonable stopgap measure until there's a better option available (e.g. if I ever get around to turning https://github.com/python/redistributor-guide/ into something more than a nearly empty repo)

  7. changed the title [-]Add `recommended-packages.txt` to `venv` documentation[/-] [+]Add a `recommended-packages.txt` file[/+] on Oct 31, 2017
  8. ncoghlan commented on Nov 4, 2017

    @ncoghlan
    ContributorAuthor

    In https://mail.python.org/pipermail/python-ideas/2017-October/047599.html, Guido suggested managing this as an occasionally updated Informational PEP (somewhat akin to PEP-394), and I think that will actually work fairly well:

    • it clearly gives the information PEP level status (which merely being in the developer guide wouldn't)
    • it means the guidance can be mostly version independent (which would be a source of irritation if the list was in the reference documentation)
    • it means we can use the same process for amendments as we do for other informational PEPs (a combination of python-dev discussions, bugs.python.org issues, and specific PR reviews)

    My current thoughts on structuring that:

    Title: Recommended Independently Updated Python Packages

    Tone/Audience: I'll aim the PEP primarily at answering the "Why isn't <X> in the standard library?" question, as that helps us keep the list focused on python-dev specific concerns and avoid turning it into a general categorised list of Python library recommendations like https://github.com/vinta/awesome-python

    The key criterion for something being mentioned will be when the standard library *already* contains comparable functionality, but there's a language version independent third party alternative that even core developers will often use instead. That list is currently:

    urllib.requests -> requests (pace of change in web standards)
    re -> regex (technical challenges with backend migration)
    datetime.timezone -> pytz.timezone (updates driven by IANA timezone database)
    ctypes -> cffi (build tools should be version independent)
    distutils -> setuptools (build tools should be version independent)

    I'll likely also include a list of libraries where version independence is a key feature, so they've never even been proposed for stdlib inclusion, despite their broad popularity:

    • the six compatibility module
    • various backport libraries (e.g. importlib2, contextlib2, unittest2)
    • third party libraries like lxml

    I'm not sure if or how I'll cover the scientific Python stack (especially NumPy.ndarray being the reference implementation for multi-dimensional arrays), but Nathaniel Smith has some interesting thoughts on that in https://mail.python.org/pipermail/python-ideas/2017-November/047636.html

  9. pganssle commented on Jul 5, 2018

    @pganssle
    Member

    datetime.timezone -> pytz.timezone (updates driven by IANA timezone database)

    I will note that pytz.timezone and datetime.timezone are not really comparable (they do two very different things), and as of Python 3.6, dateutil.tz is the recommended source for IANA time zones, not pytz, per https://docs.python.org/3/library/datetime.html

  10. ncoghlan commented on Jun 28, 2020

    @ncoghlan
    ContributorAuthor

    Removing the issue assignment, as I'm not actively working on this (although I still think it's a reasonable idea).

  11. removed their assignment
    on Jun 28, 2020
  12. transferred this issue fromon Apr 10, 2022
  13. encukou commented on May 29, 2025

    @encukou
    Member

    I don't think this issue aged well. regex and cffi are still valid; we might recommend attrs over dataclasses or tomlkit over tomllib; babel over gettext; there's cryptography...

    I don't think the core dev team should maintain such a list. The "why isn't in the standard library?" is nowadays better answered by "because there's no pressing reason to add in; get it from PyPI".

    I don't think we should keep this idea filed as an issue. Would you be OK with closing it?

  14. added
    pending
    on May 29, 2025
  15. ncoghlan commented on May 29, 2025

    @ncoghlan
    ContributorAuthor

    I don't think closing the issue solves the problem, as there are recommendations in some of the standard library modules, but they're not necessarily being kept up to date over time (for example, I'd recommend httpx over requests as a client-side HTTP library these days, but the urllib docs still suggest the latter).

    The tomllib docs do mention tomlkit and tomli-w as options for folks looking for read/write support.

    I added some suggestions for potential 3rd-party argument parsing alternatives when we were rescuing optparse and getopt from their previous soft deprecation (but I also know that at least Guido would prefer I hadn't done that - they just didn't annoy him enough to actively pursue removing them once they were there).

    The C API docs now have a consolidated list of recommended binding generators in https://docs.python.org/3/c-api/intro.html#recommended-third-party-tools

    So the status quo is that these recommendations do exist, but they're completely ad hoc: they're added when a core dev feels strongly enough about a recommendation that they add it in the interest of users at a given point in time (and no other core dev objects strongly enough to remove it), but there's no consistent review mechanism that tracks all of the recommendations we're making and regularly asks "Is this recommendation still serving the interests of users, or does it need to be updated or removed?".

    At time of writing, there are 641,215 projects on PyPI. While it's far from being a perfect solution, the core devs collectively listing out the tools we would reach for in problem domains that are common enough to have related code in the standard library is going to offer a better on-ramp to the wider ecosystem than leaving them to figure things out from the internet at large (or by asking their friendly neighbourhood LLM to recommend third party packages and getting responses that sound plausible, but may not actually exist).

  16. encukou commented on May 30, 2025

    @encukou
    Member

    I don't think closing the issue solves the problem

    The issue is rather vague on what the specific problem is.

    Closing the issue doesn't solve the problems, but neither does keeping it open here, especially under the current title.
    “You'll need to write a PEP for that” is usually a reason to close an issue -- if it's a newly filed one of course.


    So, a concrete next step here would be to a list of recommendations we currently have in the docs, to starting point?
    I guess a good way would be to add a Sphinx extension and replace all the .. seealso:: (and plain sections) with something like .. thirdparty::, which would add a standardized disclaimer, and would allow easily extracting the full list.

  17. removed
    pending
    on May 30, 2025
  18. removed
    3.8 (EOL)
    3.7 (EOL)
    on May 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docstype-feature

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions