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,772 @@
|
|
|
1
|
+
"""Make sure that applying the configuration from pyproject.toml is equivalent to
|
|
2
|
+
applying a similar configuration from setup.cfg
|
|
3
|
+
|
|
4
|
+
To run these tests offline, please have a look on ``./downloads/preload.py``
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
import io
|
|
10
|
+
import re
|
|
11
|
+
import tarfile
|
|
12
|
+
from inspect import cleandoc
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
from unittest.mock import Mock
|
|
15
|
+
|
|
16
|
+
import pytest
|
|
17
|
+
from ini2toml.api import LiteTranslator
|
|
18
|
+
from packaging.metadata import Metadata
|
|
19
|
+
|
|
20
|
+
import setuptools # noqa: F401 # ensure monkey patch to metadata
|
|
21
|
+
from setuptools._static import is_static
|
|
22
|
+
from setuptools.command.egg_info import write_requirements
|
|
23
|
+
from setuptools.config import expand, pyprojecttoml, setupcfg
|
|
24
|
+
from setuptools.config._apply_pyprojecttoml import _MissingDynamic, _some_attrgetter
|
|
25
|
+
from setuptools.dist import Distribution
|
|
26
|
+
from setuptools.errors import InvalidConfigError, RemovedConfigError
|
|
27
|
+
from setuptools.warnings import InformationOnly, SetuptoolsDeprecationWarning
|
|
28
|
+
|
|
29
|
+
from .downloads import retrieve_file, urls_from_file
|
|
30
|
+
|
|
31
|
+
HERE = Path(__file__).parent
|
|
32
|
+
EXAMPLES_FILE = "setupcfg_examples.txt"
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def makedist(path, **attrs):
|
|
36
|
+
return Distribution({"src_root": path, **attrs})
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def _mock_expand_patterns(patterns, *_, **__):
|
|
40
|
+
"""
|
|
41
|
+
Allow comparing the given patterns for 2 dist objects.
|
|
42
|
+
We need to strip special chars to avoid errors when validating.
|
|
43
|
+
"""
|
|
44
|
+
return [re.sub("[^a-z0-9]+", "", p, flags=re.I) or "empty" for p in patterns]
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
@pytest.mark.parametrize("url", urls_from_file(HERE / EXAMPLES_FILE))
|
|
48
|
+
@pytest.mark.filterwarnings("ignore")
|
|
49
|
+
@pytest.mark.uses_network
|
|
50
|
+
def test_apply_pyproject_equivalent_to_setupcfg(url, monkeypatch, tmp_path):
|
|
51
|
+
monkeypatch.setattr(expand, "read_attr", Mock(return_value="0.0.1"))
|
|
52
|
+
monkeypatch.setattr(
|
|
53
|
+
Distribution, "_expand_patterns", Mock(side_effect=_mock_expand_patterns)
|
|
54
|
+
)
|
|
55
|
+
setupcfg_example = retrieve_file(url)
|
|
56
|
+
pyproject_example = Path(tmp_path, "pyproject.toml")
|
|
57
|
+
setupcfg_text = setupcfg_example.read_text(encoding="utf-8")
|
|
58
|
+
toml_config = LiteTranslator().translate(setupcfg_text, "setup.cfg")
|
|
59
|
+
pyproject_example.write_text(toml_config, encoding="utf-8")
|
|
60
|
+
|
|
61
|
+
dist_toml = pyprojecttoml.apply_configuration(makedist(tmp_path), pyproject_example)
|
|
62
|
+
dist_cfg = setupcfg.apply_configuration(makedist(tmp_path), setupcfg_example)
|
|
63
|
+
|
|
64
|
+
pkg_info_toml = core_metadata(dist_toml)
|
|
65
|
+
pkg_info_cfg = core_metadata(dist_cfg)
|
|
66
|
+
assert pkg_info_toml == pkg_info_cfg
|
|
67
|
+
|
|
68
|
+
if any(getattr(d, "license_files", None) for d in (dist_toml, dist_cfg)):
|
|
69
|
+
assert set(dist_toml.license_files) == set(dist_cfg.license_files)
|
|
70
|
+
|
|
71
|
+
if any(getattr(d, "entry_points", None) for d in (dist_toml, dist_cfg)):
|
|
72
|
+
print(dist_cfg.entry_points)
|
|
73
|
+
ep_toml = {
|
|
74
|
+
(k, *sorted(i.replace(" ", "") for i in v))
|
|
75
|
+
for k, v in dist_toml.entry_points.items()
|
|
76
|
+
}
|
|
77
|
+
ep_cfg = {
|
|
78
|
+
(k, *sorted(i.replace(" ", "") for i in v))
|
|
79
|
+
for k, v in dist_cfg.entry_points.items()
|
|
80
|
+
}
|
|
81
|
+
assert ep_toml == ep_cfg
|
|
82
|
+
|
|
83
|
+
if any(getattr(d, "package_data", None) for d in (dist_toml, dist_cfg)):
|
|
84
|
+
pkg_data_toml = {(k, *sorted(v)) for k, v in dist_toml.package_data.items()}
|
|
85
|
+
pkg_data_cfg = {(k, *sorted(v)) for k, v in dist_cfg.package_data.items()}
|
|
86
|
+
assert pkg_data_toml == pkg_data_cfg
|
|
87
|
+
|
|
88
|
+
if any(getattr(d, "data_files", None) for d in (dist_toml, dist_cfg)):
|
|
89
|
+
data_files_toml = {(k, *sorted(v)) for k, v in dist_toml.data_files}
|
|
90
|
+
data_files_cfg = {(k, *sorted(v)) for k, v in dist_cfg.data_files}
|
|
91
|
+
assert data_files_toml == data_files_cfg
|
|
92
|
+
|
|
93
|
+
assert set(dist_toml.install_requires) == set(dist_cfg.install_requires)
|
|
94
|
+
if any(getattr(d, "extras_require", None) for d in (dist_toml, dist_cfg)):
|
|
95
|
+
extra_req_toml = {(k, *sorted(v)) for k, v in dist_toml.extras_require.items()}
|
|
96
|
+
extra_req_cfg = {(k, *sorted(v)) for k, v in dist_cfg.extras_require.items()}
|
|
97
|
+
assert extra_req_toml == extra_req_cfg
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
PEP621_EXAMPLE = """\
|
|
101
|
+
[project]
|
|
102
|
+
name = "spam"
|
|
103
|
+
version = "2020.0.0"
|
|
104
|
+
description = "Lovely Spam! Wonderful Spam!"
|
|
105
|
+
readme = "README.rst"
|
|
106
|
+
requires-python = ">=3.8"
|
|
107
|
+
license-files = ["LICENSE.txt"] # Updated to be PEP 639 compliant
|
|
108
|
+
keywords = ["egg", "bacon", "sausage", "tomatoes", "Lobster Thermidor"]
|
|
109
|
+
authors = [
|
|
110
|
+
{email = "hi@pradyunsg.me"},
|
|
111
|
+
{name = "Tzu-Ping Chung"}
|
|
112
|
+
]
|
|
113
|
+
maintainers = [
|
|
114
|
+
{name = "Brett Cannon", email = "brett@python.org"},
|
|
115
|
+
{name = "John X. Ãørçeč", email = "john@utf8.org"},
|
|
116
|
+
{name = "Γαμα קּ 東", email = "gama@utf8.org"},
|
|
117
|
+
]
|
|
118
|
+
classifiers = [
|
|
119
|
+
"Development Status :: 4 - Beta",
|
|
120
|
+
"Programming Language :: Python"
|
|
121
|
+
]
|
|
122
|
+
|
|
123
|
+
dependencies = [
|
|
124
|
+
"httpx",
|
|
125
|
+
"gidgethub[httpx]>4.0.0",
|
|
126
|
+
"django>2.1; os_name != 'nt'",
|
|
127
|
+
"django>2.0; os_name == 'nt'"
|
|
128
|
+
]
|
|
129
|
+
|
|
130
|
+
[project.optional-dependencies]
|
|
131
|
+
test = [
|
|
132
|
+
"pytest < 5.0.0",
|
|
133
|
+
"pytest-cov[all]"
|
|
134
|
+
]
|
|
135
|
+
|
|
136
|
+
[project.urls]
|
|
137
|
+
homepage = "http://example.com"
|
|
138
|
+
documentation = "http://readthedocs.org"
|
|
139
|
+
repository = "http://github.com"
|
|
140
|
+
changelog = "http://github.com/me/spam/blob/master/CHANGELOG.md"
|
|
141
|
+
|
|
142
|
+
[project.scripts]
|
|
143
|
+
spam-cli = "spam:main_cli"
|
|
144
|
+
|
|
145
|
+
[project.gui-scripts]
|
|
146
|
+
spam-gui = "spam:main_gui"
|
|
147
|
+
|
|
148
|
+
[project.entry-points."spam.magical"]
|
|
149
|
+
tomatoes = "spam:main_tomatoes"
|
|
150
|
+
"""
|
|
151
|
+
|
|
152
|
+
PEP621_INTERNATIONAL_EMAIL_EXAMPLE = """\
|
|
153
|
+
[project]
|
|
154
|
+
name = "spam"
|
|
155
|
+
version = "2020.0.0"
|
|
156
|
+
authors = [
|
|
157
|
+
{email = "hi@pradyunsg.me"},
|
|
158
|
+
{name = "Tzu-Ping Chung"}
|
|
159
|
+
]
|
|
160
|
+
maintainers = [
|
|
161
|
+
{name = "Степан Бандера", email = "криївка@оун-упа.укр"},
|
|
162
|
+
]
|
|
163
|
+
"""
|
|
164
|
+
|
|
165
|
+
PEP621_EXAMPLE_SCRIPT = """
|
|
166
|
+
def main_cli(): pass
|
|
167
|
+
def main_gui(): pass
|
|
168
|
+
def main_tomatoes(): pass
|
|
169
|
+
"""
|
|
170
|
+
|
|
171
|
+
PEP639_LICENSE_TEXT = """\
|
|
172
|
+
[project]
|
|
173
|
+
name = "spam"
|
|
174
|
+
version = "2020.0.0"
|
|
175
|
+
authors = [
|
|
176
|
+
{email = "hi@pradyunsg.me"},
|
|
177
|
+
{name = "Tzu-Ping Chung"}
|
|
178
|
+
]
|
|
179
|
+
license = {text = "MIT"}
|
|
180
|
+
"""
|
|
181
|
+
|
|
182
|
+
PEP639_LICENSE_EXPRESSION = """\
|
|
183
|
+
[project]
|
|
184
|
+
name = "spam"
|
|
185
|
+
version = "2020.0.0"
|
|
186
|
+
authors = [
|
|
187
|
+
{email = "hi@pradyunsg.me"},
|
|
188
|
+
{name = "Tzu-Ping Chung"}
|
|
189
|
+
]
|
|
190
|
+
license = "mit or apache-2.0" # should be normalized in metadata
|
|
191
|
+
classifiers = [
|
|
192
|
+
"Development Status :: 5 - Production/Stable",
|
|
193
|
+
"Programming Language :: Python",
|
|
194
|
+
]
|
|
195
|
+
"""
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
def _pep621_example_project(
|
|
199
|
+
tmp_path,
|
|
200
|
+
readme="README.rst",
|
|
201
|
+
pyproject_text=PEP621_EXAMPLE,
|
|
202
|
+
):
|
|
203
|
+
pyproject = tmp_path / "pyproject.toml"
|
|
204
|
+
text = pyproject_text
|
|
205
|
+
replacements = {'readme = "README.rst"': f'readme = "{readme}"'}
|
|
206
|
+
for orig, subst in replacements.items():
|
|
207
|
+
text = text.replace(orig, subst)
|
|
208
|
+
pyproject.write_text(text, encoding="utf-8")
|
|
209
|
+
|
|
210
|
+
(tmp_path / readme).write_text("hello world", encoding="utf-8")
|
|
211
|
+
(tmp_path / "LICENSE.txt").write_text("--- LICENSE stub ---", encoding="utf-8")
|
|
212
|
+
(tmp_path / "spam.py").write_text(PEP621_EXAMPLE_SCRIPT, encoding="utf-8")
|
|
213
|
+
return pyproject
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
def test_pep621_example(tmp_path):
|
|
217
|
+
"""Make sure the example in PEP 621 works"""
|
|
218
|
+
pyproject = _pep621_example_project(tmp_path)
|
|
219
|
+
dist = pyprojecttoml.apply_configuration(makedist(tmp_path), pyproject)
|
|
220
|
+
assert set(dist.metadata.license_files) == {"LICENSE.txt"}
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
@pytest.mark.parametrize(
|
|
224
|
+
("readme", "ctype"),
|
|
225
|
+
[
|
|
226
|
+
("Readme.txt", "text/plain"),
|
|
227
|
+
("readme.md", "text/markdown"),
|
|
228
|
+
("text.rst", "text/x-rst"),
|
|
229
|
+
],
|
|
230
|
+
)
|
|
231
|
+
def test_readme_content_type(tmp_path, readme, ctype):
|
|
232
|
+
pyproject = _pep621_example_project(tmp_path, readme)
|
|
233
|
+
dist = pyprojecttoml.apply_configuration(makedist(tmp_path), pyproject)
|
|
234
|
+
assert dist.metadata.long_description_content_type == ctype
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
def test_undefined_content_type(tmp_path):
|
|
238
|
+
pyproject = _pep621_example_project(tmp_path, "README.tex")
|
|
239
|
+
with pytest.raises(ValueError, match="Undefined content type for README.tex"):
|
|
240
|
+
pyprojecttoml.apply_configuration(makedist(tmp_path), pyproject)
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
def test_no_explicit_content_type_for_missing_extension(tmp_path):
|
|
244
|
+
pyproject = _pep621_example_project(tmp_path, "README")
|
|
245
|
+
dist = pyprojecttoml.apply_configuration(makedist(tmp_path), pyproject)
|
|
246
|
+
assert dist.metadata.long_description_content_type is None
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
@pytest.mark.parametrize(
|
|
250
|
+
("pyproject_text", "expected_maintainers_meta_value"),
|
|
251
|
+
(
|
|
252
|
+
pytest.param(
|
|
253
|
+
PEP621_EXAMPLE,
|
|
254
|
+
(
|
|
255
|
+
'Brett Cannon <brett@python.org>, "John X. Ãørçeč" <john@utf8.org>, '
|
|
256
|
+
'Γαμα קּ 東 <gama@utf8.org>'
|
|
257
|
+
),
|
|
258
|
+
id='non-international-emails',
|
|
259
|
+
),
|
|
260
|
+
pytest.param(
|
|
261
|
+
PEP621_INTERNATIONAL_EMAIL_EXAMPLE,
|
|
262
|
+
'Степан Бандера <криївка@оун-упа.укр>',
|
|
263
|
+
marks=pytest.mark.xfail(
|
|
264
|
+
reason="CPython's `email.headerregistry.Address` only supports "
|
|
265
|
+
'RFC 5322, as of Nov 10, 2022 and latest Python 3.11.0',
|
|
266
|
+
strict=True,
|
|
267
|
+
),
|
|
268
|
+
id='international-email',
|
|
269
|
+
),
|
|
270
|
+
),
|
|
271
|
+
)
|
|
272
|
+
def test_utf8_maintainer_in_metadata( # issue-3663
|
|
273
|
+
expected_maintainers_meta_value,
|
|
274
|
+
pyproject_text,
|
|
275
|
+
tmp_path,
|
|
276
|
+
):
|
|
277
|
+
pyproject = _pep621_example_project(
|
|
278
|
+
tmp_path,
|
|
279
|
+
"README",
|
|
280
|
+
pyproject_text=pyproject_text,
|
|
281
|
+
)
|
|
282
|
+
dist = pyprojecttoml.apply_configuration(makedist(tmp_path), pyproject)
|
|
283
|
+
assert dist.metadata.maintainer_email == expected_maintainers_meta_value
|
|
284
|
+
pkg_file = tmp_path / "PKG-FILE"
|
|
285
|
+
with open(pkg_file, "w", encoding="utf-8") as fh:
|
|
286
|
+
dist.metadata.write_pkg_file(fh)
|
|
287
|
+
content = pkg_file.read_text(encoding="utf-8")
|
|
288
|
+
assert f"Maintainer-email: {expected_maintainers_meta_value}" in content
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
@pytest.mark.parametrize(
|
|
292
|
+
(
|
|
293
|
+
'pyproject_text',
|
|
294
|
+
'license',
|
|
295
|
+
'license_expression',
|
|
296
|
+
'content_str',
|
|
297
|
+
'not_content_str',
|
|
298
|
+
),
|
|
299
|
+
(
|
|
300
|
+
pytest.param(
|
|
301
|
+
PEP639_LICENSE_TEXT,
|
|
302
|
+
'MIT',
|
|
303
|
+
None,
|
|
304
|
+
'License: MIT',
|
|
305
|
+
'License-Expression: ',
|
|
306
|
+
id='license-text',
|
|
307
|
+
marks=[
|
|
308
|
+
pytest.mark.filterwarnings(
|
|
309
|
+
"ignore:.project.license. as a TOML table is deprecated",
|
|
310
|
+
)
|
|
311
|
+
],
|
|
312
|
+
),
|
|
313
|
+
pytest.param(
|
|
314
|
+
PEP639_LICENSE_EXPRESSION,
|
|
315
|
+
None,
|
|
316
|
+
'MIT OR Apache-2.0',
|
|
317
|
+
'License-Expression: MIT OR Apache-2.0',
|
|
318
|
+
'License: ',
|
|
319
|
+
id='license-expression',
|
|
320
|
+
),
|
|
321
|
+
),
|
|
322
|
+
)
|
|
323
|
+
def test_license_in_metadata(
|
|
324
|
+
license,
|
|
325
|
+
license_expression,
|
|
326
|
+
content_str,
|
|
327
|
+
not_content_str,
|
|
328
|
+
pyproject_text,
|
|
329
|
+
tmp_path,
|
|
330
|
+
):
|
|
331
|
+
pyproject = _pep621_example_project(
|
|
332
|
+
tmp_path,
|
|
333
|
+
"README",
|
|
334
|
+
pyproject_text=pyproject_text,
|
|
335
|
+
)
|
|
336
|
+
dist = pyprojecttoml.apply_configuration(makedist(tmp_path), pyproject)
|
|
337
|
+
assert dist.metadata.license == license
|
|
338
|
+
assert dist.metadata.license_expression == license_expression
|
|
339
|
+
pkg_file = tmp_path / "PKG-FILE"
|
|
340
|
+
with open(pkg_file, "w", encoding="utf-8") as fh:
|
|
341
|
+
dist.metadata.write_pkg_file(fh)
|
|
342
|
+
content = pkg_file.read_text(encoding="utf-8")
|
|
343
|
+
assert "Metadata-Version: 2.4" in content
|
|
344
|
+
assert content_str in content
|
|
345
|
+
assert not_content_str not in content
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
def test_license_classifier_with_license_expression(tmp_path):
|
|
349
|
+
text = PEP639_LICENSE_EXPRESSION.rsplit("\n", 2)[0]
|
|
350
|
+
pyproject = _pep621_example_project(
|
|
351
|
+
tmp_path,
|
|
352
|
+
"README",
|
|
353
|
+
f"{text}\n \"License :: OSI Approved :: MIT License\"\n]",
|
|
354
|
+
)
|
|
355
|
+
msg = "License classifiers have been superseded by license expressions"
|
|
356
|
+
with pytest.raises(InvalidConfigError, match=msg) as exc:
|
|
357
|
+
pyprojecttoml.apply_configuration(makedist(tmp_path), pyproject)
|
|
358
|
+
|
|
359
|
+
assert "License :: OSI Approved :: MIT License" in str(exc.value)
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
def test_license_classifier_without_license_expression(tmp_path):
|
|
363
|
+
text = """\
|
|
364
|
+
[project]
|
|
365
|
+
name = "spam"
|
|
366
|
+
version = "2020.0.0"
|
|
367
|
+
license = {text = "mit or apache-2.0"}
|
|
368
|
+
classifiers = ["License :: OSI Approved :: MIT License"]
|
|
369
|
+
"""
|
|
370
|
+
pyproject = _pep621_example_project(tmp_path, "README", text)
|
|
371
|
+
|
|
372
|
+
msg1 = "License classifiers are deprecated(?:.|\n)*MIT License"
|
|
373
|
+
msg2 = ".project.license. as a TOML table is deprecated"
|
|
374
|
+
with (
|
|
375
|
+
pytest.warns(SetuptoolsDeprecationWarning, match=msg1),
|
|
376
|
+
pytest.warns(SetuptoolsDeprecationWarning, match=msg2),
|
|
377
|
+
):
|
|
378
|
+
dist = pyprojecttoml.apply_configuration(makedist(tmp_path), pyproject)
|
|
379
|
+
|
|
380
|
+
# Check license classifier is still included
|
|
381
|
+
assert dist.metadata.get_classifiers() == ["License :: OSI Approved :: MIT License"]
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
class TestLicenseFiles:
|
|
385
|
+
def base_pyproject(
|
|
386
|
+
self,
|
|
387
|
+
tmp_path,
|
|
388
|
+
additional_text="",
|
|
389
|
+
license_toml='license = {file = "LICENSE.txt"}\n',
|
|
390
|
+
):
|
|
391
|
+
text = PEP639_LICENSE_EXPRESSION
|
|
392
|
+
|
|
393
|
+
# Sanity-check
|
|
394
|
+
assert 'license = "mit or apache-2.0"' in text
|
|
395
|
+
assert 'license-files' not in text
|
|
396
|
+
assert "[tool.setuptools]" not in text
|
|
397
|
+
|
|
398
|
+
text = re.sub(
|
|
399
|
+
r"(license = .*)\n",
|
|
400
|
+
license_toml,
|
|
401
|
+
text,
|
|
402
|
+
count=1,
|
|
403
|
+
)
|
|
404
|
+
assert license_toml in text # sanity check
|
|
405
|
+
text = f"{text}\n{additional_text}\n"
|
|
406
|
+
pyproject = _pep621_example_project(tmp_path, "README", pyproject_text=text)
|
|
407
|
+
return pyproject
|
|
408
|
+
|
|
409
|
+
def base_pyproject_license_pep639(self, tmp_path, additional_text=""):
|
|
410
|
+
return self.base_pyproject(
|
|
411
|
+
tmp_path,
|
|
412
|
+
additional_text=additional_text,
|
|
413
|
+
license_toml='license = "licenseref-Proprietary"'
|
|
414
|
+
'\nlicense-files = ["_FILE*"]\n',
|
|
415
|
+
)
|
|
416
|
+
|
|
417
|
+
def test_both_license_and_license_files_defined(self, tmp_path):
|
|
418
|
+
setuptools_config = '[tool.setuptools]\nlicense-files = ["_FILE*"]'
|
|
419
|
+
pyproject = self.base_pyproject(tmp_path, setuptools_config)
|
|
420
|
+
|
|
421
|
+
(tmp_path / "_FILE.txt").touch()
|
|
422
|
+
(tmp_path / "_FILE.rst").touch()
|
|
423
|
+
|
|
424
|
+
# Would normally match the `license_files` patterns, but we want to exclude it
|
|
425
|
+
# by being explicit. On the other hand, contents should be added to `license`
|
|
426
|
+
license = tmp_path / "LICENSE.txt"
|
|
427
|
+
license.write_text("LicenseRef-Proprietary\n", encoding="utf-8")
|
|
428
|
+
|
|
429
|
+
msg1 = "'tool.setuptools.license-files' is deprecated in favor of 'project.license-files'"
|
|
430
|
+
msg2 = ".project.license. as a TOML table is deprecated"
|
|
431
|
+
with (
|
|
432
|
+
pytest.warns(SetuptoolsDeprecationWarning, match=msg1),
|
|
433
|
+
pytest.warns(SetuptoolsDeprecationWarning, match=msg2),
|
|
434
|
+
):
|
|
435
|
+
dist = pyprojecttoml.apply_configuration(makedist(tmp_path), pyproject)
|
|
436
|
+
assert set(dist.metadata.license_files) == {"_FILE.rst", "_FILE.txt"}
|
|
437
|
+
assert dist.metadata.license == "LicenseRef-Proprietary\n"
|
|
438
|
+
|
|
439
|
+
def test_both_license_and_license_files_defined_pep639(self, tmp_path):
|
|
440
|
+
# Set license and license-files
|
|
441
|
+
pyproject = self.base_pyproject_license_pep639(tmp_path)
|
|
442
|
+
|
|
443
|
+
(tmp_path / "_FILE.txt").touch()
|
|
444
|
+
(tmp_path / "_FILE.rst").touch()
|
|
445
|
+
|
|
446
|
+
msg = "Normalizing.*LicenseRef"
|
|
447
|
+
with pytest.warns(InformationOnly, match=msg):
|
|
448
|
+
dist = pyprojecttoml.apply_configuration(makedist(tmp_path), pyproject)
|
|
449
|
+
|
|
450
|
+
assert set(dist.metadata.license_files) == {"_FILE.rst", "_FILE.txt"}
|
|
451
|
+
assert dist.metadata.license is None
|
|
452
|
+
assert dist.metadata.license_expression == "LicenseRef-Proprietary"
|
|
453
|
+
|
|
454
|
+
def test_license_files_defined_twice(self, tmp_path):
|
|
455
|
+
# Set project.license-files and tools.setuptools.license-files
|
|
456
|
+
setuptools_config = '[tool.setuptools]\nlicense-files = ["_FILE*"]'
|
|
457
|
+
pyproject = self.base_pyproject_license_pep639(tmp_path, setuptools_config)
|
|
458
|
+
|
|
459
|
+
msg = "'project.license-files' is defined already. Remove 'tool.setuptools.license-files'"
|
|
460
|
+
with pytest.raises(InvalidConfigError, match=msg):
|
|
461
|
+
pyprojecttoml.apply_configuration(makedist(tmp_path), pyproject)
|
|
462
|
+
|
|
463
|
+
def test_default_patterns(self, tmp_path):
|
|
464
|
+
setuptools_config = '[tool.setuptools]\nzip-safe = false'
|
|
465
|
+
# ^ used just to trigger section validation
|
|
466
|
+
pyproject = self.base_pyproject(tmp_path, setuptools_config, license_toml="")
|
|
467
|
+
|
|
468
|
+
license_files = "LICENCE-a.html COPYING-abc.txt AUTHORS-xyz NOTICE,def".split()
|
|
469
|
+
|
|
470
|
+
for fname in license_files:
|
|
471
|
+
(tmp_path / fname).write_text(f"{fname}\n", encoding="utf-8")
|
|
472
|
+
|
|
473
|
+
dist = pyprojecttoml.apply_configuration(makedist(tmp_path), pyproject)
|
|
474
|
+
|
|
475
|
+
assert (tmp_path / "LICENSE.txt").exists() # from base example
|
|
476
|
+
assert set(dist.metadata.license_files) == {*license_files, "LICENSE.txt"}
|
|
477
|
+
|
|
478
|
+
def test_missing_patterns(self, tmp_path):
|
|
479
|
+
pyproject = self.base_pyproject_license_pep639(tmp_path)
|
|
480
|
+
assert list(tmp_path.glob("_FILE*")) == [] # sanity check
|
|
481
|
+
|
|
482
|
+
msg1 = "Cannot find any files for the given pattern.*"
|
|
483
|
+
msg2 = "Normalizing 'licenseref-Proprietary' to 'LicenseRef-Proprietary'"
|
|
484
|
+
with (
|
|
485
|
+
pytest.warns(SetuptoolsDeprecationWarning, match=msg1),
|
|
486
|
+
pytest.warns(InformationOnly, match=msg2),
|
|
487
|
+
):
|
|
488
|
+
pyprojecttoml.apply_configuration(makedist(tmp_path), pyproject)
|
|
489
|
+
|
|
490
|
+
def test_deprecated_file_expands_to_text(self, tmp_path):
|
|
491
|
+
"""Make sure the old example with ``license = {text = ...}`` works"""
|
|
492
|
+
|
|
493
|
+
assert 'license-files = ["LICENSE.txt"]' in PEP621_EXAMPLE # sanity check
|
|
494
|
+
text = PEP621_EXAMPLE.replace(
|
|
495
|
+
'license-files = ["LICENSE.txt"]',
|
|
496
|
+
'license = {file = "LICENSE.txt"}',
|
|
497
|
+
)
|
|
498
|
+
pyproject = _pep621_example_project(tmp_path, pyproject_text=text)
|
|
499
|
+
|
|
500
|
+
msg = ".project.license. as a TOML table is deprecated"
|
|
501
|
+
with pytest.warns(SetuptoolsDeprecationWarning, match=msg):
|
|
502
|
+
dist = pyprojecttoml.apply_configuration(makedist(tmp_path), pyproject)
|
|
503
|
+
|
|
504
|
+
assert dist.metadata.license == "--- LICENSE stub ---"
|
|
505
|
+
assert set(dist.metadata.license_files) == {"LICENSE.txt"} # auto-filled
|
|
506
|
+
|
|
507
|
+
|
|
508
|
+
class TestPyModules:
|
|
509
|
+
# https://github.com/pypa/setuptools/issues/4316
|
|
510
|
+
|
|
511
|
+
def dist(self, name):
|
|
512
|
+
toml_config = f"""
|
|
513
|
+
[project]
|
|
514
|
+
name = "test"
|
|
515
|
+
version = "42.0"
|
|
516
|
+
[tool.setuptools]
|
|
517
|
+
py-modules = [{name!r}]
|
|
518
|
+
"""
|
|
519
|
+
pyproject = Path("pyproject.toml")
|
|
520
|
+
pyproject.write_text(cleandoc(toml_config), encoding="utf-8")
|
|
521
|
+
return pyprojecttoml.apply_configuration(Distribution({}), pyproject)
|
|
522
|
+
|
|
523
|
+
@pytest.mark.parametrize("module", ["pip-run", "abc-d.λ-xyz-e"])
|
|
524
|
+
def test_valid_module_name(self, tmp_path, monkeypatch, module):
|
|
525
|
+
monkeypatch.chdir(tmp_path)
|
|
526
|
+
assert module in self.dist(module).py_modules
|
|
527
|
+
|
|
528
|
+
@pytest.mark.parametrize("module", ["pip run", "-pip-run", "pip-run-stubs"])
|
|
529
|
+
def test_invalid_module_name(self, tmp_path, monkeypatch, module):
|
|
530
|
+
monkeypatch.chdir(tmp_path)
|
|
531
|
+
with pytest.raises(ValueError, match="py-modules"):
|
|
532
|
+
self.dist(module).py_modules
|
|
533
|
+
|
|
534
|
+
|
|
535
|
+
class TestExtModules:
|
|
536
|
+
def test_pyproject_sets_attribute(self, tmp_path, monkeypatch):
|
|
537
|
+
monkeypatch.chdir(tmp_path)
|
|
538
|
+
pyproject = Path("pyproject.toml")
|
|
539
|
+
toml_config = """
|
|
540
|
+
[project]
|
|
541
|
+
name = "test"
|
|
542
|
+
version = "42.0"
|
|
543
|
+
[tool.setuptools]
|
|
544
|
+
ext-modules = [
|
|
545
|
+
{name = "my.ext", sources = ["hello.c", "world.c"]}
|
|
546
|
+
]
|
|
547
|
+
"""
|
|
548
|
+
pyproject.write_text(cleandoc(toml_config), encoding="utf-8")
|
|
549
|
+
with pytest.warns(pyprojecttoml._ExperimentalConfiguration):
|
|
550
|
+
dist = pyprojecttoml.apply_configuration(Distribution({}), pyproject)
|
|
551
|
+
assert len(dist.ext_modules) == 1
|
|
552
|
+
assert dist.ext_modules[0].name == "my.ext"
|
|
553
|
+
assert set(dist.ext_modules[0].sources) == {"hello.c", "world.c"}
|
|
554
|
+
|
|
555
|
+
|
|
556
|
+
class TestDeprecatedFields:
|
|
557
|
+
def test_namespace_packages(self, tmp_path):
|
|
558
|
+
pyproject = tmp_path / "pyproject.toml"
|
|
559
|
+
config = """
|
|
560
|
+
[project]
|
|
561
|
+
name = "myproj"
|
|
562
|
+
version = "42"
|
|
563
|
+
[tool.setuptools]
|
|
564
|
+
namespace-packages = ["myproj.pkg"]
|
|
565
|
+
"""
|
|
566
|
+
pyproject.write_text(cleandoc(config), encoding="utf-8")
|
|
567
|
+
with pytest.raises(RemovedConfigError, match="namespace-packages"):
|
|
568
|
+
pyprojecttoml.apply_configuration(makedist(tmp_path), pyproject)
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
class TestPresetField:
|
|
572
|
+
def pyproject(self, tmp_path, dynamic, extra_content=""):
|
|
573
|
+
content = f"[project]\nname = 'proj'\ndynamic = {dynamic!r}\n"
|
|
574
|
+
if "version" not in dynamic:
|
|
575
|
+
content += "version = '42'\n"
|
|
576
|
+
file = tmp_path / "pyproject.toml"
|
|
577
|
+
file.write_text(content + extra_content, encoding="utf-8")
|
|
578
|
+
return file
|
|
579
|
+
|
|
580
|
+
@pytest.mark.parametrize(
|
|
581
|
+
("attr", "field", "value"),
|
|
582
|
+
[
|
|
583
|
+
("license_expression", "license", "MIT"),
|
|
584
|
+
pytest.param(
|
|
585
|
+
*("license", "license", "Not SPDX"),
|
|
586
|
+
marks=[pytest.mark.filterwarnings("ignore:.*license. overwritten")],
|
|
587
|
+
),
|
|
588
|
+
("classifiers", "classifiers", ["Private :: Classifier"]),
|
|
589
|
+
("entry_points", "scripts", {"console_scripts": ["foobar=foobar:main"]}),
|
|
590
|
+
("entry_points", "gui-scripts", {"gui_scripts": ["bazquux=bazquux:main"]}),
|
|
591
|
+
pytest.param(
|
|
592
|
+
*("install_requires", "dependencies", ["six"]),
|
|
593
|
+
marks=[
|
|
594
|
+
pytest.mark.filterwarnings("ignore:.*install_requires. overwritten")
|
|
595
|
+
],
|
|
596
|
+
),
|
|
597
|
+
],
|
|
598
|
+
)
|
|
599
|
+
def test_not_listed_in_dynamic(self, tmp_path, attr, field, value):
|
|
600
|
+
"""Setuptools cannot set a field if not listed in ``dynamic``"""
|
|
601
|
+
pyproject = self.pyproject(tmp_path, [])
|
|
602
|
+
dist = makedist(tmp_path, **{attr: value})
|
|
603
|
+
msg = re.compile(f"defined outside of `pyproject.toml`:.*{field}", re.S)
|
|
604
|
+
with pytest.warns(_MissingDynamic, match=msg):
|
|
605
|
+
dist = pyprojecttoml.apply_configuration(dist, pyproject)
|
|
606
|
+
|
|
607
|
+
dist_value = _some_attrgetter(f"metadata.{attr}", attr)(dist)
|
|
608
|
+
assert not dist_value
|
|
609
|
+
|
|
610
|
+
@pytest.mark.parametrize(
|
|
611
|
+
("attr", "field", "value"),
|
|
612
|
+
[
|
|
613
|
+
("license_expression", "license", "MIT"),
|
|
614
|
+
("install_requires", "dependencies", []),
|
|
615
|
+
("extras_require", "optional-dependencies", {}),
|
|
616
|
+
("install_requires", "dependencies", ["six"]),
|
|
617
|
+
("classifiers", "classifiers", ["Private :: Classifier"]),
|
|
618
|
+
],
|
|
619
|
+
)
|
|
620
|
+
def test_listed_in_dynamic(self, tmp_path, attr, field, value):
|
|
621
|
+
pyproject = self.pyproject(tmp_path, [field])
|
|
622
|
+
dist = makedist(tmp_path, **{attr: value})
|
|
623
|
+
dist = pyprojecttoml.apply_configuration(dist, pyproject)
|
|
624
|
+
dist_value = _some_attrgetter(f"metadata.{attr}", attr)(dist)
|
|
625
|
+
assert dist_value == value
|
|
626
|
+
|
|
627
|
+
def test_license_files_exempt_from_dynamic(self, monkeypatch, tmp_path):
|
|
628
|
+
"""
|
|
629
|
+
license-file is currently not considered in the context of dynamic.
|
|
630
|
+
As per 2025-02-19, https://packaging.python.org/en/latest/specifications/pyproject-toml/#license-files
|
|
631
|
+
allows setuptools to fill-in `license-files` the way it sees fit:
|
|
632
|
+
|
|
633
|
+
> If the license-files key is not defined, tools can decide how to handle license files.
|
|
634
|
+
> For example they can choose not to include any files or use their own
|
|
635
|
+
> logic to discover the appropriate files in the distribution.
|
|
636
|
+
|
|
637
|
+
Using license_files from setup.py to fill-in the value is in accordance
|
|
638
|
+
with this rule.
|
|
639
|
+
"""
|
|
640
|
+
monkeypatch.chdir(tmp_path)
|
|
641
|
+
pyproject = self.pyproject(tmp_path, [])
|
|
642
|
+
dist = makedist(tmp_path, license_files=["LIC*"])
|
|
643
|
+
(tmp_path / "LIC1").write_text("42", encoding="utf-8")
|
|
644
|
+
dist = pyprojecttoml.apply_configuration(dist, pyproject)
|
|
645
|
+
assert dist.metadata.license_files == ["LIC1"]
|
|
646
|
+
|
|
647
|
+
def test_warning_overwritten_dependencies(self, tmp_path):
|
|
648
|
+
src = "[project]\nname='pkg'\nversion='0.1'\ndependencies=['click']\n"
|
|
649
|
+
pyproject = tmp_path / "pyproject.toml"
|
|
650
|
+
pyproject.write_text(src, encoding="utf-8")
|
|
651
|
+
dist = makedist(tmp_path, install_requires=["wheel"])
|
|
652
|
+
with pytest.warns(match="`install_requires` overwritten"):
|
|
653
|
+
dist = pyprojecttoml.apply_configuration(dist, pyproject)
|
|
654
|
+
assert "wheel" not in dist.install_requires
|
|
655
|
+
|
|
656
|
+
def test_optional_dependencies_dont_remove_env_markers(self, tmp_path):
|
|
657
|
+
"""
|
|
658
|
+
Internally setuptools converts dependencies with markers to "extras".
|
|
659
|
+
If ``install_requires`` is given by ``setup.py``, we have to ensure that
|
|
660
|
+
applying ``optional-dependencies`` does not overwrite the mandatory
|
|
661
|
+
dependencies with markers (see #3204).
|
|
662
|
+
"""
|
|
663
|
+
# If setuptools replace its internal mechanism that uses `requires.txt`
|
|
664
|
+
# this test has to be rewritten to adapt accordingly
|
|
665
|
+
extra = "\n[project.optional-dependencies]\nfoo = ['bar>1']\n"
|
|
666
|
+
pyproject = self.pyproject(tmp_path, ["dependencies"], extra)
|
|
667
|
+
install_req = ['importlib-resources (>=3.0.0) ; python_version < "3.7"']
|
|
668
|
+
dist = makedist(tmp_path, install_requires=install_req)
|
|
669
|
+
dist = pyprojecttoml.apply_configuration(dist, pyproject)
|
|
670
|
+
assert "foo" in dist.extras_require
|
|
671
|
+
egg_info = dist.get_command_obj("egg_info")
|
|
672
|
+
write_requirements(egg_info, tmp_path, tmp_path / "requires.txt")
|
|
673
|
+
reqs = (tmp_path / "requires.txt").read_text(encoding="utf-8")
|
|
674
|
+
assert "importlib-resources" in reqs
|
|
675
|
+
assert "bar" in reqs
|
|
676
|
+
assert ':python_version < "3.7"' in reqs
|
|
677
|
+
|
|
678
|
+
@pytest.mark.parametrize(
|
|
679
|
+
("field", "group"),
|
|
680
|
+
[("scripts", "console_scripts"), ("gui-scripts", "gui_scripts")],
|
|
681
|
+
)
|
|
682
|
+
@pytest.mark.filterwarnings("error")
|
|
683
|
+
def test_scripts_dont_require_dynamic_entry_points(self, tmp_path, field, group):
|
|
684
|
+
# Issue 3862
|
|
685
|
+
pyproject = self.pyproject(tmp_path, [field])
|
|
686
|
+
dist = makedist(tmp_path, entry_points={group: ["foobar=foobar:main"]})
|
|
687
|
+
dist = pyprojecttoml.apply_configuration(dist, pyproject)
|
|
688
|
+
assert group in dist.entry_points
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
class TestMeta:
|
|
692
|
+
def test_example_file_in_sdist(self, setuptools_sdist):
|
|
693
|
+
"""Meta test to ensure tests can run from sdist"""
|
|
694
|
+
with tarfile.open(setuptools_sdist) as tar:
|
|
695
|
+
assert any(name.endswith(EXAMPLES_FILE) for name in tar.getnames())
|
|
696
|
+
|
|
697
|
+
|
|
698
|
+
class TestInteropCommandLineParsing:
|
|
699
|
+
def test_version(self, tmp_path, monkeypatch, capsys):
|
|
700
|
+
# See pypa/setuptools#4047
|
|
701
|
+
# This test can be removed once the CLI interface of setup.py is removed
|
|
702
|
+
monkeypatch.chdir(tmp_path)
|
|
703
|
+
toml_config = """
|
|
704
|
+
[project]
|
|
705
|
+
name = "test"
|
|
706
|
+
version = "42.0"
|
|
707
|
+
"""
|
|
708
|
+
pyproject = Path(tmp_path, "pyproject.toml")
|
|
709
|
+
pyproject.write_text(cleandoc(toml_config), encoding="utf-8")
|
|
710
|
+
opts = {"script_args": ["--version"]}
|
|
711
|
+
dist = pyprojecttoml.apply_configuration(Distribution(opts), pyproject)
|
|
712
|
+
dist.parse_command_line() # <-- there should be no exception here.
|
|
713
|
+
captured = capsys.readouterr()
|
|
714
|
+
assert "42.0" in captured.out
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
class TestStaticConfig:
|
|
718
|
+
def test_mark_static_fields(self, tmp_path, monkeypatch):
|
|
719
|
+
monkeypatch.chdir(tmp_path)
|
|
720
|
+
toml_config = """
|
|
721
|
+
[project]
|
|
722
|
+
name = "test"
|
|
723
|
+
version = "42.0"
|
|
724
|
+
dependencies = ["hello"]
|
|
725
|
+
keywords = ["world"]
|
|
726
|
+
classifiers = ["private :: hello world"]
|
|
727
|
+
[tool.setuptools]
|
|
728
|
+
obsoletes = ["abcd"]
|
|
729
|
+
provides = ["abcd"]
|
|
730
|
+
platforms = ["abcd"]
|
|
731
|
+
"""
|
|
732
|
+
pyproject = Path(tmp_path, "pyproject.toml")
|
|
733
|
+
pyproject.write_text(cleandoc(toml_config), encoding="utf-8")
|
|
734
|
+
dist = pyprojecttoml.apply_configuration(Distribution({}), pyproject)
|
|
735
|
+
assert is_static(dist.install_requires)
|
|
736
|
+
assert is_static(dist.metadata.keywords)
|
|
737
|
+
assert is_static(dist.metadata.classifiers)
|
|
738
|
+
assert is_static(dist.metadata.obsoletes)
|
|
739
|
+
assert is_static(dist.metadata.provides)
|
|
740
|
+
assert is_static(dist.metadata.platforms)
|
|
741
|
+
|
|
742
|
+
|
|
743
|
+
# --- Auxiliary Functions ---
|
|
744
|
+
|
|
745
|
+
|
|
746
|
+
def core_metadata(dist) -> str:
|
|
747
|
+
with io.StringIO() as buffer:
|
|
748
|
+
dist.metadata.write_pkg_file(buffer)
|
|
749
|
+
pkg_file_txt = buffer.getvalue()
|
|
750
|
+
|
|
751
|
+
# Make sure core metadata is valid
|
|
752
|
+
Metadata.from_email(pkg_file_txt, validate=True) # can raise exceptions
|
|
753
|
+
|
|
754
|
+
skip_prefixes: tuple[str, ...] = ()
|
|
755
|
+
skip_lines = set()
|
|
756
|
+
# ---- DIFF NORMALISATION ----
|
|
757
|
+
# PEP 621 is very particular about author/maintainer metadata conversion, so skip
|
|
758
|
+
skip_prefixes += ("Author:", "Author-email:", "Maintainer:", "Maintainer-email:")
|
|
759
|
+
# May be redundant with Home-page
|
|
760
|
+
skip_prefixes += ("Project-URL: Homepage,", "Home-page:")
|
|
761
|
+
# May be missing in original (relying on default) but backfilled in the TOML
|
|
762
|
+
skip_prefixes += ("Description-Content-Type:",)
|
|
763
|
+
# Remove empty lines
|
|
764
|
+
skip_lines.add("")
|
|
765
|
+
|
|
766
|
+
result = []
|
|
767
|
+
for line in pkg_file_txt.splitlines():
|
|
768
|
+
if line.startswith(skip_prefixes) or line in skip_lines:
|
|
769
|
+
continue
|
|
770
|
+
result.append(line + "\n")
|
|
771
|
+
|
|
772
|
+
return "".join(result)
|