android-notify 1.60.0__py3-none-any.whl → 1.60.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of android-notify might be problematic. Click here for more details.
- android_notify/config.py +1 -1
- {android_notify-1.60.0.dist-info → android_notify-1.60.2.dist-info}/METADATA +4 -4
- {android_notify-1.60.0.dist-info → android_notify-1.60.2.dist-info}/RECORD +375 -6
- venv/Lib/site-packages/_distutils_hack/__init__.py +239 -0
- venv/Lib/site-packages/_distutils_hack/override.py +1 -0
- venv/Lib/site-packages/pkg_resources/__init__.py +3713 -0
- venv/Lib/site-packages/pkg_resources/py.typed +0 -0
- venv/Lib/site-packages/pkg_resources/tests/__init__.py +0 -0
- venv/Lib/site-packages/pkg_resources/tests/data/my-test-package-source/setup.py +7 -0
- venv/Lib/site-packages/pkg_resources/tests/test_find_distributions.py +56 -0
- venv/Lib/site-packages/pkg_resources/tests/test_integration_zope_interface.py +54 -0
- venv/Lib/site-packages/pkg_resources/tests/test_markers.py +8 -0
- venv/Lib/site-packages/pkg_resources/tests/test_pkg_resources.py +485 -0
- venv/Lib/site-packages/pkg_resources/tests/test_resources.py +869 -0
- venv/Lib/site-packages/pkg_resources/tests/test_working_set.py +505 -0
- venv/Lib/site-packages/setuptools/__init__.py +248 -0
- venv/Lib/site-packages/setuptools/_core_metadata.py +337 -0
- venv/Lib/site-packages/setuptools/_discovery.py +33 -0
- venv/Lib/site-packages/setuptools/_distutils/__init__.py +14 -0
- venv/Lib/site-packages/setuptools/_distutils/_log.py +3 -0
- venv/Lib/site-packages/setuptools/_distutils/_macos_compat.py +12 -0
- venv/Lib/site-packages/setuptools/_distutils/_modified.py +95 -0
- venv/Lib/site-packages/setuptools/_distutils/_msvccompiler.py +16 -0
- venv/Lib/site-packages/setuptools/_distutils/archive_util.py +294 -0
- venv/Lib/site-packages/setuptools/_distutils/ccompiler.py +26 -0
- venv/Lib/site-packages/setuptools/_distutils/cmd.py +554 -0
- venv/Lib/site-packages/setuptools/_distutils/command/__init__.py +23 -0
- venv/Lib/site-packages/setuptools/_distutils/command/_framework_compat.py +54 -0
- venv/Lib/site-packages/setuptools/_distutils/command/bdist.py +167 -0
- venv/Lib/site-packages/setuptools/_distutils/command/bdist_dumb.py +141 -0
- venv/Lib/site-packages/setuptools/_distutils/command/bdist_rpm.py +598 -0
- venv/Lib/site-packages/setuptools/_distutils/command/build.py +156 -0
- venv/Lib/site-packages/setuptools/_distutils/command/build_clib.py +201 -0
- venv/Lib/site-packages/setuptools/_distutils/command/build_ext.py +812 -0
- venv/Lib/site-packages/setuptools/_distutils/command/build_py.py +407 -0
- venv/Lib/site-packages/setuptools/_distutils/command/build_scripts.py +160 -0
- venv/Lib/site-packages/setuptools/_distutils/command/check.py +152 -0
- venv/Lib/site-packages/setuptools/_distutils/command/clean.py +77 -0
- venv/Lib/site-packages/setuptools/_distutils/command/config.py +358 -0
- venv/Lib/site-packages/setuptools/_distutils/command/install.py +805 -0
- venv/Lib/site-packages/setuptools/_distutils/command/install_data.py +94 -0
- venv/Lib/site-packages/setuptools/_distutils/command/install_egg_info.py +91 -0
- venv/Lib/site-packages/setuptools/_distutils/command/install_headers.py +46 -0
- venv/Lib/site-packages/setuptools/_distutils/command/install_lib.py +238 -0
- venv/Lib/site-packages/setuptools/_distutils/command/install_scripts.py +62 -0
- venv/Lib/site-packages/setuptools/_distutils/command/sdist.py +521 -0
- venv/Lib/site-packages/setuptools/_distutils/compat/__init__.py +18 -0
- venv/Lib/site-packages/setuptools/_distutils/compat/numpy.py +2 -0
- venv/Lib/site-packages/setuptools/_distutils/compat/py39.py +66 -0
- venv/Lib/site-packages/setuptools/_distutils/compilers/C/base.py +1394 -0
- venv/Lib/site-packages/setuptools/_distutils/compilers/C/cygwin.py +340 -0
- venv/Lib/site-packages/setuptools/_distutils/compilers/C/errors.py +24 -0
- venv/Lib/site-packages/setuptools/_distutils/compilers/C/msvc.py +614 -0
- venv/Lib/site-packages/setuptools/_distutils/compilers/C/tests/test_base.py +83 -0
- venv/Lib/site-packages/setuptools/_distutils/compilers/C/tests/test_cygwin.py +76 -0
- venv/Lib/site-packages/setuptools/_distutils/compilers/C/tests/test_mingw.py +48 -0
- venv/Lib/site-packages/setuptools/_distutils/compilers/C/tests/test_msvc.py +136 -0
- venv/Lib/site-packages/setuptools/_distutils/compilers/C/tests/test_unix.py +413 -0
- venv/Lib/site-packages/setuptools/_distutils/compilers/C/unix.py +422 -0
- venv/Lib/site-packages/setuptools/_distutils/compilers/C/zos.py +230 -0
- venv/Lib/site-packages/setuptools/_distutils/core.py +289 -0
- venv/Lib/site-packages/setuptools/_distutils/cygwinccompiler.py +31 -0
- venv/Lib/site-packages/setuptools/_distutils/debug.py +5 -0
- venv/Lib/site-packages/setuptools/_distutils/dep_util.py +14 -0
- venv/Lib/site-packages/setuptools/_distutils/dir_util.py +244 -0
- venv/Lib/site-packages/setuptools/_distutils/dist.py +1386 -0
- venv/Lib/site-packages/setuptools/_distutils/errors.py +108 -0
- venv/Lib/site-packages/setuptools/_distutils/extension.py +258 -0
- venv/Lib/site-packages/setuptools/_distutils/fancy_getopt.py +471 -0
- venv/Lib/site-packages/setuptools/_distutils/file_util.py +236 -0
- venv/Lib/site-packages/setuptools/_distutils/filelist.py +431 -0
- venv/Lib/site-packages/setuptools/_distutils/log.py +56 -0
- venv/Lib/site-packages/setuptools/_distutils/spawn.py +134 -0
- venv/Lib/site-packages/setuptools/_distutils/sysconfig.py +598 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/__init__.py +42 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/compat/__init__.py +0 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/compat/py39.py +40 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/support.py +134 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_archive_util.py +353 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_bdist.py +47 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_bdist_dumb.py +78 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_bdist_rpm.py +127 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_build.py +49 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_build_clib.py +134 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_build_ext.py +628 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_build_py.py +196 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_build_scripts.py +96 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_check.py +194 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_clean.py +45 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_cmd.py +107 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_config_cmd.py +87 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_core.py +130 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_dir_util.py +139 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_dist.py +552 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_extension.py +117 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_file_util.py +95 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_filelist.py +336 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_install.py +245 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_install_data.py +74 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_install_headers.py +33 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_install_lib.py +110 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_install_scripts.py +52 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_log.py +12 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_modified.py +126 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_sdist.py +470 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_spawn.py +141 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_sysconfig.py +319 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_text_file.py +127 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_util.py +243 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_version.py +80 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/test_versionpredicate.py +0 -0
- venv/Lib/site-packages/setuptools/_distutils/tests/unix_compat.py +17 -0
- venv/Lib/site-packages/setuptools/_distutils/text_file.py +286 -0
- venv/Lib/site-packages/setuptools/_distutils/unixccompiler.py +9 -0
- venv/Lib/site-packages/setuptools/_distutils/util.py +518 -0
- venv/Lib/site-packages/setuptools/_distutils/version.py +348 -0
- venv/Lib/site-packages/setuptools/_distutils/versionpredicate.py +175 -0
- venv/Lib/site-packages/setuptools/_distutils/zosccompiler.py +3 -0
- venv/Lib/site-packages/setuptools/_entry_points.py +94 -0
- venv/Lib/site-packages/setuptools/_imp.py +87 -0
- venv/Lib/site-packages/setuptools/_importlib.py +9 -0
- venv/Lib/site-packages/setuptools/_itertools.py +23 -0
- venv/Lib/site-packages/setuptools/_normalization.py +177 -0
- venv/Lib/site-packages/setuptools/_path.py +93 -0
- venv/Lib/site-packages/setuptools/_reqs.py +42 -0
- venv/Lib/site-packages/setuptools/_scripts.py +361 -0
- venv/Lib/site-packages/setuptools/_shutil.py +59 -0
- venv/Lib/site-packages/setuptools/_static.py +188 -0
- venv/Lib/site-packages/setuptools/_vendor/autocommand/__init__.py +27 -0
- venv/Lib/site-packages/setuptools/_vendor/autocommand/autoasync.py +142 -0
- venv/Lib/site-packages/setuptools/_vendor/autocommand/autocommand.py +70 -0
- venv/Lib/site-packages/setuptools/_vendor/autocommand/automain.py +59 -0
- venv/Lib/site-packages/setuptools/_vendor/autocommand/autoparse.py +333 -0
- venv/Lib/site-packages/setuptools/_vendor/autocommand/errors.py +23 -0
- venv/Lib/site-packages/setuptools/_vendor/backports/__init__.py +1 -0
- venv/Lib/site-packages/setuptools/_vendor/backports/tarfile/__init__.py +2937 -0
- venv/Lib/site-packages/setuptools/_vendor/backports/tarfile/__main__.py +5 -0
- venv/Lib/site-packages/setuptools/_vendor/backports/tarfile/compat/__init__.py +0 -0
- venv/Lib/site-packages/setuptools/_vendor/backports/tarfile/compat/py38.py +24 -0
- venv/Lib/site-packages/setuptools/_vendor/importlib_metadata/__init__.py +1083 -0
- venv/Lib/site-packages/setuptools/_vendor/importlib_metadata/_adapters.py +83 -0
- venv/Lib/site-packages/setuptools/_vendor/importlib_metadata/_collections.py +30 -0
- venv/Lib/site-packages/setuptools/_vendor/importlib_metadata/_compat.py +57 -0
- venv/Lib/site-packages/setuptools/_vendor/importlib_metadata/_functools.py +104 -0
- venv/Lib/site-packages/setuptools/_vendor/importlib_metadata/_itertools.py +73 -0
- venv/Lib/site-packages/setuptools/_vendor/importlib_metadata/_meta.py +67 -0
- venv/Lib/site-packages/setuptools/_vendor/importlib_metadata/_text.py +99 -0
- venv/Lib/site-packages/setuptools/_vendor/importlib_metadata/compat/__init__.py +0 -0
- venv/Lib/site-packages/setuptools/_vendor/importlib_metadata/compat/py311.py +22 -0
- venv/Lib/site-packages/setuptools/_vendor/importlib_metadata/compat/py39.py +36 -0
- venv/Lib/site-packages/setuptools/_vendor/importlib_metadata/diagnose.py +21 -0
- venv/Lib/site-packages/setuptools/_vendor/importlib_metadata/py.typed +0 -0
- venv/Lib/site-packages/setuptools/_vendor/inflect/__init__.py +3986 -0
- venv/Lib/site-packages/setuptools/_vendor/inflect/compat/__init__.py +0 -0
- venv/Lib/site-packages/setuptools/_vendor/inflect/compat/py38.py +7 -0
- venv/Lib/site-packages/setuptools/_vendor/inflect/py.typed +0 -0
- venv/Lib/site-packages/setuptools/_vendor/jaraco/collections/__init__.py +1091 -0
- venv/Lib/site-packages/setuptools/_vendor/jaraco/collections/py.typed +0 -0
- venv/Lib/site-packages/setuptools/_vendor/jaraco/context.py +361 -0
- venv/Lib/site-packages/setuptools/_vendor/jaraco/functools/__init__.py +633 -0
- venv/Lib/site-packages/setuptools/_vendor/jaraco/functools/__init__.pyi +125 -0
- venv/Lib/site-packages/setuptools/_vendor/jaraco/functools/py.typed +0 -0
- venv/Lib/site-packages/setuptools/_vendor/jaraco/text/__init__.py +624 -0
- venv/Lib/site-packages/setuptools/_vendor/jaraco/text/layouts.py +25 -0
- venv/Lib/site-packages/setuptools/_vendor/jaraco/text/show-newlines.py +33 -0
- venv/Lib/site-packages/setuptools/_vendor/jaraco/text/strip-prefix.py +21 -0
- venv/Lib/site-packages/setuptools/_vendor/jaraco/text/to-dvorak.py +6 -0
- venv/Lib/site-packages/setuptools/_vendor/jaraco/text/to-qwerty.py +6 -0
- venv/Lib/site-packages/setuptools/_vendor/more_itertools/__init__.py +6 -0
- venv/Lib/site-packages/setuptools/_vendor/more_itertools/__init__.pyi +2 -0
- venv/Lib/site-packages/setuptools/_vendor/more_itertools/more.py +4806 -0
- venv/Lib/site-packages/setuptools/_vendor/more_itertools/more.pyi +709 -0
- venv/Lib/site-packages/setuptools/_vendor/more_itertools/py.typed +0 -0
- venv/Lib/site-packages/setuptools/_vendor/more_itertools/recipes.py +1046 -0
- venv/Lib/site-packages/setuptools/_vendor/more_itertools/recipes.pyi +136 -0
- venv/Lib/site-packages/setuptools/_vendor/packaging/__init__.py +15 -0
- venv/Lib/site-packages/setuptools/_vendor/packaging/_elffile.py +110 -0
- venv/Lib/site-packages/setuptools/_vendor/packaging/_manylinux.py +263 -0
- venv/Lib/site-packages/setuptools/_vendor/packaging/_musllinux.py +85 -0
- venv/Lib/site-packages/setuptools/_vendor/packaging/_parser.py +354 -0
- venv/Lib/site-packages/setuptools/_vendor/packaging/_structures.py +61 -0
- venv/Lib/site-packages/setuptools/_vendor/packaging/_tokenizer.py +194 -0
- venv/Lib/site-packages/setuptools/_vendor/packaging/licenses/__init__.py +145 -0
- venv/Lib/site-packages/setuptools/_vendor/packaging/licenses/_spdx.py +759 -0
- venv/Lib/site-packages/setuptools/_vendor/packaging/markers.py +331 -0
- venv/Lib/site-packages/setuptools/_vendor/packaging/metadata.py +863 -0
- venv/Lib/site-packages/setuptools/_vendor/packaging/py.typed +0 -0
- venv/Lib/site-packages/setuptools/_vendor/packaging/requirements.py +91 -0
- venv/Lib/site-packages/setuptools/_vendor/packaging/specifiers.py +1020 -0
- venv/Lib/site-packages/setuptools/_vendor/packaging/tags.py +617 -0
- venv/Lib/site-packages/setuptools/_vendor/packaging/utils.py +163 -0
- venv/Lib/site-packages/setuptools/_vendor/packaging/version.py +582 -0
- venv/Lib/site-packages/setuptools/_vendor/platformdirs/__init__.py +627 -0
- venv/Lib/site-packages/setuptools/_vendor/platformdirs/__main__.py +55 -0
- venv/Lib/site-packages/setuptools/_vendor/platformdirs/android.py +249 -0
- venv/Lib/site-packages/setuptools/_vendor/platformdirs/api.py +292 -0
- venv/Lib/site-packages/setuptools/_vendor/platformdirs/macos.py +130 -0
- venv/Lib/site-packages/setuptools/_vendor/platformdirs/py.typed +0 -0
- venv/Lib/site-packages/setuptools/_vendor/platformdirs/unix.py +275 -0
- venv/Lib/site-packages/setuptools/_vendor/platformdirs/version.py +16 -0
- venv/Lib/site-packages/setuptools/_vendor/platformdirs/windows.py +272 -0
- venv/Lib/site-packages/setuptools/_vendor/tomli/__init__.py +11 -0
- venv/Lib/site-packages/setuptools/_vendor/tomli/_parser.py +691 -0
- venv/Lib/site-packages/setuptools/_vendor/tomli/_re.py +107 -0
- venv/Lib/site-packages/setuptools/_vendor/tomli/_types.py +10 -0
- venv/Lib/site-packages/setuptools/_vendor/tomli/py.typed +1 -0
- venv/Lib/site-packages/setuptools/_vendor/typeguard/__init__.py +48 -0
- venv/Lib/site-packages/setuptools/_vendor/typeguard/_checkers.py +993 -0
- venv/Lib/site-packages/setuptools/_vendor/typeguard/_config.py +108 -0
- venv/Lib/site-packages/setuptools/_vendor/typeguard/_decorators.py +235 -0
- venv/Lib/site-packages/setuptools/_vendor/typeguard/_exceptions.py +42 -0
- venv/Lib/site-packages/setuptools/_vendor/typeguard/_functions.py +308 -0
- venv/Lib/site-packages/setuptools/_vendor/typeguard/_importhook.py +213 -0
- venv/Lib/site-packages/setuptools/_vendor/typeguard/_memo.py +48 -0
- venv/Lib/site-packages/setuptools/_vendor/typeguard/_pytest_plugin.py +127 -0
- venv/Lib/site-packages/setuptools/_vendor/typeguard/_suppression.py +86 -0
- venv/Lib/site-packages/setuptools/_vendor/typeguard/_transformer.py +1229 -0
- venv/Lib/site-packages/setuptools/_vendor/typeguard/_union_transformer.py +55 -0
- venv/Lib/site-packages/setuptools/_vendor/typeguard/_utils.py +173 -0
- venv/Lib/site-packages/setuptools/_vendor/typeguard/py.typed +0 -0
- venv/Lib/site-packages/setuptools/_vendor/typing_extensions.py +3641 -0
- venv/Lib/site-packages/setuptools/_vendor/wheel/__init__.py +3 -0
- venv/Lib/site-packages/setuptools/_vendor/wheel/__main__.py +23 -0
- venv/Lib/site-packages/setuptools/_vendor/wheel/_bdist_wheel.py +613 -0
- venv/Lib/site-packages/setuptools/_vendor/wheel/_setuptools_logging.py +26 -0
- venv/Lib/site-packages/setuptools/_vendor/wheel/bdist_wheel.py +26 -0
- venv/Lib/site-packages/setuptools/_vendor/wheel/cli/__init__.py +155 -0
- venv/Lib/site-packages/setuptools/_vendor/wheel/cli/convert.py +332 -0
- venv/Lib/site-packages/setuptools/_vendor/wheel/cli/pack.py +85 -0
- venv/Lib/site-packages/setuptools/_vendor/wheel/cli/tags.py +139 -0
- venv/Lib/site-packages/setuptools/_vendor/wheel/cli/unpack.py +30 -0
- venv/Lib/site-packages/setuptools/_vendor/wheel/macosx_libfile.py +482 -0
- venv/Lib/site-packages/setuptools/_vendor/wheel/metadata.py +183 -0
- venv/Lib/site-packages/setuptools/_vendor/wheel/util.py +17 -0
- venv/Lib/site-packages/setuptools/_vendor/wheel/vendored/__init__.py +0 -0
- venv/Lib/site-packages/setuptools/_vendor/wheel/vendored/packaging/__init__.py +0 -0
- venv/Lib/site-packages/setuptools/_vendor/wheel/vendored/packaging/_elffile.py +108 -0
- venv/Lib/site-packages/setuptools/_vendor/wheel/vendored/packaging/_manylinux.py +260 -0
- venv/Lib/site-packages/setuptools/_vendor/wheel/vendored/packaging/_musllinux.py +83 -0
- venv/Lib/site-packages/setuptools/_vendor/wheel/vendored/packaging/_parser.py +356 -0
- venv/Lib/site-packages/setuptools/_vendor/wheel/vendored/packaging/_structures.py +61 -0
- venv/Lib/site-packages/setuptools/_vendor/wheel/vendored/packaging/_tokenizer.py +192 -0
- venv/Lib/site-packages/setuptools/_vendor/wheel/vendored/packaging/markers.py +253 -0
- venv/Lib/site-packages/setuptools/_vendor/wheel/vendored/packaging/requirements.py +90 -0
- venv/Lib/site-packages/setuptools/_vendor/wheel/vendored/packaging/specifiers.py +1011 -0
- venv/Lib/site-packages/setuptools/_vendor/wheel/vendored/packaging/tags.py +571 -0
- venv/Lib/site-packages/setuptools/_vendor/wheel/vendored/packaging/utils.py +172 -0
- venv/Lib/site-packages/setuptools/_vendor/wheel/vendored/packaging/version.py +561 -0
- venv/Lib/site-packages/setuptools/_vendor/wheel/wheelfile.py +227 -0
- venv/Lib/site-packages/setuptools/_vendor/zipp/__init__.py +501 -0
- venv/Lib/site-packages/setuptools/_vendor/zipp/compat/__init__.py +0 -0
- venv/Lib/site-packages/setuptools/_vendor/zipp/compat/py310.py +11 -0
- venv/Lib/site-packages/setuptools/_vendor/zipp/glob.py +106 -0
- venv/Lib/site-packages/setuptools/archive_util.py +219 -0
- venv/Lib/site-packages/setuptools/build_meta.py +548 -0
- venv/Lib/site-packages/setuptools/command/__init__.py +21 -0
- venv/Lib/site-packages/setuptools/command/_requirestxt.py +131 -0
- venv/Lib/site-packages/setuptools/command/alias.py +77 -0
- venv/Lib/site-packages/setuptools/command/bdist_egg.py +477 -0
- venv/Lib/site-packages/setuptools/command/bdist_rpm.py +42 -0
- venv/Lib/site-packages/setuptools/command/bdist_wheel.py +604 -0
- venv/Lib/site-packages/setuptools/command/build.py +135 -0
- venv/Lib/site-packages/setuptools/command/build_clib.py +103 -0
- venv/Lib/site-packages/setuptools/command/build_ext.py +470 -0
- venv/Lib/site-packages/setuptools/command/build_py.py +400 -0
- venv/Lib/site-packages/setuptools/command/develop.py +55 -0
- venv/Lib/site-packages/setuptools/command/dist_info.py +103 -0
- venv/Lib/site-packages/setuptools/command/easy_install.py +30 -0
- venv/Lib/site-packages/setuptools/command/editable_wheel.py +908 -0
- venv/Lib/site-packages/setuptools/command/egg_info.py +718 -0
- venv/Lib/site-packages/setuptools/command/install.py +131 -0
- venv/Lib/site-packages/setuptools/command/install_egg_info.py +58 -0
- venv/Lib/site-packages/setuptools/command/install_lib.py +137 -0
- venv/Lib/site-packages/setuptools/command/install_scripts.py +67 -0
- venv/Lib/site-packages/setuptools/command/rotate.py +65 -0
- venv/Lib/site-packages/setuptools/command/saveopts.py +21 -0
- venv/Lib/site-packages/setuptools/command/sdist.py +217 -0
- venv/Lib/site-packages/setuptools/command/setopt.py +141 -0
- venv/Lib/site-packages/setuptools/command/test.py +45 -0
- venv/Lib/site-packages/setuptools/compat/__init__.py +0 -0
- venv/Lib/site-packages/setuptools/compat/py310.py +20 -0
- venv/Lib/site-packages/setuptools/compat/py311.py +27 -0
- venv/Lib/site-packages/setuptools/compat/py312.py +13 -0
- venv/Lib/site-packages/setuptools/compat/py39.py +9 -0
- venv/Lib/site-packages/setuptools/config/__init__.py +43 -0
- venv/Lib/site-packages/setuptools/config/_apply_pyprojecttoml.py +526 -0
- venv/Lib/site-packages/setuptools/config/_validate_pyproject/__init__.py +34 -0
- venv/Lib/site-packages/setuptools/config/_validate_pyproject/error_reporting.py +336 -0
- venv/Lib/site-packages/setuptools/config/_validate_pyproject/extra_validations.py +82 -0
- venv/Lib/site-packages/setuptools/config/_validate_pyproject/fastjsonschema_exceptions.py +51 -0
- venv/Lib/site-packages/setuptools/config/_validate_pyproject/fastjsonschema_validations.py +1412 -0
- venv/Lib/site-packages/setuptools/config/_validate_pyproject/formats.py +402 -0
- venv/Lib/site-packages/setuptools/config/expand.py +452 -0
- venv/Lib/site-packages/setuptools/config/pyprojecttoml.py +468 -0
- venv/Lib/site-packages/setuptools/config/setupcfg.py +780 -0
- venv/Lib/site-packages/setuptools/depends.py +185 -0
- venv/Lib/site-packages/setuptools/discovery.py +614 -0
- venv/Lib/site-packages/setuptools/dist.py +1119 -0
- venv/Lib/site-packages/setuptools/errors.py +67 -0
- venv/Lib/site-packages/setuptools/extension.py +177 -0
- venv/Lib/site-packages/setuptools/glob.py +185 -0
- venv/Lib/site-packages/setuptools/installer.py +155 -0
- venv/Lib/site-packages/setuptools/launch.py +36 -0
- venv/Lib/site-packages/setuptools/logging.py +40 -0
- venv/Lib/site-packages/setuptools/modified.py +18 -0
- venv/Lib/site-packages/setuptools/monkey.py +126 -0
- venv/Lib/site-packages/setuptools/msvc.py +1536 -0
- venv/Lib/site-packages/setuptools/namespaces.py +106 -0
- venv/Lib/site-packages/setuptools/tests/__init__.py +13 -0
- venv/Lib/site-packages/setuptools/tests/compat/__init__.py +0 -0
- venv/Lib/site-packages/setuptools/tests/compat/py39.py +3 -0
- venv/Lib/site-packages/setuptools/tests/config/__init__.py +0 -0
- venv/Lib/site-packages/setuptools/tests/config/downloads/__init__.py +59 -0
- venv/Lib/site-packages/setuptools/tests/config/downloads/preload.py +18 -0
- venv/Lib/site-packages/setuptools/tests/config/test_apply_pyprojecttoml.py +772 -0
- venv/Lib/site-packages/setuptools/tests/config/test_expand.py +247 -0
- venv/Lib/site-packages/setuptools/tests/config/test_pyprojecttoml.py +396 -0
- venv/Lib/site-packages/setuptools/tests/config/test_pyprojecttoml_dynamic_deps.py +109 -0
- venv/Lib/site-packages/setuptools/tests/config/test_setupcfg.py +980 -0
- venv/Lib/site-packages/setuptools/tests/contexts.py +131 -0
- venv/Lib/site-packages/setuptools/tests/environment.py +95 -0
- venv/Lib/site-packages/setuptools/tests/fixtures.py +392 -0
- venv/Lib/site-packages/setuptools/tests/integration/__init__.py +0 -0
- venv/Lib/site-packages/setuptools/tests/integration/helpers.py +77 -0
- venv/Lib/site-packages/setuptools/tests/integration/test_pbr.py +20 -0
- venv/Lib/site-packages/setuptools/tests/integration/test_pip_install_sdist.py +223 -0
- venv/Lib/site-packages/setuptools/tests/mod_with_constant.py +1 -0
- venv/Lib/site-packages/setuptools/tests/namespaces.py +90 -0
- venv/Lib/site-packages/setuptools/tests/script-with-bom.py +1 -0
- venv/Lib/site-packages/setuptools/tests/test_archive_util.py +36 -0
- venv/Lib/site-packages/setuptools/tests/test_bdist_deprecations.py +28 -0
- venv/Lib/site-packages/setuptools/tests/test_bdist_egg.py +73 -0
- venv/Lib/site-packages/setuptools/tests/test_bdist_wheel.py +708 -0
- venv/Lib/site-packages/setuptools/tests/test_build.py +33 -0
- venv/Lib/site-packages/setuptools/tests/test_build_clib.py +84 -0
- venv/Lib/site-packages/setuptools/tests/test_build_ext.py +293 -0
- venv/Lib/site-packages/setuptools/tests/test_build_meta.py +959 -0
- venv/Lib/site-packages/setuptools/tests/test_build_py.py +480 -0
- venv/Lib/site-packages/setuptools/tests/test_config_discovery.py +647 -0
- venv/Lib/site-packages/setuptools/tests/test_core_metadata.py +622 -0
- venv/Lib/site-packages/setuptools/tests/test_depends.py +15 -0
- venv/Lib/site-packages/setuptools/tests/test_develop.py +112 -0
- venv/Lib/site-packages/setuptools/tests/test_dist.py +278 -0
- venv/Lib/site-packages/setuptools/tests/test_dist_info.py +147 -0
- venv/Lib/site-packages/setuptools/tests/test_distutils_adoption.py +198 -0
- venv/Lib/site-packages/setuptools/tests/test_editable_install.py +1263 -0
- venv/Lib/site-packages/setuptools/tests/test_egg_info.py +1306 -0
- venv/Lib/site-packages/setuptools/tests/test_extern.py +15 -0
- venv/Lib/site-packages/setuptools/tests/test_find_packages.py +218 -0
- venv/Lib/site-packages/setuptools/tests/test_find_py_modules.py +73 -0
- venv/Lib/site-packages/setuptools/tests/test_glob.py +45 -0
- venv/Lib/site-packages/setuptools/tests/test_install_scripts.py +89 -0
- venv/Lib/site-packages/setuptools/tests/test_logging.py +76 -0
- venv/Lib/site-packages/setuptools/tests/test_manifest.py +622 -0
- venv/Lib/site-packages/setuptools/tests/test_namespaces.py +138 -0
- venv/Lib/site-packages/setuptools/tests/test_scripts.py +12 -0
- venv/Lib/site-packages/setuptools/tests/test_sdist.py +984 -0
- venv/Lib/site-packages/setuptools/tests/test_setopt.py +40 -0
- venv/Lib/site-packages/setuptools/tests/test_setuptools.py +290 -0
- venv/Lib/site-packages/setuptools/tests/test_shutil_wrapper.py +23 -0
- venv/Lib/site-packages/setuptools/tests/test_unicode_utils.py +10 -0
- venv/Lib/site-packages/setuptools/tests/test_virtualenv.py +113 -0
- venv/Lib/site-packages/setuptools/tests/test_warnings.py +106 -0
- venv/Lib/site-packages/setuptools/tests/test_wheel.py +690 -0
- venv/Lib/site-packages/setuptools/tests/test_windows_wrappers.py +258 -0
- venv/Lib/site-packages/setuptools/tests/text.py +4 -0
- venv/Lib/site-packages/setuptools/tests/textwrap.py +6 -0
- venv/Lib/site-packages/setuptools/unicode_utils.py +102 -0
- venv/Lib/site-packages/setuptools/version.py +6 -0
- venv/Lib/site-packages/setuptools/warnings.py +110 -0
- venv/Lib/site-packages/setuptools/wheel.py +261 -0
- venv/Lib/site-packages/setuptools/windows_support.py +30 -0
- {android_notify-1.60.0.dist-info → android_notify-1.60.2.dist-info}/WHEEL +0 -0
- {android_notify-1.60.0.dist-info → android_notify-1.60.2.dist-info}/entry_points.txt +0 -0
- {android_notify-1.60.0.dist-info → android_notify-1.60.2.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,1119 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import functools
|
|
4
|
+
import io
|
|
5
|
+
import itertools
|
|
6
|
+
import numbers
|
|
7
|
+
import os
|
|
8
|
+
import re
|
|
9
|
+
import sys
|
|
10
|
+
from collections.abc import Iterable, Iterator, MutableMapping, Sequence
|
|
11
|
+
from glob import glob
|
|
12
|
+
from pathlib import Path
|
|
13
|
+
from typing import TYPE_CHECKING, Any, Union
|
|
14
|
+
|
|
15
|
+
from more_itertools import partition, unique_everseen
|
|
16
|
+
from packaging.markers import InvalidMarker, Marker
|
|
17
|
+
from packaging.specifiers import InvalidSpecifier, SpecifierSet
|
|
18
|
+
from packaging.version import Version
|
|
19
|
+
|
|
20
|
+
from . import (
|
|
21
|
+
_entry_points,
|
|
22
|
+
_reqs,
|
|
23
|
+
_static,
|
|
24
|
+
command as _, # noqa: F401 # imported for side-effects
|
|
25
|
+
)
|
|
26
|
+
from ._importlib import metadata
|
|
27
|
+
from ._normalization import _canonicalize_license_expression
|
|
28
|
+
from ._path import StrPath
|
|
29
|
+
from ._reqs import _StrOrIter
|
|
30
|
+
from .config import pyprojecttoml, setupcfg
|
|
31
|
+
from .discovery import ConfigDiscovery
|
|
32
|
+
from .errors import InvalidConfigError
|
|
33
|
+
from .monkey import get_unpatched
|
|
34
|
+
from .warnings import InformationOnly, SetuptoolsDeprecationWarning
|
|
35
|
+
|
|
36
|
+
import distutils.cmd
|
|
37
|
+
import distutils.command
|
|
38
|
+
import distutils.core
|
|
39
|
+
import distutils.dist
|
|
40
|
+
import distutils.log
|
|
41
|
+
from distutils.debug import DEBUG
|
|
42
|
+
from distutils.errors import DistutilsOptionError, DistutilsSetupError
|
|
43
|
+
from distutils.fancy_getopt import translate_longopt
|
|
44
|
+
from distutils.util import strtobool
|
|
45
|
+
|
|
46
|
+
if TYPE_CHECKING:
|
|
47
|
+
from typing_extensions import TypeAlias
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
__all__ = ['Distribution']
|
|
51
|
+
|
|
52
|
+
_sequence = tuple, list
|
|
53
|
+
"""
|
|
54
|
+
:meta private:
|
|
55
|
+
|
|
56
|
+
Supported iterable types that are known to be:
|
|
57
|
+
- ordered (which `set` isn't)
|
|
58
|
+
- not match a str (which `Sequence[str]` does)
|
|
59
|
+
- not imply a nested type (like `dict`)
|
|
60
|
+
for use with `isinstance`.
|
|
61
|
+
"""
|
|
62
|
+
_Sequence: TypeAlias = Union[tuple[str, ...], list[str]]
|
|
63
|
+
# This is how stringifying _Sequence would look in Python 3.10
|
|
64
|
+
_sequence_type_repr = "tuple[str, ...] | list[str]"
|
|
65
|
+
_OrderedStrSequence: TypeAlias = Union[str, dict[str, Any], Sequence[str]]
|
|
66
|
+
"""
|
|
67
|
+
:meta private:
|
|
68
|
+
Avoid single-use iterable. Disallow sets.
|
|
69
|
+
A poor approximation of an OrderedSequence (dict doesn't match a Sequence).
|
|
70
|
+
"""
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def __getattr__(name: str) -> Any: # pragma: no cover
|
|
74
|
+
if name == "sequence":
|
|
75
|
+
SetuptoolsDeprecationWarning.emit(
|
|
76
|
+
"`setuptools.dist.sequence` is an internal implementation detail.",
|
|
77
|
+
"Please define your own `sequence = tuple, list` instead.",
|
|
78
|
+
due_date=(2025, 8, 28), # Originally added on 2024-08-27
|
|
79
|
+
)
|
|
80
|
+
return _sequence
|
|
81
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def check_importable(dist, attr, value):
|
|
85
|
+
try:
|
|
86
|
+
ep = metadata.EntryPoint(value=value, name=None, group=None)
|
|
87
|
+
assert not ep.extras
|
|
88
|
+
except (TypeError, ValueError, AttributeError, AssertionError) as e:
|
|
89
|
+
raise DistutilsSetupError(
|
|
90
|
+
f"{attr!r} must be importable 'module:attrs' string (got {value!r})"
|
|
91
|
+
) from e
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def assert_string_list(dist, attr: str, value: _Sequence) -> None:
|
|
95
|
+
"""Verify that value is a string list"""
|
|
96
|
+
try:
|
|
97
|
+
# verify that value is a list or tuple to exclude unordered
|
|
98
|
+
# or single-use iterables
|
|
99
|
+
assert isinstance(value, _sequence)
|
|
100
|
+
# verify that elements of value are strings
|
|
101
|
+
assert ''.join(value) != value
|
|
102
|
+
except (TypeError, ValueError, AttributeError, AssertionError) as e:
|
|
103
|
+
raise DistutilsSetupError(
|
|
104
|
+
f"{attr!r} must be of type <{_sequence_type_repr}> (got {value!r})"
|
|
105
|
+
) from e
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def check_nsp(dist, attr, value):
|
|
109
|
+
"""Verify that namespace packages are valid"""
|
|
110
|
+
ns_packages = value
|
|
111
|
+
assert_string_list(dist, attr, ns_packages)
|
|
112
|
+
for nsp in ns_packages:
|
|
113
|
+
if not dist.has_contents_for(nsp):
|
|
114
|
+
raise DistutilsSetupError(
|
|
115
|
+
f"Distribution contains no modules or packages for namespace package {nsp!r}"
|
|
116
|
+
)
|
|
117
|
+
parent, _sep, _child = nsp.rpartition('.')
|
|
118
|
+
if parent and parent not in ns_packages:
|
|
119
|
+
distutils.log.warn(
|
|
120
|
+
"WARNING: %r is declared as a package namespace, but %r"
|
|
121
|
+
" is not: please correct this in setup.py",
|
|
122
|
+
nsp,
|
|
123
|
+
parent,
|
|
124
|
+
)
|
|
125
|
+
SetuptoolsDeprecationWarning.emit(
|
|
126
|
+
"The namespace_packages parameter is deprecated.",
|
|
127
|
+
"Please replace its usage with implicit namespaces (PEP 420).",
|
|
128
|
+
see_docs="references/keywords.html#keyword-namespace-packages",
|
|
129
|
+
# TODO: define due_date, it may break old packages that are no longer
|
|
130
|
+
# maintained (e.g. sphinxcontrib extensions) when installed from source.
|
|
131
|
+
# Warning officially introduced in May 2022, however the deprecation
|
|
132
|
+
# was mentioned much earlier in the docs (May 2020, see #2149).
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
def check_extras(dist, attr, value):
|
|
137
|
+
"""Verify that extras_require mapping is valid"""
|
|
138
|
+
try:
|
|
139
|
+
list(itertools.starmap(_check_extra, value.items()))
|
|
140
|
+
except (TypeError, ValueError, AttributeError) as e:
|
|
141
|
+
raise DistutilsSetupError(
|
|
142
|
+
"'extras_require' must be a dictionary whose values are "
|
|
143
|
+
"strings or lists of strings containing valid project/version "
|
|
144
|
+
"requirement specifiers."
|
|
145
|
+
) from e
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
def _check_extra(extra, reqs):
|
|
149
|
+
_name, _sep, marker = extra.partition(':')
|
|
150
|
+
try:
|
|
151
|
+
_check_marker(marker)
|
|
152
|
+
except InvalidMarker:
|
|
153
|
+
msg = f"Invalid environment marker: {marker} ({extra!r})"
|
|
154
|
+
raise DistutilsSetupError(msg) from None
|
|
155
|
+
list(_reqs.parse(reqs))
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
def _check_marker(marker):
|
|
159
|
+
if not marker:
|
|
160
|
+
return
|
|
161
|
+
m = Marker(marker)
|
|
162
|
+
m.evaluate()
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
def assert_bool(dist, attr, value):
|
|
166
|
+
"""Verify that value is True, False, 0, or 1"""
|
|
167
|
+
if bool(value) != value:
|
|
168
|
+
raise DistutilsSetupError(f"{attr!r} must be a boolean value (got {value!r})")
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
def invalid_unless_false(dist, attr, value):
|
|
172
|
+
if not value:
|
|
173
|
+
DistDeprecationWarning.emit(f"{attr} is ignored.")
|
|
174
|
+
# TODO: should there be a `due_date` here?
|
|
175
|
+
return
|
|
176
|
+
raise DistutilsSetupError(f"{attr} is invalid.")
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
def check_requirements(dist, attr: str, value: _OrderedStrSequence) -> None:
|
|
180
|
+
"""Verify that install_requires is a valid requirements list"""
|
|
181
|
+
try:
|
|
182
|
+
list(_reqs.parse(value))
|
|
183
|
+
if isinstance(value, set):
|
|
184
|
+
raise TypeError("Unordered types are not allowed")
|
|
185
|
+
except (TypeError, ValueError) as error:
|
|
186
|
+
msg = (
|
|
187
|
+
f"{attr!r} must be a string or iterable of strings "
|
|
188
|
+
f"containing valid project/version requirement specifiers; {error}"
|
|
189
|
+
)
|
|
190
|
+
raise DistutilsSetupError(msg) from error
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
def check_specifier(dist, attr, value):
|
|
194
|
+
"""Verify that value is a valid version specifier"""
|
|
195
|
+
try:
|
|
196
|
+
SpecifierSet(value)
|
|
197
|
+
except (InvalidSpecifier, AttributeError) as error:
|
|
198
|
+
msg = f"{attr!r} must be a string containing valid version specifiers; {error}"
|
|
199
|
+
raise DistutilsSetupError(msg) from error
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
def check_entry_points(dist, attr, value):
|
|
203
|
+
"""Verify that entry_points map is parseable"""
|
|
204
|
+
try:
|
|
205
|
+
_entry_points.load(value)
|
|
206
|
+
except Exception as e:
|
|
207
|
+
raise DistutilsSetupError(e) from e
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
def check_package_data(dist, attr, value):
|
|
211
|
+
"""Verify that value is a dictionary of package names to glob lists"""
|
|
212
|
+
if not isinstance(value, dict):
|
|
213
|
+
raise DistutilsSetupError(
|
|
214
|
+
f"{attr!r} must be a dictionary mapping package names to lists of "
|
|
215
|
+
"string wildcard patterns"
|
|
216
|
+
)
|
|
217
|
+
for k, v in value.items():
|
|
218
|
+
if not isinstance(k, str):
|
|
219
|
+
raise DistutilsSetupError(
|
|
220
|
+
f"keys of {attr!r} dict must be strings (got {k!r})"
|
|
221
|
+
)
|
|
222
|
+
assert_string_list(dist, f'values of {attr!r} dict', v)
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
def check_packages(dist, attr, value):
|
|
226
|
+
for pkgname in value:
|
|
227
|
+
if not re.match(r'\w+(\.\w+)*', pkgname):
|
|
228
|
+
distutils.log.warn(
|
|
229
|
+
"WARNING: %r not a valid package name; please use only "
|
|
230
|
+
".-separated package names in setup.py",
|
|
231
|
+
pkgname,
|
|
232
|
+
)
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
if TYPE_CHECKING:
|
|
236
|
+
# Work around a mypy issue where type[T] can't be used as a base: https://github.com/python/mypy/issues/10962
|
|
237
|
+
from distutils.core import Distribution as _Distribution
|
|
238
|
+
else:
|
|
239
|
+
_Distribution = get_unpatched(distutils.core.Distribution)
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
class Distribution(_Distribution):
|
|
243
|
+
"""Distribution with support for tests and package data
|
|
244
|
+
|
|
245
|
+
This is an enhanced version of 'distutils.dist.Distribution' that
|
|
246
|
+
effectively adds the following new optional keyword arguments to 'setup()':
|
|
247
|
+
|
|
248
|
+
'install_requires' -- a string or sequence of strings specifying project
|
|
249
|
+
versions that the distribution requires when installed, in the format
|
|
250
|
+
used by 'pkg_resources.require()'. They will be installed
|
|
251
|
+
automatically when the package is installed. If you wish to use
|
|
252
|
+
packages that are not available in PyPI, or want to give your users an
|
|
253
|
+
alternate download location, you can add a 'find_links' option to the
|
|
254
|
+
'[easy_install]' section of your project's 'setup.cfg' file, and then
|
|
255
|
+
setuptools will scan the listed web pages for links that satisfy the
|
|
256
|
+
requirements.
|
|
257
|
+
|
|
258
|
+
'extras_require' -- a dictionary mapping names of optional "extras" to the
|
|
259
|
+
additional requirement(s) that using those extras incurs. For example,
|
|
260
|
+
this::
|
|
261
|
+
|
|
262
|
+
extras_require = dict(reST = ["docutils>=0.3", "reSTedit"])
|
|
263
|
+
|
|
264
|
+
indicates that the distribution can optionally provide an extra
|
|
265
|
+
capability called "reST", but it can only be used if docutils and
|
|
266
|
+
reSTedit are installed. If the user installs your package using
|
|
267
|
+
EasyInstall and requests one of your extras, the corresponding
|
|
268
|
+
additional requirements will be installed if needed.
|
|
269
|
+
|
|
270
|
+
'package_data' -- a dictionary mapping package names to lists of filenames
|
|
271
|
+
or globs to use to find data files contained in the named packages.
|
|
272
|
+
If the dictionary has filenames or globs listed under '""' (the empty
|
|
273
|
+
string), those names will be searched for in every package, in addition
|
|
274
|
+
to any names for the specific package. Data files found using these
|
|
275
|
+
names/globs will be installed along with the package, in the same
|
|
276
|
+
location as the package. Note that globs are allowed to reference
|
|
277
|
+
the contents of non-package subdirectories, as long as you use '/' as
|
|
278
|
+
a path separator. (Globs are automatically converted to
|
|
279
|
+
platform-specific paths at runtime.)
|
|
280
|
+
|
|
281
|
+
In addition to these new keywords, this class also has several new methods
|
|
282
|
+
for manipulating the distribution's contents. For example, the 'include()'
|
|
283
|
+
and 'exclude()' methods can be thought of as in-place add and subtract
|
|
284
|
+
commands that add or remove packages, modules, extensions, and so on from
|
|
285
|
+
the distribution.
|
|
286
|
+
"""
|
|
287
|
+
|
|
288
|
+
_DISTUTILS_UNSUPPORTED_METADATA = {
|
|
289
|
+
'long_description_content_type': lambda: None,
|
|
290
|
+
'project_urls': dict,
|
|
291
|
+
'provides_extras': dict, # behaves like an ordered set
|
|
292
|
+
'license_expression': lambda: None,
|
|
293
|
+
'license_file': lambda: None,
|
|
294
|
+
'license_files': lambda: None,
|
|
295
|
+
'install_requires': list,
|
|
296
|
+
'extras_require': dict,
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
# Used by build_py, editable_wheel and install_lib commands for legacy namespaces
|
|
300
|
+
namespace_packages: list[str] #: :meta private: DEPRECATED
|
|
301
|
+
|
|
302
|
+
# Any: Dynamic assignment results in Incompatible types in assignment
|
|
303
|
+
def __init__(self, attrs: MutableMapping[str, Any] | None = None) -> None:
|
|
304
|
+
have_package_data = hasattr(self, "package_data")
|
|
305
|
+
if not have_package_data:
|
|
306
|
+
self.package_data: dict[str, list[str]] = {}
|
|
307
|
+
attrs = attrs or {}
|
|
308
|
+
self.dist_files: list[tuple[str, str, str]] = []
|
|
309
|
+
self.include_package_data: bool | None = None
|
|
310
|
+
self.exclude_package_data: dict[str, list[str]] | None = None
|
|
311
|
+
# Filter-out setuptools' specific options.
|
|
312
|
+
self.src_root: str | None = attrs.pop("src_root", None)
|
|
313
|
+
self.dependency_links: list[str] = attrs.pop('dependency_links', [])
|
|
314
|
+
self.setup_requires: list[str] = attrs.pop('setup_requires', [])
|
|
315
|
+
for ep in metadata.entry_points(group='distutils.setup_keywords'):
|
|
316
|
+
vars(self).setdefault(ep.name, None)
|
|
317
|
+
|
|
318
|
+
metadata_only = set(self._DISTUTILS_UNSUPPORTED_METADATA)
|
|
319
|
+
metadata_only -= {"install_requires", "extras_require"}
|
|
320
|
+
dist_attrs = {k: v for k, v in attrs.items() if k not in metadata_only}
|
|
321
|
+
_Distribution.__init__(self, dist_attrs)
|
|
322
|
+
|
|
323
|
+
# Private API (setuptools-use only, not restricted to Distribution)
|
|
324
|
+
# Stores files that are referenced by the configuration and need to be in the
|
|
325
|
+
# sdist (e.g. `version = file: VERSION.txt`)
|
|
326
|
+
self._referenced_files = set[str]()
|
|
327
|
+
|
|
328
|
+
self.set_defaults = ConfigDiscovery(self)
|
|
329
|
+
|
|
330
|
+
self._set_metadata_defaults(attrs)
|
|
331
|
+
|
|
332
|
+
self.metadata.version = self._normalize_version(self.metadata.version)
|
|
333
|
+
self._finalize_requires()
|
|
334
|
+
|
|
335
|
+
def _validate_metadata(self):
|
|
336
|
+
required = {"name"}
|
|
337
|
+
provided = {
|
|
338
|
+
key
|
|
339
|
+
for key in vars(self.metadata)
|
|
340
|
+
if getattr(self.metadata, key, None) is not None
|
|
341
|
+
}
|
|
342
|
+
missing = required - provided
|
|
343
|
+
|
|
344
|
+
if missing:
|
|
345
|
+
msg = f"Required package metadata is missing: {missing}"
|
|
346
|
+
raise DistutilsSetupError(msg)
|
|
347
|
+
|
|
348
|
+
def _set_metadata_defaults(self, attrs):
|
|
349
|
+
"""
|
|
350
|
+
Fill-in missing metadata fields not supported by distutils.
|
|
351
|
+
Some fields may have been set by other tools (e.g. pbr).
|
|
352
|
+
Those fields (vars(self.metadata)) take precedence to
|
|
353
|
+
supplied attrs.
|
|
354
|
+
"""
|
|
355
|
+
for option, default in self._DISTUTILS_UNSUPPORTED_METADATA.items():
|
|
356
|
+
vars(self.metadata).setdefault(option, attrs.get(option, default()))
|
|
357
|
+
|
|
358
|
+
@staticmethod
|
|
359
|
+
def _normalize_version(version):
|
|
360
|
+
from . import sic
|
|
361
|
+
|
|
362
|
+
if isinstance(version, numbers.Number):
|
|
363
|
+
# Some people apparently take "version number" too literally :)
|
|
364
|
+
version = str(version)
|
|
365
|
+
elif isinstance(version, sic) or version is None:
|
|
366
|
+
return version
|
|
367
|
+
|
|
368
|
+
normalized = str(Version(version))
|
|
369
|
+
if version != normalized:
|
|
370
|
+
InformationOnly.emit(f"Normalizing '{version}' to '{normalized}'")
|
|
371
|
+
return normalized
|
|
372
|
+
return version
|
|
373
|
+
|
|
374
|
+
def _finalize_requires(self):
|
|
375
|
+
"""
|
|
376
|
+
Set `metadata.python_requires` and fix environment markers
|
|
377
|
+
in `install_requires` and `extras_require`.
|
|
378
|
+
"""
|
|
379
|
+
if getattr(self, 'python_requires', None):
|
|
380
|
+
self.metadata.python_requires = self.python_requires
|
|
381
|
+
|
|
382
|
+
self._normalize_requires()
|
|
383
|
+
self.metadata.install_requires = self.install_requires
|
|
384
|
+
self.metadata.extras_require = self.extras_require
|
|
385
|
+
|
|
386
|
+
if self.extras_require:
|
|
387
|
+
for extra in self.extras_require.keys():
|
|
388
|
+
# Setuptools allows a weird "<name>:<env markers> syntax for extras
|
|
389
|
+
extra = extra.split(':')[0]
|
|
390
|
+
if extra:
|
|
391
|
+
self.metadata.provides_extras.setdefault(extra)
|
|
392
|
+
|
|
393
|
+
def _normalize_requires(self):
|
|
394
|
+
"""Make sure requirement-related attributes exist and are normalized"""
|
|
395
|
+
install_requires = getattr(self, "install_requires", None) or []
|
|
396
|
+
extras_require = getattr(self, "extras_require", None) or {}
|
|
397
|
+
|
|
398
|
+
# Preserve the "static"-ness of values parsed from config files
|
|
399
|
+
list_ = _static.List if _static.is_static(install_requires) else list
|
|
400
|
+
self.install_requires = list_(map(str, _reqs.parse(install_requires)))
|
|
401
|
+
|
|
402
|
+
dict_ = _static.Dict if _static.is_static(extras_require) else dict
|
|
403
|
+
self.extras_require = dict_(
|
|
404
|
+
(k, list(map(str, _reqs.parse(v or [])))) for k, v in extras_require.items()
|
|
405
|
+
)
|
|
406
|
+
|
|
407
|
+
def _finalize_license_expression(self) -> None:
|
|
408
|
+
"""
|
|
409
|
+
Normalize license and license_expression.
|
|
410
|
+
>>> dist = Distribution({"license_expression": _static.Str("mit aNd gpl-3.0-OR-later")})
|
|
411
|
+
>>> _static.is_static(dist.metadata.license_expression)
|
|
412
|
+
True
|
|
413
|
+
>>> dist._finalize_license_expression()
|
|
414
|
+
>>> _static.is_static(dist.metadata.license_expression) # preserve "static-ness"
|
|
415
|
+
True
|
|
416
|
+
>>> print(dist.metadata.license_expression)
|
|
417
|
+
MIT AND GPL-3.0-or-later
|
|
418
|
+
"""
|
|
419
|
+
classifiers = self.metadata.get_classifiers()
|
|
420
|
+
license_classifiers = [cl for cl in classifiers if cl.startswith("License :: ")]
|
|
421
|
+
|
|
422
|
+
license_expr = self.metadata.license_expression
|
|
423
|
+
if license_expr:
|
|
424
|
+
str_ = _static.Str if _static.is_static(license_expr) else str
|
|
425
|
+
normalized = str_(_canonicalize_license_expression(license_expr))
|
|
426
|
+
if license_expr != normalized:
|
|
427
|
+
InformationOnly.emit(f"Normalizing '{license_expr}' to '{normalized}'")
|
|
428
|
+
self.metadata.license_expression = normalized
|
|
429
|
+
if license_classifiers:
|
|
430
|
+
raise InvalidConfigError(
|
|
431
|
+
"License classifiers have been superseded by license expressions "
|
|
432
|
+
"(see https://peps.python.org/pep-0639/). Please remove:\n\n"
|
|
433
|
+
+ "\n".join(license_classifiers),
|
|
434
|
+
)
|
|
435
|
+
elif license_classifiers:
|
|
436
|
+
pypa_guides = "guides/writing-pyproject-toml/#license"
|
|
437
|
+
SetuptoolsDeprecationWarning.emit(
|
|
438
|
+
"License classifiers are deprecated.",
|
|
439
|
+
"Please consider removing the following classifiers in favor of a "
|
|
440
|
+
"SPDX license expression:\n\n" + "\n".join(license_classifiers),
|
|
441
|
+
see_url=f"https://packaging.python.org/en/latest/{pypa_guides}",
|
|
442
|
+
# Warning introduced on 2025-02-17
|
|
443
|
+
# TODO: Should we add a due date? It may affect old/unmaintained
|
|
444
|
+
# packages in the ecosystem and cause problems...
|
|
445
|
+
)
|
|
446
|
+
|
|
447
|
+
def _finalize_license_files(self) -> None:
|
|
448
|
+
"""Compute names of all license files which should be included."""
|
|
449
|
+
license_files: list[str] | None = self.metadata.license_files
|
|
450
|
+
patterns = license_files or []
|
|
451
|
+
|
|
452
|
+
license_file: str | None = self.metadata.license_file
|
|
453
|
+
if license_file and license_file not in patterns:
|
|
454
|
+
patterns.append(license_file)
|
|
455
|
+
|
|
456
|
+
if license_files is None and license_file is None:
|
|
457
|
+
# Default patterns match the ones wheel uses
|
|
458
|
+
# See https://wheel.readthedocs.io/en/stable/user_guide.html
|
|
459
|
+
# -> 'Including license files in the generated wheel file'
|
|
460
|
+
patterns = ['LICEN[CS]E*', 'COPYING*', 'NOTICE*', 'AUTHORS*']
|
|
461
|
+
files = self._expand_patterns(patterns, enforce_match=False)
|
|
462
|
+
else: # Patterns explicitly given by the user
|
|
463
|
+
files = self._expand_patterns(patterns, enforce_match=True)
|
|
464
|
+
|
|
465
|
+
self.metadata.license_files = list(unique_everseen(files))
|
|
466
|
+
|
|
467
|
+
@classmethod
|
|
468
|
+
def _expand_patterns(
|
|
469
|
+
cls, patterns: list[str], enforce_match: bool = True
|
|
470
|
+
) -> Iterator[str]:
|
|
471
|
+
"""
|
|
472
|
+
>>> getfixture('sample_project_cwd')
|
|
473
|
+
>>> list(Distribution._expand_patterns(['LICENSE.txt']))
|
|
474
|
+
['LICENSE.txt']
|
|
475
|
+
>>> list(Distribution._expand_patterns(['pyproject.toml', 'LIC*']))
|
|
476
|
+
['pyproject.toml', 'LICENSE.txt']
|
|
477
|
+
>>> list(Distribution._expand_patterns(['src/**/*.dat']))
|
|
478
|
+
['src/sample/package_data.dat']
|
|
479
|
+
"""
|
|
480
|
+
return (
|
|
481
|
+
path.replace(os.sep, "/")
|
|
482
|
+
for pattern in patterns
|
|
483
|
+
for path in sorted(cls._find_pattern(pattern, enforce_match))
|
|
484
|
+
if not path.endswith('~') and os.path.isfile(path)
|
|
485
|
+
)
|
|
486
|
+
|
|
487
|
+
@staticmethod
|
|
488
|
+
def _find_pattern(pattern: str, enforce_match: bool = True) -> list[str]:
|
|
489
|
+
r"""
|
|
490
|
+
>>> getfixture('sample_project_cwd')
|
|
491
|
+
>>> Distribution._find_pattern("LICENSE.txt")
|
|
492
|
+
['LICENSE.txt']
|
|
493
|
+
>>> Distribution._find_pattern("/LICENSE.MIT")
|
|
494
|
+
Traceback (most recent call last):
|
|
495
|
+
...
|
|
496
|
+
setuptools.errors.InvalidConfigError: Pattern '/LICENSE.MIT' should be relative...
|
|
497
|
+
>>> Distribution._find_pattern("../LICENSE.MIT")
|
|
498
|
+
Traceback (most recent call last):
|
|
499
|
+
...
|
|
500
|
+
setuptools.warnings.SetuptoolsDeprecationWarning: ...Pattern '../LICENSE.MIT' cannot contain '..'...
|
|
501
|
+
>>> Distribution._find_pattern("LICEN{CSE*")
|
|
502
|
+
Traceback (most recent call last):
|
|
503
|
+
...
|
|
504
|
+
setuptools.warnings.SetuptoolsDeprecationWarning: ...Pattern 'LICEN{CSE*' contains invalid characters...
|
|
505
|
+
"""
|
|
506
|
+
pypa_guides = "specifications/glob-patterns/"
|
|
507
|
+
if ".." in pattern:
|
|
508
|
+
SetuptoolsDeprecationWarning.emit(
|
|
509
|
+
f"Pattern {pattern!r} cannot contain '..'",
|
|
510
|
+
"""
|
|
511
|
+
Please ensure the files specified are contained by the root
|
|
512
|
+
of the Python package (normally marked by `pyproject.toml`).
|
|
513
|
+
""",
|
|
514
|
+
see_url=f"https://packaging.python.org/en/latest/{pypa_guides}",
|
|
515
|
+
due_date=(2026, 3, 20), # Introduced in 2025-03-20
|
|
516
|
+
# Replace with InvalidConfigError after deprecation
|
|
517
|
+
)
|
|
518
|
+
if pattern.startswith((os.sep, "/")) or ":\\" in pattern:
|
|
519
|
+
raise InvalidConfigError(
|
|
520
|
+
f"Pattern {pattern!r} should be relative and must not start with '/'"
|
|
521
|
+
)
|
|
522
|
+
if re.match(r'^[\w\-\.\/\*\?\[\]]+$', pattern) is None:
|
|
523
|
+
SetuptoolsDeprecationWarning.emit(
|
|
524
|
+
"Please provide a valid glob pattern.",
|
|
525
|
+
"Pattern {pattern!r} contains invalid characters.",
|
|
526
|
+
pattern=pattern,
|
|
527
|
+
see_url=f"https://packaging.python.org/en/latest/{pypa_guides}",
|
|
528
|
+
due_date=(2026, 3, 20), # Introduced in 2025-02-20
|
|
529
|
+
)
|
|
530
|
+
|
|
531
|
+
found = glob(pattern, recursive=True)
|
|
532
|
+
|
|
533
|
+
if enforce_match and not found:
|
|
534
|
+
SetuptoolsDeprecationWarning.emit(
|
|
535
|
+
"Cannot find any files for the given pattern.",
|
|
536
|
+
"Pattern {pattern!r} did not match any files.",
|
|
537
|
+
pattern=pattern,
|
|
538
|
+
due_date=(2026, 3, 20), # Introduced in 2025-02-20
|
|
539
|
+
# PEP 639 requires us to error, but as a transition period
|
|
540
|
+
# we will only issue a warning to give people time to prepare.
|
|
541
|
+
# After the transition, this should raise an InvalidConfigError.
|
|
542
|
+
)
|
|
543
|
+
return found
|
|
544
|
+
|
|
545
|
+
# FIXME: 'Distribution._parse_config_files' is too complex (14)
|
|
546
|
+
def _parse_config_files(self, filenames=None): # noqa: C901
|
|
547
|
+
"""
|
|
548
|
+
Adapted from distutils.dist.Distribution.parse_config_files,
|
|
549
|
+
this method provides the same functionality in subtly-improved
|
|
550
|
+
ways.
|
|
551
|
+
"""
|
|
552
|
+
from configparser import ConfigParser
|
|
553
|
+
|
|
554
|
+
# Ignore install directory options if we have a venv
|
|
555
|
+
ignore_options = (
|
|
556
|
+
[]
|
|
557
|
+
if sys.prefix == sys.base_prefix
|
|
558
|
+
else [
|
|
559
|
+
'install-base',
|
|
560
|
+
'install-platbase',
|
|
561
|
+
'install-lib',
|
|
562
|
+
'install-platlib',
|
|
563
|
+
'install-purelib',
|
|
564
|
+
'install-headers',
|
|
565
|
+
'install-scripts',
|
|
566
|
+
'install-data',
|
|
567
|
+
'prefix',
|
|
568
|
+
'exec-prefix',
|
|
569
|
+
'home',
|
|
570
|
+
'user',
|
|
571
|
+
'root',
|
|
572
|
+
]
|
|
573
|
+
)
|
|
574
|
+
|
|
575
|
+
ignore_options = frozenset(ignore_options)
|
|
576
|
+
|
|
577
|
+
if filenames is None:
|
|
578
|
+
filenames = self.find_config_files()
|
|
579
|
+
|
|
580
|
+
if DEBUG:
|
|
581
|
+
self.announce("Distribution.parse_config_files():")
|
|
582
|
+
|
|
583
|
+
parser = ConfigParser()
|
|
584
|
+
parser.optionxform = str
|
|
585
|
+
for filename in filenames:
|
|
586
|
+
with open(filename, encoding='utf-8') as reader:
|
|
587
|
+
if DEBUG:
|
|
588
|
+
self.announce(" reading {filename}".format(**locals()))
|
|
589
|
+
parser.read_file(reader)
|
|
590
|
+
for section in parser.sections():
|
|
591
|
+
options = parser.options(section)
|
|
592
|
+
opt_dict = self.get_option_dict(section)
|
|
593
|
+
|
|
594
|
+
for opt in options:
|
|
595
|
+
if opt == '__name__' or opt in ignore_options:
|
|
596
|
+
continue
|
|
597
|
+
|
|
598
|
+
val = parser.get(section, opt)
|
|
599
|
+
opt = self._enforce_underscore(opt, section)
|
|
600
|
+
opt = self._enforce_option_lowercase(opt, section)
|
|
601
|
+
opt_dict[opt] = (filename, val)
|
|
602
|
+
|
|
603
|
+
# Make the ConfigParser forget everything (so we retain
|
|
604
|
+
# the original filenames that options come from)
|
|
605
|
+
parser.__init__()
|
|
606
|
+
|
|
607
|
+
if 'global' not in self.command_options:
|
|
608
|
+
return
|
|
609
|
+
|
|
610
|
+
# If there was a "global" section in the config file, use it
|
|
611
|
+
# to set Distribution options.
|
|
612
|
+
|
|
613
|
+
for opt, (src, val) in self.command_options['global'].items():
|
|
614
|
+
alias = self.negative_opt.get(opt)
|
|
615
|
+
if alias:
|
|
616
|
+
val = not strtobool(val)
|
|
617
|
+
elif opt in ('verbose', 'dry_run'): # ugh!
|
|
618
|
+
val = strtobool(val)
|
|
619
|
+
|
|
620
|
+
try:
|
|
621
|
+
setattr(self, alias or opt, val)
|
|
622
|
+
except ValueError as e:
|
|
623
|
+
raise DistutilsOptionError(e) from e
|
|
624
|
+
|
|
625
|
+
def _enforce_underscore(self, opt: str, section: str) -> str:
|
|
626
|
+
if "-" not in opt or self._skip_setupcfg_normalization(section):
|
|
627
|
+
return opt
|
|
628
|
+
|
|
629
|
+
underscore_opt = opt.replace('-', '_')
|
|
630
|
+
affected = f"(Affected: {self.metadata.name})." if self.metadata.name else ""
|
|
631
|
+
SetuptoolsDeprecationWarning.emit(
|
|
632
|
+
f"Invalid dash-separated key {opt!r} in {section!r} (setup.cfg), "
|
|
633
|
+
f"please use the underscore name {underscore_opt!r} instead.",
|
|
634
|
+
f"""
|
|
635
|
+
Usage of dash-separated {opt!r} will not be supported in future
|
|
636
|
+
versions. Please use the underscore name {underscore_opt!r} instead.
|
|
637
|
+
{affected}
|
|
638
|
+
""",
|
|
639
|
+
see_docs="userguide/declarative_config.html",
|
|
640
|
+
due_date=(2026, 3, 3),
|
|
641
|
+
# Warning initially introduced in 3 Mar 2021
|
|
642
|
+
)
|
|
643
|
+
return underscore_opt
|
|
644
|
+
|
|
645
|
+
def _enforce_option_lowercase(self, opt: str, section: str) -> str:
|
|
646
|
+
if opt.islower() or self._skip_setupcfg_normalization(section):
|
|
647
|
+
return opt
|
|
648
|
+
|
|
649
|
+
lowercase_opt = opt.lower()
|
|
650
|
+
affected = f"(Affected: {self.metadata.name})." if self.metadata.name else ""
|
|
651
|
+
SetuptoolsDeprecationWarning.emit(
|
|
652
|
+
f"Invalid uppercase key {opt!r} in {section!r} (setup.cfg), "
|
|
653
|
+
f"please use lowercase {lowercase_opt!r} instead.",
|
|
654
|
+
f"""
|
|
655
|
+
Usage of uppercase key {opt!r} in {section!r} will not be supported in
|
|
656
|
+
future versions. Please use lowercase {lowercase_opt!r} instead.
|
|
657
|
+
{affected}
|
|
658
|
+
""",
|
|
659
|
+
see_docs="userguide/declarative_config.html",
|
|
660
|
+
due_date=(2026, 3, 3),
|
|
661
|
+
# Warning initially introduced in 6 Mar 2021
|
|
662
|
+
)
|
|
663
|
+
return lowercase_opt
|
|
664
|
+
|
|
665
|
+
def _skip_setupcfg_normalization(self, section: str) -> bool:
|
|
666
|
+
skip = (
|
|
667
|
+
'options.extras_require',
|
|
668
|
+
'options.data_files',
|
|
669
|
+
'options.entry_points',
|
|
670
|
+
'options.package_data',
|
|
671
|
+
'options.exclude_package_data',
|
|
672
|
+
)
|
|
673
|
+
return section in skip or not self._is_setuptools_section(section)
|
|
674
|
+
|
|
675
|
+
def _is_setuptools_section(self, section: str) -> bool:
|
|
676
|
+
return (
|
|
677
|
+
section == "metadata"
|
|
678
|
+
or section.startswith("options")
|
|
679
|
+
or section in _setuptools_commands()
|
|
680
|
+
)
|
|
681
|
+
|
|
682
|
+
# FIXME: 'Distribution._set_command_options' is too complex (14)
|
|
683
|
+
def _set_command_options(self, command_obj, option_dict=None): # noqa: C901
|
|
684
|
+
"""
|
|
685
|
+
Set the options for 'command_obj' from 'option_dict'. Basically
|
|
686
|
+
this means copying elements of a dictionary ('option_dict') to
|
|
687
|
+
attributes of an instance ('command').
|
|
688
|
+
|
|
689
|
+
'command_obj' must be a Command instance. If 'option_dict' is not
|
|
690
|
+
supplied, uses the standard option dictionary for this command
|
|
691
|
+
(from 'self.command_options').
|
|
692
|
+
|
|
693
|
+
(Adopted from distutils.dist.Distribution._set_command_options)
|
|
694
|
+
"""
|
|
695
|
+
command_name = command_obj.get_command_name()
|
|
696
|
+
if option_dict is None:
|
|
697
|
+
option_dict = self.get_option_dict(command_name)
|
|
698
|
+
|
|
699
|
+
if DEBUG:
|
|
700
|
+
self.announce(f" setting options for '{command_name}' command:")
|
|
701
|
+
for option, (source, value) in option_dict.items():
|
|
702
|
+
if DEBUG:
|
|
703
|
+
self.announce(f" {option} = {value} (from {source})")
|
|
704
|
+
try:
|
|
705
|
+
bool_opts = [translate_longopt(o) for o in command_obj.boolean_options]
|
|
706
|
+
except AttributeError:
|
|
707
|
+
bool_opts = []
|
|
708
|
+
try:
|
|
709
|
+
neg_opt = command_obj.negative_opt
|
|
710
|
+
except AttributeError:
|
|
711
|
+
neg_opt = {}
|
|
712
|
+
|
|
713
|
+
try:
|
|
714
|
+
is_string = isinstance(value, str)
|
|
715
|
+
if option in neg_opt and is_string:
|
|
716
|
+
setattr(command_obj, neg_opt[option], not strtobool(value))
|
|
717
|
+
elif option in bool_opts and is_string:
|
|
718
|
+
setattr(command_obj, option, strtobool(value))
|
|
719
|
+
elif hasattr(command_obj, option):
|
|
720
|
+
setattr(command_obj, option, value)
|
|
721
|
+
else:
|
|
722
|
+
raise DistutilsOptionError(
|
|
723
|
+
f"error in {source}: command '{command_name}' has no such option '{option}'"
|
|
724
|
+
)
|
|
725
|
+
except ValueError as e:
|
|
726
|
+
raise DistutilsOptionError(e) from e
|
|
727
|
+
|
|
728
|
+
def _get_project_config_files(self, filenames: Iterable[StrPath] | None):
|
|
729
|
+
"""Add default file and split between INI and TOML"""
|
|
730
|
+
tomlfiles = []
|
|
731
|
+
standard_project_metadata = Path(self.src_root or os.curdir, "pyproject.toml")
|
|
732
|
+
if filenames is not None:
|
|
733
|
+
parts = partition(lambda f: Path(f).suffix == ".toml", filenames)
|
|
734
|
+
filenames = list(parts[0]) # 1st element => predicate is False
|
|
735
|
+
tomlfiles = list(parts[1]) # 2nd element => predicate is True
|
|
736
|
+
elif standard_project_metadata.exists():
|
|
737
|
+
tomlfiles = [standard_project_metadata]
|
|
738
|
+
return filenames, tomlfiles
|
|
739
|
+
|
|
740
|
+
def parse_config_files(
|
|
741
|
+
self,
|
|
742
|
+
filenames: Iterable[StrPath] | None = None,
|
|
743
|
+
ignore_option_errors: bool = False,
|
|
744
|
+
) -> None:
|
|
745
|
+
"""Parses configuration files from various levels
|
|
746
|
+
and loads configuration.
|
|
747
|
+
"""
|
|
748
|
+
inifiles, tomlfiles = self._get_project_config_files(filenames)
|
|
749
|
+
|
|
750
|
+
self._parse_config_files(filenames=inifiles)
|
|
751
|
+
|
|
752
|
+
setupcfg.parse_configuration(
|
|
753
|
+
self, self.command_options, ignore_option_errors=ignore_option_errors
|
|
754
|
+
)
|
|
755
|
+
for filename in tomlfiles:
|
|
756
|
+
pyprojecttoml.apply_configuration(self, filename, ignore_option_errors)
|
|
757
|
+
|
|
758
|
+
self._finalize_requires()
|
|
759
|
+
self._finalize_license_expression()
|
|
760
|
+
self._finalize_license_files()
|
|
761
|
+
|
|
762
|
+
def fetch_build_eggs(self, requires: _StrOrIter) -> list[metadata.Distribution]:
|
|
763
|
+
"""Resolve pre-setup requirements"""
|
|
764
|
+
from .installer import _fetch_build_eggs
|
|
765
|
+
|
|
766
|
+
return _fetch_build_eggs(self, requires)
|
|
767
|
+
|
|
768
|
+
def finalize_options(self) -> None:
|
|
769
|
+
"""
|
|
770
|
+
Allow plugins to apply arbitrary operations to the
|
|
771
|
+
distribution. Each hook may optionally define a 'order'
|
|
772
|
+
to influence the order of execution. Smaller numbers
|
|
773
|
+
go first and the default is 0.
|
|
774
|
+
"""
|
|
775
|
+
group = 'setuptools.finalize_distribution_options'
|
|
776
|
+
|
|
777
|
+
def by_order(hook):
|
|
778
|
+
return getattr(hook, 'order', 0)
|
|
779
|
+
|
|
780
|
+
defined = metadata.entry_points(group=group)
|
|
781
|
+
filtered = itertools.filterfalse(self._removed, defined)
|
|
782
|
+
loaded = map(lambda e: e.load(), filtered)
|
|
783
|
+
for ep in sorted(loaded, key=by_order):
|
|
784
|
+
ep(self)
|
|
785
|
+
|
|
786
|
+
@staticmethod
|
|
787
|
+
def _removed(ep):
|
|
788
|
+
"""
|
|
789
|
+
When removing an entry point, if metadata is loaded
|
|
790
|
+
from an older version of Setuptools, that removed
|
|
791
|
+
entry point will attempt to be loaded and will fail.
|
|
792
|
+
See #2765 for more details.
|
|
793
|
+
"""
|
|
794
|
+
removed = {
|
|
795
|
+
# removed 2021-09-05
|
|
796
|
+
'2to3_doctests',
|
|
797
|
+
}
|
|
798
|
+
return ep.name in removed
|
|
799
|
+
|
|
800
|
+
def _finalize_setup_keywords(self):
|
|
801
|
+
for ep in metadata.entry_points(group='distutils.setup_keywords'):
|
|
802
|
+
value = getattr(self, ep.name, None)
|
|
803
|
+
if value is not None:
|
|
804
|
+
ep.load()(self, ep.name, value)
|
|
805
|
+
|
|
806
|
+
def get_egg_cache_dir(self):
|
|
807
|
+
from . import windows_support
|
|
808
|
+
|
|
809
|
+
egg_cache_dir = os.path.join(os.curdir, '.eggs')
|
|
810
|
+
if not os.path.exists(egg_cache_dir):
|
|
811
|
+
os.mkdir(egg_cache_dir)
|
|
812
|
+
windows_support.hide_file(egg_cache_dir)
|
|
813
|
+
readme_txt_filename = os.path.join(egg_cache_dir, 'README.txt')
|
|
814
|
+
with open(readme_txt_filename, 'w', encoding="utf-8") as f:
|
|
815
|
+
f.write(
|
|
816
|
+
'This directory contains eggs that were downloaded '
|
|
817
|
+
'by setuptools to build, test, and run plug-ins.\n\n'
|
|
818
|
+
)
|
|
819
|
+
f.write(
|
|
820
|
+
'This directory caches those eggs to prevent '
|
|
821
|
+
'repeated downloads.\n\n'
|
|
822
|
+
)
|
|
823
|
+
f.write('However, it is safe to delete this directory.\n\n')
|
|
824
|
+
|
|
825
|
+
return egg_cache_dir
|
|
826
|
+
|
|
827
|
+
def fetch_build_egg(self, req):
|
|
828
|
+
"""Fetch an egg needed for building"""
|
|
829
|
+
from .installer import fetch_build_egg
|
|
830
|
+
|
|
831
|
+
return fetch_build_egg(self, req)
|
|
832
|
+
|
|
833
|
+
def get_command_class(self, command: str) -> type[distutils.cmd.Command]: # type: ignore[override] # Not doing complex overrides yet
|
|
834
|
+
"""Pluggable version of get_command_class()"""
|
|
835
|
+
if command in self.cmdclass:
|
|
836
|
+
return self.cmdclass[command]
|
|
837
|
+
|
|
838
|
+
# Special case bdist_wheel so it's never loaded from "wheel"
|
|
839
|
+
if command == 'bdist_wheel':
|
|
840
|
+
from .command.bdist_wheel import bdist_wheel
|
|
841
|
+
|
|
842
|
+
return bdist_wheel
|
|
843
|
+
|
|
844
|
+
eps = metadata.entry_points(group='distutils.commands', name=command)
|
|
845
|
+
for ep in eps:
|
|
846
|
+
self.cmdclass[command] = cmdclass = ep.load()
|
|
847
|
+
return cmdclass
|
|
848
|
+
else:
|
|
849
|
+
return _Distribution.get_command_class(self, command)
|
|
850
|
+
|
|
851
|
+
def print_commands(self):
|
|
852
|
+
for ep in metadata.entry_points(group='distutils.commands'):
|
|
853
|
+
if ep.name not in self.cmdclass:
|
|
854
|
+
cmdclass = ep.load()
|
|
855
|
+
self.cmdclass[ep.name] = cmdclass
|
|
856
|
+
return _Distribution.print_commands(self)
|
|
857
|
+
|
|
858
|
+
def get_command_list(self):
|
|
859
|
+
for ep in metadata.entry_points(group='distutils.commands'):
|
|
860
|
+
if ep.name not in self.cmdclass:
|
|
861
|
+
cmdclass = ep.load()
|
|
862
|
+
self.cmdclass[ep.name] = cmdclass
|
|
863
|
+
return _Distribution.get_command_list(self)
|
|
864
|
+
|
|
865
|
+
def include(self, **attrs) -> None:
|
|
866
|
+
"""Add items to distribution that are named in keyword arguments
|
|
867
|
+
|
|
868
|
+
For example, 'dist.include(py_modules=["x"])' would add 'x' to
|
|
869
|
+
the distribution's 'py_modules' attribute, if it was not already
|
|
870
|
+
there.
|
|
871
|
+
|
|
872
|
+
Currently, this method only supports inclusion for attributes that are
|
|
873
|
+
lists or tuples. If you need to add support for adding to other
|
|
874
|
+
attributes in this or a subclass, you can add an '_include_X' method,
|
|
875
|
+
where 'X' is the name of the attribute. The method will be called with
|
|
876
|
+
the value passed to 'include()'. So, 'dist.include(foo={"bar":"baz"})'
|
|
877
|
+
will try to call 'dist._include_foo({"bar":"baz"})', which can then
|
|
878
|
+
handle whatever special inclusion logic is needed.
|
|
879
|
+
"""
|
|
880
|
+
for k, v in attrs.items():
|
|
881
|
+
include = getattr(self, '_include_' + k, None)
|
|
882
|
+
if include:
|
|
883
|
+
include(v)
|
|
884
|
+
else:
|
|
885
|
+
self._include_misc(k, v)
|
|
886
|
+
|
|
887
|
+
def exclude_package(self, package: str) -> None:
|
|
888
|
+
"""Remove packages, modules, and extensions in named package"""
|
|
889
|
+
|
|
890
|
+
pfx = package + '.'
|
|
891
|
+
if self.packages:
|
|
892
|
+
self.packages = [
|
|
893
|
+
p for p in self.packages if p != package and not p.startswith(pfx)
|
|
894
|
+
]
|
|
895
|
+
|
|
896
|
+
if self.py_modules:
|
|
897
|
+
self.py_modules = [
|
|
898
|
+
p for p in self.py_modules if p != package and not p.startswith(pfx)
|
|
899
|
+
]
|
|
900
|
+
|
|
901
|
+
if self.ext_modules:
|
|
902
|
+
self.ext_modules = [
|
|
903
|
+
p
|
|
904
|
+
for p in self.ext_modules
|
|
905
|
+
if p.name != package and not p.name.startswith(pfx)
|
|
906
|
+
]
|
|
907
|
+
|
|
908
|
+
def has_contents_for(self, package: str) -> bool:
|
|
909
|
+
"""Return true if 'exclude_package(package)' would do something"""
|
|
910
|
+
|
|
911
|
+
pfx = package + '.'
|
|
912
|
+
|
|
913
|
+
for p in self.iter_distribution_names():
|
|
914
|
+
if p == package or p.startswith(pfx):
|
|
915
|
+
return True
|
|
916
|
+
|
|
917
|
+
return False
|
|
918
|
+
|
|
919
|
+
def _exclude_misc(self, name: str, value: _Sequence) -> None:
|
|
920
|
+
"""Handle 'exclude()' for list/tuple attrs without a special handler"""
|
|
921
|
+
if not isinstance(value, _sequence):
|
|
922
|
+
raise DistutilsSetupError(
|
|
923
|
+
f"{name}: setting must be of type <{_sequence_type_repr}> (got {value!r})"
|
|
924
|
+
)
|
|
925
|
+
try:
|
|
926
|
+
old = getattr(self, name)
|
|
927
|
+
except AttributeError as e:
|
|
928
|
+
raise DistutilsSetupError(f"{name}: No such distribution setting") from e
|
|
929
|
+
if old is not None and not isinstance(old, _sequence):
|
|
930
|
+
raise DistutilsSetupError(
|
|
931
|
+
name + ": this setting cannot be changed via include/exclude"
|
|
932
|
+
)
|
|
933
|
+
elif old:
|
|
934
|
+
setattr(self, name, [item for item in old if item not in value])
|
|
935
|
+
|
|
936
|
+
def _include_misc(self, name: str, value: _Sequence) -> None:
|
|
937
|
+
"""Handle 'include()' for list/tuple attrs without a special handler"""
|
|
938
|
+
|
|
939
|
+
if not isinstance(value, _sequence):
|
|
940
|
+
raise DistutilsSetupError(
|
|
941
|
+
f"{name}: setting must be of type <{_sequence_type_repr}> (got {value!r})"
|
|
942
|
+
)
|
|
943
|
+
try:
|
|
944
|
+
old = getattr(self, name)
|
|
945
|
+
except AttributeError as e:
|
|
946
|
+
raise DistutilsSetupError(f"{name}: No such distribution setting") from e
|
|
947
|
+
if old is None:
|
|
948
|
+
setattr(self, name, value)
|
|
949
|
+
elif not isinstance(old, _sequence):
|
|
950
|
+
raise DistutilsSetupError(
|
|
951
|
+
name + ": this setting cannot be changed via include/exclude"
|
|
952
|
+
)
|
|
953
|
+
else:
|
|
954
|
+
new = [item for item in value if item not in old]
|
|
955
|
+
setattr(self, name, list(old) + new)
|
|
956
|
+
|
|
957
|
+
def exclude(self, **attrs) -> None:
|
|
958
|
+
"""Remove items from distribution that are named in keyword arguments
|
|
959
|
+
|
|
960
|
+
For example, 'dist.exclude(py_modules=["x"])' would remove 'x' from
|
|
961
|
+
the distribution's 'py_modules' attribute. Excluding packages uses
|
|
962
|
+
the 'exclude_package()' method, so all of the package's contained
|
|
963
|
+
packages, modules, and extensions are also excluded.
|
|
964
|
+
|
|
965
|
+
Currently, this method only supports exclusion from attributes that are
|
|
966
|
+
lists or tuples. If you need to add support for excluding from other
|
|
967
|
+
attributes in this or a subclass, you can add an '_exclude_X' method,
|
|
968
|
+
where 'X' is the name of the attribute. The method will be called with
|
|
969
|
+
the value passed to 'exclude()'. So, 'dist.exclude(foo={"bar":"baz"})'
|
|
970
|
+
will try to call 'dist._exclude_foo({"bar":"baz"})', which can then
|
|
971
|
+
handle whatever special exclusion logic is needed.
|
|
972
|
+
"""
|
|
973
|
+
for k, v in attrs.items():
|
|
974
|
+
exclude = getattr(self, '_exclude_' + k, None)
|
|
975
|
+
if exclude:
|
|
976
|
+
exclude(v)
|
|
977
|
+
else:
|
|
978
|
+
self._exclude_misc(k, v)
|
|
979
|
+
|
|
980
|
+
def _exclude_packages(self, packages: _Sequence) -> None:
|
|
981
|
+
if not isinstance(packages, _sequence):
|
|
982
|
+
raise DistutilsSetupError(
|
|
983
|
+
f"packages: setting must be of type <{_sequence_type_repr}> (got {packages!r})"
|
|
984
|
+
)
|
|
985
|
+
list(map(self.exclude_package, packages))
|
|
986
|
+
|
|
987
|
+
def _parse_command_opts(self, parser, args):
|
|
988
|
+
# Remove --with-X/--without-X options when processing command args
|
|
989
|
+
self.global_options = self.__class__.global_options
|
|
990
|
+
self.negative_opt = self.__class__.negative_opt
|
|
991
|
+
|
|
992
|
+
# First, expand any aliases
|
|
993
|
+
command = args[0]
|
|
994
|
+
aliases = self.get_option_dict('aliases')
|
|
995
|
+
while command in aliases:
|
|
996
|
+
_src, alias = aliases[command]
|
|
997
|
+
del aliases[command] # ensure each alias can expand only once!
|
|
998
|
+
import shlex
|
|
999
|
+
|
|
1000
|
+
args[:1] = shlex.split(alias, True)
|
|
1001
|
+
command = args[0]
|
|
1002
|
+
|
|
1003
|
+
nargs = _Distribution._parse_command_opts(self, parser, args)
|
|
1004
|
+
|
|
1005
|
+
# Handle commands that want to consume all remaining arguments
|
|
1006
|
+
cmd_class = self.get_command_class(command)
|
|
1007
|
+
if getattr(cmd_class, 'command_consumes_arguments', None):
|
|
1008
|
+
self.get_option_dict(command)['args'] = ("command line", nargs)
|
|
1009
|
+
if nargs is not None:
|
|
1010
|
+
return []
|
|
1011
|
+
|
|
1012
|
+
return nargs
|
|
1013
|
+
|
|
1014
|
+
def get_cmdline_options(self) -> dict[str, dict[str, str | None]]:
|
|
1015
|
+
"""Return a '{cmd: {opt:val}}' map of all command-line options
|
|
1016
|
+
|
|
1017
|
+
Option names are all long, but do not include the leading '--', and
|
|
1018
|
+
contain dashes rather than underscores. If the option doesn't take
|
|
1019
|
+
an argument (e.g. '--quiet'), the 'val' is 'None'.
|
|
1020
|
+
|
|
1021
|
+
Note that options provided by config files are intentionally excluded.
|
|
1022
|
+
"""
|
|
1023
|
+
|
|
1024
|
+
d: dict[str, dict[str, str | None]] = {}
|
|
1025
|
+
|
|
1026
|
+
for cmd, opts in self.command_options.items():
|
|
1027
|
+
val: str | None
|
|
1028
|
+
for opt, (src, val) in opts.items():
|
|
1029
|
+
if src != "command line":
|
|
1030
|
+
continue
|
|
1031
|
+
|
|
1032
|
+
opt = opt.replace('_', '-')
|
|
1033
|
+
|
|
1034
|
+
if val == 0:
|
|
1035
|
+
cmdobj = self.get_command_obj(cmd)
|
|
1036
|
+
neg_opt = self.negative_opt.copy()
|
|
1037
|
+
neg_opt.update(getattr(cmdobj, 'negative_opt', {}))
|
|
1038
|
+
for neg, pos in neg_opt.items():
|
|
1039
|
+
if pos == opt:
|
|
1040
|
+
opt = neg
|
|
1041
|
+
val = None
|
|
1042
|
+
break
|
|
1043
|
+
else:
|
|
1044
|
+
raise AssertionError("Shouldn't be able to get here")
|
|
1045
|
+
|
|
1046
|
+
elif val == 1:
|
|
1047
|
+
val = None
|
|
1048
|
+
|
|
1049
|
+
d.setdefault(cmd, {})[opt] = val
|
|
1050
|
+
|
|
1051
|
+
return d
|
|
1052
|
+
|
|
1053
|
+
def iter_distribution_names(self):
|
|
1054
|
+
"""Yield all packages, modules, and extension names in distribution"""
|
|
1055
|
+
|
|
1056
|
+
yield from self.packages or ()
|
|
1057
|
+
|
|
1058
|
+
yield from self.py_modules or ()
|
|
1059
|
+
|
|
1060
|
+
for ext in self.ext_modules or ():
|
|
1061
|
+
if isinstance(ext, tuple):
|
|
1062
|
+
name, _buildinfo = ext
|
|
1063
|
+
else:
|
|
1064
|
+
name = ext.name
|
|
1065
|
+
if name.endswith('module'):
|
|
1066
|
+
name = name[:-6]
|
|
1067
|
+
yield name
|
|
1068
|
+
|
|
1069
|
+
def handle_display_options(self, option_order):
|
|
1070
|
+
"""If there were any non-global "display-only" options
|
|
1071
|
+
(--help-commands or the metadata display options) on the command
|
|
1072
|
+
line, display the requested info and return true; else return
|
|
1073
|
+
false.
|
|
1074
|
+
"""
|
|
1075
|
+
import sys
|
|
1076
|
+
|
|
1077
|
+
if self.help_commands:
|
|
1078
|
+
return _Distribution.handle_display_options(self, option_order)
|
|
1079
|
+
|
|
1080
|
+
# Stdout may be StringIO (e.g. in tests)
|
|
1081
|
+
if not isinstance(sys.stdout, io.TextIOWrapper):
|
|
1082
|
+
return _Distribution.handle_display_options(self, option_order)
|
|
1083
|
+
|
|
1084
|
+
# Don't wrap stdout if utf-8 is already the encoding. Provides
|
|
1085
|
+
# workaround for #334.
|
|
1086
|
+
if sys.stdout.encoding.lower() in ('utf-8', 'utf8'):
|
|
1087
|
+
return _Distribution.handle_display_options(self, option_order)
|
|
1088
|
+
|
|
1089
|
+
# Print metadata in UTF-8 no matter the platform
|
|
1090
|
+
encoding = sys.stdout.encoding
|
|
1091
|
+
sys.stdout.reconfigure(encoding='utf-8')
|
|
1092
|
+
try:
|
|
1093
|
+
return _Distribution.handle_display_options(self, option_order)
|
|
1094
|
+
finally:
|
|
1095
|
+
sys.stdout.reconfigure(encoding=encoding)
|
|
1096
|
+
|
|
1097
|
+
def run_command(self, command) -> None:
|
|
1098
|
+
self.set_defaults()
|
|
1099
|
+
# Postpone defaults until all explicit configuration is considered
|
|
1100
|
+
# (setup() args, config files, command line and plugins)
|
|
1101
|
+
|
|
1102
|
+
super().run_command(command)
|
|
1103
|
+
|
|
1104
|
+
|
|
1105
|
+
@functools.cache
|
|
1106
|
+
def _setuptools_commands() -> set[str]:
|
|
1107
|
+
try:
|
|
1108
|
+
# Use older API for importlib.metadata compatibility
|
|
1109
|
+
entry_points = metadata.distribution('setuptools').entry_points
|
|
1110
|
+
eps: Iterable[str] = (ep.name for ep in entry_points)
|
|
1111
|
+
except metadata.PackageNotFoundError:
|
|
1112
|
+
# during bootstrapping, distribution doesn't exist
|
|
1113
|
+
eps = []
|
|
1114
|
+
return {*distutils.command.__all__, *eps}
|
|
1115
|
+
|
|
1116
|
+
|
|
1117
|
+
class DistDeprecationWarning(SetuptoolsDeprecationWarning):
|
|
1118
|
+
"""Class for warning about deprecations in dist in
|
|
1119
|
+
setuptools. Not ignored by default, unlike DeprecationWarning."""
|