Skip to content

Commit a5fb32d

Browse files
ncoghlanhugovk
andauthored
PEP 396: Reclassify as Withdrawn (#4074)
The ``__version__`` runtime convention hasn't been rejected, as it's still a good way to version import packages instead of (or in addition to) distribution packages. We just concluded that this PEP wasn't the right vehicle for documenting it, which is better reflected as a withdrawal rather than as a rejection. --------- Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
1 parent 862d6b1 commit a5fb32d

File tree

1 file changed

+29
-6
lines changed

1 file changed

+29
-6
lines changed

peps/pep-0396.rst

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
PEP: 396
22
Title: Module Version Numbers
3-
Version: $Revision: 65628 $
4-
Last-Modified: $Date: 2008-08-10 09:59:20 -0400 (Sun, 10 Aug 2008) $
53
Author: Barry Warsaw <barry@python.org>
6-
Status: Rejected
4+
Status: Withdrawn
75
Type: Informational
86
Topic: Packaging
9-
Content-Type: text/x-rst
107
Created: 16-Mar-2011
118
Post-History: 05-Apr-2011
129

10+
.. withdrawn::
11+
12+
Refer to :ref:`packaging:runtime-version-access` and
13+
:ref:`packaging:single-source-version` in the Python
14+
Packaging User Guide for up to date recommendations on
15+
accessing package version information at runtime,
16+
and on defining runtime ``__version__`` attributes which are
17+
automatically kept consistent with package distribution metadata
18+
1319

1420
Abstract
1521
========
@@ -25,14 +31,28 @@ Conformance with this PEP is optional, however other Python tools
2531
(such as ``distutils2`` [1]_) may be adapted to use the conventions
2632
defined here.
2733

28-
PEP Rejection
29-
=============
34+
35+
PEP Rejection/Withdrawal
36+
========================
3037

3138
This PEP was formally rejected on 2021-04-14. The packaging ecosystem
3239
has changed significantly in the intervening years since this PEP was
3340
first written, and APIs such as ``importlib.metadata.version()`` [11]_
3441
provide for a much better experience.
3542

43+
This rejection was reclassified as a withdrawal on 2024-10-21,
44+
as the previous state was being misinterpreted [12]_ as suggesting
45+
that *no* modules should be defining ``__version__`` attributes,
46+
which definitely isn't the case.
47+
48+
Modules are still free to define ``__version__`` if they choose to.
49+
However, choosing *not* to do so won't interfere with looking up
50+
the version information for installed distribution packages, so an
51+
Informational PEP isn't the right tool to document community
52+
conventions around the use of module ``__version__`` attributes
53+
(they're better covered as part of the Python Packaging User Guide).
54+
55+
3656
User Stories
3757
============
3858

@@ -287,6 +307,9 @@ References
287307
.. [11] importlib.metadata
288308
(https://docs.python.org/3/library/importlib.metadata.html#distribution-versions)
289309
310+
.. [12] Misinterpreting the significance of this PEP's rejection
311+
(https://discuss.python.org/t/please-make-package-version-go-away/58501)
312+
290313
291314
Copyright
292315
=========

0 commit comments

Comments
 (0)