[bumpversion]
-current_version = 49.3.1
+current_version = 49.3.2
commit = True
tag = True
-vv49.3.1
+v49.3.2
+-------
+
+* #2300: Improve the ``safe_version`` function documentation
+* #2297: Once again, in stubs prefer exec_module to the deprecated load_module.
+
+
+v49.3.1
--------
* #2316: Removed warning when ``distutils`` is imported before ``setuptools`` when ``distutils`` replacement is not enabled.
See ``to_filename()``.
``safe_version(version)``
- This will return the normalized form of any PEP 440 version, if the version
- string is not PEP 440 compatible than it is similar to ``safe_name()``
- except that spaces in the input become dots, and dots are allowed to exist
- in the output. As with ``safe_name()``, if you are generating a filename
- from this you should replace any "-" characters in the output with
- underscores.
+ This will return the normalized form of any PEP 440 version. If the version
+ string is not PEP 440 compatible, this function behaves similar to
+ ``safe_name()`` except that spaces in the input become dots, and dots are
+ allowed to exist in the output. As with ``safe_name()``, if you are
+ generating a filename from this you should replace any "-" characters in
+ the output with underscores.
``safe_extra(extra)``
Return a "safe" form of an extra's name, suitable for use in a requirement
include_package_data = True
packages = find:
scripts =
- bin/first.py
- bin/second.py
+ bin/first.py
+ bin/second.py
install_requires =
- requests
- importlib; python_version == "2.6"
+ requests
+ importlib; python_version == "2.6"
[options.package_data]
* = *.txt, *.rst
[metadata]
keywords =
- one
- two
+ one
+ two
* In some cases, complex values can be provided in dedicated subsections for
clarity.
[metadata]
name = setuptools
-version = 49.3.1
+version = 49.3.2
description = Easily download, build, install, upgrade, and uninstall Python packages
author = Python Packaging Authority
author_email = distutils-sig@python.org
_stub_template = textwrap.dedent("""
def __bootstrap__():
global __bootstrap__, __loader__, __file__
- import sys, pkg_resources
- from importlib.machinery import ExtensionFileLoader
+ import sys, pkg_resources, importlib.util
__file__ = pkg_resources.resource_filename(__name__, %r)
__loader__ = None; del __bootstrap__, __loader__
- ExtensionFileLoader(__name__,__file__).load_module()
+ spec = importlib.util.spec_from_file_location(__name__,__file__)
+ mod = importlib.util.module_from_spec(spec)
+ spec.loader.exec_module(mod)
__bootstrap__()
""").lstrip()
with open(pyfile, 'w') as f:
'\n'.join([
"def __bootstrap__():",
" global __bootstrap__, __file__, __loader__",
- " import sys, os, pkg_resources" + if_dl(", dl"),
- " from importlib.machinery import ExtensionFileLoader",
+ " import sys, os, pkg_resources, importlib.util" +
+ if_dl(", dl"),
" __file__ = pkg_resources.resource_filename"
"(__name__,%r)"
% os.path.basename(ext._file_name),
" try:",
" os.chdir(os.path.dirname(__file__))",
if_dl(" sys.setdlopenflags(dl.RTLD_NOW)"),
- " ExtensionFileLoader(__name__,",
- " __file__).load_module()",
+ " spec = importlib.util.spec_from_file_location(",
+ " __name__, __file__)",
+ " mod = importlib.util.module_from_spec(spec)",
+ " spec.loader.exec_module(mod)",
" finally:",
if_dl(" sys.setdlopenflags(old_flags)"),
" os.chdir(old_dir)",