You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from the `setuptools docs <http://pythonhosted.org/setuptools/setuptools.html>`_.
420
416
417
+
Choosing a versioning scheme
418
+
----------------------------
419
+
420
+
Different Python projects may use different versioning schemes, but all of them will comply with the `public version scheme
421
+
<https://www.python.org/dev/peps/pep-0440/#public-version-identifiers>`_ specified in :ref:`PEP440 <pypa:PEP440s>`. Here are some examples of compliant version numbers::
422
+
423
+
1.2.0.dev1 # Development release
424
+
1.2.0a1 # Alpha Release
425
+
1.2.0b1 # Beta Release
426
+
1.2.0rc1 # Release Candidate
427
+
1.2.0 # Final Release
428
+
1.2.0.post1 # Post Release
429
+
430
+
Recommended versioning scheme
431
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
432
+
433
+
For new projects, the recommended versioning scheme is based on `Semantic Versioning <http://semver.org>`_, but adopts a different approach to handling pre-releases and build metadata.
434
+
435
+
The essence of semantic versioning is a 3-part MAJOR.MINOR.MAINTENANCE numbering scheme, where the project author increments:
436
+
437
+
1. MAJOR version when they make incompatible API changes,
438
+
2. MINOR version when they add functionality in a backwards-compatible manner, and
439
+
3. MAINTENANCE version when they make backwards-compatible bug fixes.
440
+
441
+
Adopting this approach as a project author allows users to make use of `"compatible release" <https://www.python.org/dev/peps/pep-0440/#compatible-release>`_ specifiers, where ``name ~= X.Y`` requires at least release X.Y, but also allows any later release with a matching MAJOR version.
442
+
443
+
Python projects adopting semantic versioning should abide by clauses 1-8 of the `Semantic Versioning 2.0.0 specification <http://semver.org>`_.
444
+
445
+
Date based versioning
446
+
*********************
447
+
448
+
Semantic versioning is not a suitable choice for all projects, such as those with a regular time based release cadence and a deprecation process that provides warnings for a number of releases prior to removal of a feature.
449
+
450
+
Version numbers for date based projects typically take the form of YEAR.MONTH (for example, ``12.04``, ``15.10``).
451
+
452
+
Serial versioning
453
+
*****************
454
+
455
+
This is the simplest possible versioning scheme, and consists of a single number which is incremented every release.
456
+
457
+
While serial versioning is very easy to manage as a developer, it is the hardest to track as an end user, as serial version numbers convey little or no information regarding API backwards compatibility.
458
+
459
+
460
+
Pre-release versioning
461
+
~~~~~~~~~~~~~~~~~~~~~~
462
+
463
+
Regardless of the base versioning scheme, pre-releases for a given final release may be published as:
464
+
465
+
* zero or more dev releases (denoted with a ".devN" suffix)
466
+
* zero or more alpha releases (denoted with a ".aN" suffix)
467
+
* zero or more beta releases (denoted with a ".bN" suffix)
468
+
* zero or more release candidates (denoted with a ".rcN" suffix)
469
+
470
+
``pip`` and other modern Python package installers ignore pre-releases by default when deciding which versions of dependencies to install.
471
+
472
+
473
+
Local version identifiers
474
+
~~~~~~~~~~~~~~~~~~~~~~~~~
475
+
476
+
Public version identifiers are designed to support distribution via :term:`PyPI <Python Package Index (PyPI)>`. Python's software distribution tools also support the notion of a `local version identifier <https://www.python.org/dev/peps/pep-0440/#local-version-identifiers>`_, which can be used to identify local development builds not intended for publication, or modified variants of a release maintained by a redistributor.
477
+
478
+
A local version identifier takes the form ``<public version identifier>+<local version label>``. For example::
479
+
480
+
1.2.0.dev1+hg.5.b11e5e6f0b0b # 5th VCS commmit since 1.2.0.dev1 release
481
+
1.2.1+fedora.4 # Package with downstream Fedora patches applied
0 commit comments