├── .gitattributes ├── .github ├── FUNDING.yml └── workflows │ ├── build-cache-image.yml │ ├── ci.yml │ ├── doc-site.yml │ ├── gen-scie-platforms.yml │ ├── release.yml │ └── windows-test-report.yml ├── .gitignore ├── .test_timings ├── CHANGES.md ├── CONTRIBUTING.md ├── LICENSE ├── MANIFEST.in ├── README.rst ├── RELEASE.rst ├── assets ├── download.svg ├── github.svg ├── pdf.svg ├── pex-icon-512.png ├── pex-icon-512x512.png ├── pex-logo-dark.png ├── pex-logo-light.png ├── pex.svg └── python.svg ├── build-backend └── pex_build │ ├── __init__.py │ └── setuptools │ ├── __init__.py │ └── build.py ├── docker ├── base │ ├── Dockerfile │ └── install_pythons.sh ├── cache │ ├── Dockerfile │ └── populate_cache.sh └── user │ ├── Dockerfile │ └── create_docker_image_user.sh ├── docs ├── _ext │ └── sphinx_pex │ │ ├── __init__.py │ │ └── vars.py ├── _static │ ├── pex-icon.png │ ├── pex-logo-dark.png │ └── pex-logo-light.png ├── _templates │ ├── page.html │ └── search.html ├── api │ └── vars.md ├── buildingpex.rst ├── conf.py ├── index.rst ├── recipes.rst ├── scie.md └── whatispex.rst ├── duvrc.sh ├── mypy.ini ├── package ├── __init__.py ├── complete-platforms │ ├── linux-aarch64.json │ ├── linux-armv7l.json │ ├── linux-x86_64.json │ ├── macos-aarch64.json │ └── macos-x86_64.json ├── package.toml ├── pex-scie.lock └── scie_config.py ├── pex ├── __init__.py ├── __main__.py ├── argparse.py ├── artifact_url.py ├── atomic_directory.py ├── attrs.py ├── auth.py ├── bin │ ├── __init__.py │ └── pex.py ├── bootstrap.py ├── build_system │ ├── __init__.py │ ├── pep_517.py │ └── pep_518.py ├── cache │ ├── __init__.py │ ├── access.py │ ├── dirs.py │ ├── prunable.py │ └── root.py ├── cli │ ├── __init__.py │ ├── __main__.py │ ├── command.py │ ├── commands │ │ ├── __init__.py │ │ ├── cache │ │ │ ├── __init__.py │ │ │ ├── bytes.py │ │ │ ├── command.py │ │ │ └── du.py │ │ ├── docs.py │ │ ├── interpreter.py │ │ ├── lock.py │ │ └── venv.py │ └── pex.py ├── cli_util.py ├── commands │ ├── __init__.py │ └── command.py ├── common.py ├── compatibility.py ├── compiler.py ├── dependency_configuration.py ├── dependency_manager.py ├── dist_metadata.py ├── distutils │ ├── __init__.py │ └── commands │ │ ├── __init__.py │ │ └── bdist_pex.py ├── docs │ ├── __init__.py │ ├── command.py │ └── server.py ├── enum.py ├── environment.py ├── exceptions.py ├── executables.py ├── executor.py ├── fetcher.py ├── finders.py ├── fingerprinted_distribution.py ├── fs │ ├── __init__.py │ ├── _posix.py │ ├── _windows.py │ └── lock.py ├── globals.py ├── hashing.py ├── inherit_path.py ├── interpreter.py ├── interpreter_constraints.py ├── jobs.py ├── layout.py ├── network_configuration.py ├── orderedset.py ├── os.py ├── pep_376.py ├── pep_425.py ├── pep_427.py ├── pep_440.py ├── pep_503.py ├── pep_508.py ├── pep_723.py ├── pex.py ├── pex_boot.py ├── pex_bootstrapper.py ├── pex_builder.py ├── pex_info.py ├── pex_warnings.py ├── pip │ ├── __init__.py │ ├── dependencies │ │ ├── __init__.py │ │ └── requires.py │ ├── download_observer.py │ ├── foreign_platform │ │ ├── __init__.py │ │ ├── markers.py │ │ ├── requires_python.py │ │ └── tags.py │ ├── installation.py │ ├── local_project.py │ ├── log_analyzer.py │ ├── tailer.py │ ├── tool.py │ ├── vcs.py │ └── version.py ├── platforms.py ├── pth.py ├── pyenv.py ├── rank.py ├── repl │ ├── __init__.py │ ├── custom.py │ └── pex_repl.py ├── requirements.py ├── resolve │ ├── __init__.py │ ├── abbreviated_platforms.py │ ├── config.py │ ├── configured_resolve.py │ ├── configured_resolver.py │ ├── downloads.py │ ├── lock_downloader.py │ ├── lock_resolver.py │ ├── locked_resolve.py │ ├── locker.py │ ├── locker_patches.py │ ├── lockfile │ │ ├── __init__.py │ │ ├── create.py │ │ ├── download_manager.py │ │ ├── json_codec.py │ │ ├── model.py │ │ ├── pep_751.py │ │ ├── requires_dist.py │ │ ├── subset.py │ │ └── updater.py │ ├── path_mappings.py │ ├── pep_691 │ │ ├── __init__.py │ │ ├── api.py │ │ ├── fingerprint_service.py │ │ └── model.py │ ├── pex_repository_resolver.py │ ├── pre_resolved_resolver.py │ ├── project.py │ ├── requirement_configuration.py │ ├── requirement_options.py │ ├── resolved_requirement.py │ ├── resolver_configuration.py │ ├── resolver_options.py │ ├── resolvers.py │ ├── script_metadata.py │ ├── target_configuration.py │ └── target_options.py ├── resolver.py ├── result.py ├── scie │ ├── __init__.py │ ├── configure-binding.py │ ├── model.py │ └── science.py ├── sh_boot.py ├── sorted_tuple.py ├── specifier_sets.py ├── subprocess.py ├── sysconfig.py ├── targets.py ├── third_party │ └── __init__.py ├── toml.py ├── tools │ ├── __init__.py │ ├── __main__.py │ ├── command.py │ ├── commands │ │ ├── __init__.py │ │ ├── digraph.py │ │ ├── graph.py │ │ ├── info.py │ │ ├── interpreter.py │ │ ├── repository.py │ │ └── venv.py │ └── main.py ├── tracer.py ├── typing.py ├── util.py ├── variables.py ├── vendor │ ├── README.md │ ├── __init__.py │ ├── __main__.py │ └── _vendored │ │ ├── __init__.py │ │ ├── ansicolors │ │ ├── .layout.json │ │ ├── __init__.py │ │ ├── ansicolors-1.1.8.dist-info │ │ │ ├── DESCRIPTION.rst │ │ │ ├── INSTALLER │ │ │ ├── METADATA │ │ │ ├── WHEEL │ │ │ ├── metadata.json │ │ │ └── top_level.txt │ │ ├── colors │ │ │ ├── __init__.py │ │ │ ├── colors.py │ │ │ ├── csscolors.py │ │ │ └── version.py │ │ └── constraints.txt │ │ ├── appdirs │ │ ├── .layout.json │ │ ├── __init__.py │ │ ├── appdirs-1.4.4.dist-info │ │ │ ├── INSTALLER │ │ │ ├── LICENSE.txt │ │ │ ├── METADATA │ │ │ ├── WHEEL │ │ │ └── top_level.txt │ │ ├── appdirs.py │ │ └── constraints.txt │ │ ├── attrs │ │ ├── .layout.json │ │ ├── __init__.py │ │ ├── attr │ │ │ ├── __init__.py │ │ │ ├── __init__.pyi │ │ │ ├── _cmp.py │ │ │ ├── _cmp.pyi │ │ │ ├── _compat.py │ │ │ ├── _config.py │ │ │ ├── _funcs.py │ │ │ ├── _make.py │ │ │ ├── _next_gen.py │ │ │ ├── _version_info.py │ │ │ ├── _version_info.pyi │ │ │ ├── converters.py │ │ │ ├── converters.pyi │ │ │ ├── exceptions.py │ │ │ ├── exceptions.pyi │ │ │ ├── filters.py │ │ │ ├── filters.pyi │ │ │ ├── py.typed │ │ │ ├── setters.py │ │ │ ├── setters.pyi │ │ │ ├── validators.py │ │ │ └── validators.pyi │ │ ├── attrs-21.5.0.dev0.dist-info │ │ │ ├── AUTHORS.rst │ │ │ ├── INSTALLER │ │ │ ├── LICENSE │ │ │ ├── METADATA │ │ │ ├── WHEEL │ │ │ └── top_level.txt │ │ └── attrs │ │ │ ├── __init__.py │ │ │ ├── __init__.pyi │ │ │ ├── converters.py │ │ │ ├── exceptions.py │ │ │ ├── filters.py │ │ │ ├── py.typed │ │ │ ├── setters.py │ │ │ └── validators.py │ │ ├── packaging_20_9 │ │ ├── .layout.json │ │ ├── __init__.py │ │ ├── constraints.txt │ │ ├── packaging-20.9.dist-info │ │ │ ├── INSTALLER │ │ │ ├── LICENSE │ │ │ ├── LICENSE.APACHE │ │ │ ├── LICENSE.BSD │ │ │ ├── METADATA │ │ │ ├── WHEEL │ │ │ └── top_level.txt │ │ ├── packaging │ │ │ ├── __about__.py │ │ │ ├── __init__.py │ │ │ ├── _compat.py │ │ │ ├── _structures.py │ │ │ ├── _typing.py │ │ │ ├── markers.py │ │ │ ├── py.typed │ │ │ ├── requirements.py │ │ │ ├── specifiers.py │ │ │ ├── tags.py │ │ │ ├── utils.py │ │ │ └── version.py │ │ ├── pyparsing-2.4.7.dist-info │ │ │ ├── INSTALLER │ │ │ ├── LICENSE │ │ │ ├── METADATA │ │ │ ├── WHEEL │ │ │ └── top_level.txt │ │ └── pyparsing.py │ │ ├── packaging_21_3 │ │ ├── .layout.json │ │ ├── __init__.py │ │ ├── constraints.txt │ │ ├── packaging-21.3.dist-info │ │ │ ├── INSTALLER │ │ │ ├── LICENSE │ │ │ ├── LICENSE.APACHE │ │ │ ├── LICENSE.BSD │ │ │ ├── METADATA │ │ │ ├── WHEEL │ │ │ └── top_level.txt │ │ ├── packaging │ │ │ ├── __about__.py │ │ │ ├── __init__.py │ │ │ ├── _manylinux.py │ │ │ ├── _musllinux.py │ │ │ ├── _structures.py │ │ │ ├── markers.py │ │ │ ├── py.typed │ │ │ ├── requirements.py │ │ │ ├── specifiers.py │ │ │ ├── tags.py │ │ │ ├── utils.py │ │ │ └── version.py │ │ ├── pyparsing-3.0.7.dist-info │ │ │ ├── INSTALLER │ │ │ ├── LICENSE │ │ │ ├── METADATA │ │ │ ├── WHEEL │ │ │ └── top_level.txt │ │ └── pyparsing │ │ │ ├── __init__.py │ │ │ ├── actions.py │ │ │ ├── common.py │ │ │ ├── core.py │ │ │ ├── diagram │ │ │ ├── __init__.py │ │ │ └── template.jinja2 │ │ │ ├── exceptions.py │ │ │ ├── helpers.py │ │ │ ├── results.py │ │ │ ├── testing.py │ │ │ ├── unicode.py │ │ │ └── util.py │ │ ├── packaging_24_0 │ │ ├── .layout.json │ │ ├── __init__.py │ │ ├── constraints.txt │ │ ├── packaging-24.0.dist-info │ │ │ ├── INSTALLER │ │ │ ├── LICENSE │ │ │ ├── LICENSE.APACHE │ │ │ ├── LICENSE.BSD │ │ │ ├── METADATA │ │ │ └── WHEEL │ │ └── packaging │ │ │ ├── __init__.py │ │ │ ├── _elffile.py │ │ │ ├── _manylinux.py │ │ │ ├── _musllinux.py │ │ │ ├── _parser.py │ │ │ ├── _structures.py │ │ │ ├── _tokenizer.py │ │ │ ├── markers.py │ │ │ ├── metadata.py │ │ │ ├── py.typed │ │ │ ├── requirements.py │ │ │ ├── specifiers.py │ │ │ ├── tags.py │ │ │ ├── utils.py │ │ │ └── version.py │ │ ├── packaging_25_0 │ │ ├── .layout.json │ │ ├── __init__.py │ │ ├── constraints.txt │ │ ├── packaging-25.0.dist-info │ │ │ ├── INSTALLER │ │ │ ├── METADATA │ │ │ ├── WHEEL │ │ │ └── licenses │ │ │ │ ├── LICENSE │ │ │ │ ├── LICENSE.APACHE │ │ │ │ └── LICENSE.BSD │ │ └── packaging │ │ │ ├── __init__.py │ │ │ ├── _elffile.py │ │ │ ├── _manylinux.py │ │ │ ├── _musllinux.py │ │ │ ├── _parser.py │ │ │ ├── _structures.py │ │ │ ├── _tokenizer.py │ │ │ ├── licenses │ │ │ ├── __init__.py │ │ │ └── _spdx.py │ │ │ ├── markers.py │ │ │ ├── metadata.py │ │ │ ├── py.typed │ │ │ ├── requirements.py │ │ │ ├── specifiers.py │ │ │ ├── tags.py │ │ │ ├── utils.py │ │ │ └── version.py │ │ ├── pip │ │ ├── .layout.json │ │ ├── .prefix │ │ │ └── bin │ │ │ │ ├── pip │ │ │ │ ├── pip3 │ │ │ │ └── pip3.9 │ │ ├── __init__.py │ │ ├── pip-20.3.4.dist-info │ │ │ ├── INSTALLER │ │ │ ├── LICENSE.txt │ │ │ ├── METADATA │ │ │ ├── WHEEL │ │ │ ├── entry_points.txt │ │ │ └── top_level.txt │ │ └── pip │ │ │ ├── __init__.py │ │ │ ├── __main__.py │ │ │ ├── _internal │ │ │ ├── __init__.py │ │ │ ├── build_env.py │ │ │ ├── cache.py │ │ │ ├── cli │ │ │ │ ├── __init__.py │ │ │ │ ├── autocompletion.py │ │ │ │ ├── base_command.py │ │ │ │ ├── cmdoptions.py │ │ │ │ ├── command_context.py │ │ │ │ ├── main.py │ │ │ │ ├── main_parser.py │ │ │ │ ├── parser.py │ │ │ │ ├── progress_bars.py │ │ │ │ ├── req_command.py │ │ │ │ ├── spinners.py │ │ │ │ └── status_codes.py │ │ │ ├── commands │ │ │ │ ├── __init__.py │ │ │ │ ├── cache.py │ │ │ │ ├── check.py │ │ │ │ ├── completion.py │ │ │ │ ├── configuration.py │ │ │ │ ├── debug.py │ │ │ │ ├── download.py │ │ │ │ ├── freeze.py │ │ │ │ ├── hash.py │ │ │ │ ├── help.py │ │ │ │ ├── install.py │ │ │ │ ├── list.py │ │ │ │ ├── search.py │ │ │ │ ├── show.py │ │ │ │ ├── uninstall.py │ │ │ │ └── wheel.py │ │ │ ├── configuration.py │ │ │ ├── distributions │ │ │ │ ├── __init__.py │ │ │ │ ├── base.py │ │ │ │ ├── installed.py │ │ │ │ ├── sdist.py │ │ │ │ └── wheel.py │ │ │ ├── exceptions.py │ │ │ ├── index │ │ │ │ ├── __init__.py │ │ │ │ ├── collector.py │ │ │ │ └── package_finder.py │ │ │ ├── locations.py │ │ │ ├── main.py │ │ │ ├── models │ │ │ │ ├── __init__.py │ │ │ │ ├── candidate.py │ │ │ │ ├── direct_url.py │ │ │ │ ├── format_control.py │ │ │ │ ├── index.py │ │ │ │ ├── link.py │ │ │ │ ├── scheme.py │ │ │ │ ├── search_scope.py │ │ │ │ ├── selection_prefs.py │ │ │ │ ├── target_python.py │ │ │ │ └── wheel.py │ │ │ ├── network │ │ │ │ ├── __init__.py │ │ │ │ ├── auth.py │ │ │ │ ├── cache.py │ │ │ │ ├── download.py │ │ │ │ ├── lazy_wheel.py │ │ │ │ ├── session.py │ │ │ │ ├── utils.py │ │ │ │ └── xmlrpc.py │ │ │ ├── operations │ │ │ │ ├── __init__.py │ │ │ │ ├── build │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── metadata.py │ │ │ │ │ ├── metadata_legacy.py │ │ │ │ │ ├── wheel.py │ │ │ │ │ └── wheel_legacy.py │ │ │ │ ├── check.py │ │ │ │ ├── freeze.py │ │ │ │ ├── install │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── editable_legacy.py │ │ │ │ │ ├── legacy.py │ │ │ │ │ └── wheel.py │ │ │ │ └── prepare.py │ │ │ ├── pyproject.py │ │ │ ├── req │ │ │ │ ├── __init__.py │ │ │ │ ├── constructors.py │ │ │ │ ├── req_file.py │ │ │ │ ├── req_install.py │ │ │ │ ├── req_set.py │ │ │ │ ├── req_tracker.py │ │ │ │ └── req_uninstall.py │ │ │ ├── resolution │ │ │ │ ├── __init__.py │ │ │ │ ├── base.py │ │ │ │ ├── legacy │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── resolver.py │ │ │ │ └── resolvelib │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── base.py │ │ │ │ │ ├── candidates.py │ │ │ │ │ ├── factory.py │ │ │ │ │ ├── found_candidates.py │ │ │ │ │ ├── provider.py │ │ │ │ │ ├── reporter.py │ │ │ │ │ ├── requirements.py │ │ │ │ │ └── resolver.py │ │ │ ├── self_outdated_check.py │ │ │ ├── utils │ │ │ │ ├── __init__.py │ │ │ │ ├── appdirs.py │ │ │ │ ├── compat.py │ │ │ │ ├── compatibility_tags.py │ │ │ │ ├── datetime.py │ │ │ │ ├── deprecation.py │ │ │ │ ├── direct_url_helpers.py │ │ │ │ ├── distutils_args.py │ │ │ │ ├── encoding.py │ │ │ │ ├── entrypoints.py │ │ │ │ ├── filesystem.py │ │ │ │ ├── filetypes.py │ │ │ │ ├── glibc.py │ │ │ │ ├── hashes.py │ │ │ │ ├── inject_securetransport.py │ │ │ │ ├── logging.py │ │ │ │ ├── misc.py │ │ │ │ ├── models.py │ │ │ │ ├── packaging.py │ │ │ │ ├── parallel.py │ │ │ │ ├── pkg_resources.py │ │ │ │ ├── setuptools_build.py │ │ │ │ ├── subprocess.py │ │ │ │ ├── temp_dir.py │ │ │ │ ├── typing.py │ │ │ │ ├── unpacking.py │ │ │ │ ├── urls.py │ │ │ │ ├── virtualenv.py │ │ │ │ └── wheel.py │ │ │ ├── vcs │ │ │ │ ├── __init__.py │ │ │ │ ├── bazaar.py │ │ │ │ ├── git.py │ │ │ │ ├── mercurial.py │ │ │ │ ├── subversion.py │ │ │ │ └── versioncontrol.py │ │ │ └── wheel_builder.py │ │ │ └── _vendor │ │ │ ├── __init__.py │ │ │ ├── appdirs.py │ │ │ ├── cachecontrol │ │ │ ├── __init__.py │ │ │ ├── _cmd.py │ │ │ ├── adapter.py │ │ │ ├── cache.py │ │ │ ├── caches │ │ │ │ ├── __init__.py │ │ │ │ ├── file_cache.py │ │ │ │ └── redis_cache.py │ │ │ ├── compat.py │ │ │ ├── controller.py │ │ │ ├── filewrapper.py │ │ │ ├── heuristics.py │ │ │ ├── serialize.py │ │ │ └── wrapper.py │ │ │ ├── certifi │ │ │ ├── __init__.py │ │ │ ├── __main__.py │ │ │ ├── cacert.pem │ │ │ └── core.py │ │ │ ├── chardet │ │ │ ├── __init__.py │ │ │ ├── big5freq.py │ │ │ ├── big5prober.py │ │ │ ├── chardistribution.py │ │ │ ├── charsetgroupprober.py │ │ │ ├── charsetprober.py │ │ │ ├── cli │ │ │ │ ├── __init__.py │ │ │ │ └── chardetect.py │ │ │ ├── codingstatemachine.py │ │ │ ├── compat.py │ │ │ ├── cp949prober.py │ │ │ ├── enums.py │ │ │ ├── escprober.py │ │ │ ├── escsm.py │ │ │ ├── eucjpprober.py │ │ │ ├── euckrfreq.py │ │ │ ├── euckrprober.py │ │ │ ├── euctwfreq.py │ │ │ ├── euctwprober.py │ │ │ ├── gb2312freq.py │ │ │ ├── gb2312prober.py │ │ │ ├── hebrewprober.py │ │ │ ├── jisfreq.py │ │ │ ├── jpcntx.py │ │ │ ├── langbulgarianmodel.py │ │ │ ├── langcyrillicmodel.py │ │ │ ├── langgreekmodel.py │ │ │ ├── langhebrewmodel.py │ │ │ ├── langhungarianmodel.py │ │ │ ├── langthaimodel.py │ │ │ ├── langturkishmodel.py │ │ │ ├── latin1prober.py │ │ │ ├── mbcharsetprober.py │ │ │ ├── mbcsgroupprober.py │ │ │ ├── mbcssm.py │ │ │ ├── sbcharsetprober.py │ │ │ ├── sbcsgroupprober.py │ │ │ ├── sjisprober.py │ │ │ ├── universaldetector.py │ │ │ ├── utf8prober.py │ │ │ └── version.py │ │ │ ├── colorama │ │ │ ├── __init__.py │ │ │ ├── ansi.py │ │ │ ├── ansitowin32.py │ │ │ ├── initialise.py │ │ │ ├── win32.py │ │ │ └── winterm.py │ │ │ ├── contextlib2.py │ │ │ ├── distlib │ │ │ ├── __init__.py │ │ │ ├── _backport │ │ │ │ ├── __init__.py │ │ │ │ ├── misc.py │ │ │ │ ├── shutil.py │ │ │ │ ├── sysconfig.cfg │ │ │ │ ├── sysconfig.py │ │ │ │ └── tarfile.py │ │ │ ├── compat.py │ │ │ ├── database.py │ │ │ ├── index.py │ │ │ ├── locators.py │ │ │ ├── manifest.py │ │ │ ├── markers.py │ │ │ ├── metadata.py │ │ │ ├── resources.py │ │ │ ├── scripts.py │ │ │ ├── t32.exe │ │ │ ├── t64.exe │ │ │ ├── util.py │ │ │ ├── version.py │ │ │ ├── w32.exe │ │ │ ├── w64.exe │ │ │ └── wheel.py │ │ │ ├── distro.py │ │ │ ├── html5lib │ │ │ ├── __init__.py │ │ │ ├── _ihatexml.py │ │ │ ├── _inputstream.py │ │ │ ├── _tokenizer.py │ │ │ ├── _trie │ │ │ │ ├── __init__.py │ │ │ │ ├── _base.py │ │ │ │ └── py.py │ │ │ ├── _utils.py │ │ │ ├── constants.py │ │ │ ├── filters │ │ │ │ ├── __init__.py │ │ │ │ ├── alphabeticalattributes.py │ │ │ │ ├── base.py │ │ │ │ ├── inject_meta_charset.py │ │ │ │ ├── lint.py │ │ │ │ ├── optionaltags.py │ │ │ │ ├── sanitizer.py │ │ │ │ └── whitespace.py │ │ │ ├── html5parser.py │ │ │ ├── serializer.py │ │ │ ├── treeadapters │ │ │ │ ├── __init__.py │ │ │ │ ├── genshi.py │ │ │ │ └── sax.py │ │ │ ├── treebuilders │ │ │ │ ├── __init__.py │ │ │ │ ├── base.py │ │ │ │ ├── dom.py │ │ │ │ ├── etree.py │ │ │ │ └── etree_lxml.py │ │ │ └── treewalkers │ │ │ │ ├── __init__.py │ │ │ │ ├── base.py │ │ │ │ ├── dom.py │ │ │ │ ├── etree.py │ │ │ │ ├── etree_lxml.py │ │ │ │ └── genshi.py │ │ │ ├── idna │ │ │ ├── __init__.py │ │ │ ├── codec.py │ │ │ ├── compat.py │ │ │ ├── core.py │ │ │ ├── idnadata.py │ │ │ ├── intranges.py │ │ │ ├── package_data.py │ │ │ └── uts46data.py │ │ │ ├── ipaddress.py │ │ │ ├── msgpack │ │ │ ├── __init__.py │ │ │ ├── _version.py │ │ │ ├── exceptions.py │ │ │ ├── ext.py │ │ │ └── fallback.py │ │ │ ├── packaging │ │ │ ├── __about__.py │ │ │ ├── __init__.py │ │ │ ├── _compat.py │ │ │ ├── _structures.py │ │ │ ├── _typing.py │ │ │ ├── markers.py │ │ │ ├── requirements.py │ │ │ ├── specifiers.py │ │ │ ├── tags.py │ │ │ ├── utils.py │ │ │ └── version.py │ │ │ ├── pep517 │ │ │ ├── __init__.py │ │ │ ├── _in_process.py │ │ │ ├── build.py │ │ │ ├── check.py │ │ │ ├── colorlog.py │ │ │ ├── compat.py │ │ │ ├── dirtools.py │ │ │ ├── envbuild.py │ │ │ ├── meta.py │ │ │ └── wrappers.py │ │ │ ├── pkg_resources │ │ │ ├── __init__.py │ │ │ └── py31compat.py │ │ │ ├── progress │ │ │ ├── __init__.py │ │ │ ├── bar.py │ │ │ ├── counter.py │ │ │ └── spinner.py │ │ │ ├── pyparsing.py │ │ │ ├── requests │ │ │ ├── __init__.py │ │ │ ├── __version__.py │ │ │ ├── _internal_utils.py │ │ │ ├── adapters.py │ │ │ ├── api.py │ │ │ ├── auth.py │ │ │ ├── certs.py │ │ │ ├── compat.py │ │ │ ├── cookies.py │ │ │ ├── exceptions.py │ │ │ ├── help.py │ │ │ ├── hooks.py │ │ │ ├── models.py │ │ │ ├── packages.py │ │ │ ├── sessions.py │ │ │ ├── status_codes.py │ │ │ ├── structures.py │ │ │ └── utils.py │ │ │ ├── resolvelib │ │ │ ├── __init__.py │ │ │ ├── compat │ │ │ │ ├── __init__.py │ │ │ │ └── collections_abc.py │ │ │ ├── providers.py │ │ │ ├── reporters.py │ │ │ ├── resolvers.py │ │ │ └── structs.py │ │ │ ├── retrying.py │ │ │ ├── six.py │ │ │ ├── toml │ │ │ ├── __init__.py │ │ │ ├── decoder.py │ │ │ ├── encoder.py │ │ │ ├── ordered.py │ │ │ └── tz.py │ │ │ ├── urllib3 │ │ │ ├── __init__.py │ │ │ ├── _collections.py │ │ │ ├── _version.py │ │ │ ├── connection.py │ │ │ ├── connectionpool.py │ │ │ ├── contrib │ │ │ │ ├── __init__.py │ │ │ │ ├── _appengine_environ.py │ │ │ │ ├── _securetransport │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── bindings.py │ │ │ │ │ └── low_level.py │ │ │ │ ├── appengine.py │ │ │ │ ├── ntlmpool.py │ │ │ │ ├── pyopenssl.py │ │ │ │ ├── securetransport.py │ │ │ │ └── socks.py │ │ │ ├── exceptions.py │ │ │ ├── fields.py │ │ │ ├── filepost.py │ │ │ ├── packages │ │ │ │ ├── __init__.py │ │ │ │ ├── backports │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── makefile.py │ │ │ │ ├── six.py │ │ │ │ └── ssl_match_hostname │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── _implementation.py │ │ │ ├── poolmanager.py │ │ │ ├── request.py │ │ │ ├── response.py │ │ │ └── util │ │ │ │ ├── __init__.py │ │ │ │ ├── connection.py │ │ │ │ ├── proxy.py │ │ │ │ ├── queue.py │ │ │ │ ├── request.py │ │ │ │ ├── response.py │ │ │ │ ├── retry.py │ │ │ │ ├── ssl_.py │ │ │ │ ├── ssltransport.py │ │ │ │ ├── timeout.py │ │ │ │ ├── url.py │ │ │ │ └── wait.py │ │ │ ├── vendor.txt │ │ │ └── webencodings │ │ │ ├── __init__.py │ │ │ ├── labels.py │ │ │ ├── mklabels.py │ │ │ ├── tests.py │ │ │ └── x_user_defined.py │ │ ├── setuptools │ │ ├── .layout.json │ │ ├── .prefix │ │ │ └── bin │ │ │ │ ├── easy_install │ │ │ │ └── easy_install-3.9 │ │ ├── __init__.py │ │ ├── easy_install.py │ │ ├── pkg_resources │ │ │ ├── __init__.py │ │ │ ├── _vendor │ │ │ │ ├── __init__.py │ │ │ │ ├── appdirs.py │ │ │ │ ├── packaging │ │ │ │ │ ├── __about__.py │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── _compat.py │ │ │ │ │ ├── _structures.py │ │ │ │ │ ├── markers.py │ │ │ │ │ ├── requirements.py │ │ │ │ │ ├── specifiers.py │ │ │ │ │ ├── utils.py │ │ │ │ │ └── version.py │ │ │ │ ├── pyparsing.py │ │ │ │ └── six.py │ │ │ ├── extern │ │ │ │ └── __init__.py │ │ │ └── py31compat.py │ │ ├── setuptools-44.0.0+3acb925dd708430aeaf197ea53ac8a752f7c1863.dist-info │ │ │ ├── INSTALLER │ │ │ ├── LICENSE │ │ │ ├── METADATA │ │ │ ├── WHEEL │ │ │ ├── dependency_links.txt │ │ │ ├── entry_points.txt │ │ │ ├── top_level.txt │ │ │ └── zip-safe │ │ └── setuptools │ │ │ ├── __init__.py │ │ │ ├── _deprecation_warning.py │ │ │ ├── _imp.py │ │ │ ├── _vendor │ │ │ ├── __init__.py │ │ │ ├── ordered_set.py │ │ │ ├── packaging │ │ │ │ ├── __about__.py │ │ │ │ ├── __init__.py │ │ │ │ ├── _compat.py │ │ │ │ ├── _structures.py │ │ │ │ ├── markers.py │ │ │ │ ├── requirements.py │ │ │ │ ├── specifiers.py │ │ │ │ ├── tags.py │ │ │ │ ├── utils.py │ │ │ │ └── version.py │ │ │ ├── pyparsing.py │ │ │ └── six.py │ │ │ ├── archive_util.py │ │ │ ├── build_meta.py │ │ │ ├── cli-32.exe │ │ │ ├── cli-64.exe │ │ │ ├── cli.exe │ │ │ ├── command │ │ │ ├── __init__.py │ │ │ ├── alias.py │ │ │ ├── bdist_egg.py │ │ │ ├── bdist_rpm.py │ │ │ ├── bdist_wininst.py │ │ │ ├── build_clib.py │ │ │ ├── build_ext.py │ │ │ ├── build_py.py │ │ │ ├── develop.py │ │ │ ├── dist_info.py │ │ │ ├── easy_install.py │ │ │ ├── egg_info.py │ │ │ ├── install.py │ │ │ ├── install_egg_info.py │ │ │ ├── install_lib.py │ │ │ ├── install_scripts.py │ │ │ ├── launcher manifest.xml │ │ │ ├── py36compat.py │ │ │ ├── register.py │ │ │ ├── rotate.py │ │ │ ├── saveopts.py │ │ │ ├── sdist.py │ │ │ ├── setopt.py │ │ │ ├── test.py │ │ │ ├── upload.py │ │ │ └── upload_docs.py │ │ │ ├── config.py │ │ │ ├── dep_util.py │ │ │ ├── depends.py │ │ │ ├── dist.py │ │ │ ├── errors.py │ │ │ ├── extension.py │ │ │ ├── extern │ │ │ └── __init__.py │ │ │ ├── glob.py │ │ │ ├── gui-32.exe │ │ │ ├── gui-64.exe │ │ │ ├── gui.exe │ │ │ ├── installer.py │ │ │ ├── launch.py │ │ │ ├── lib2to3_ex.py │ │ │ ├── monkey.py │ │ │ ├── msvc.py │ │ │ ├── namespaces.py │ │ │ ├── package_index.py │ │ │ ├── py27compat.py │ │ │ ├── py31compat.py │ │ │ ├── py33compat.py │ │ │ ├── py34compat.py │ │ │ ├── sandbox.py │ │ │ ├── script (dev).tmpl │ │ │ ├── script.tmpl │ │ │ ├── site-patch.py │ │ │ ├── ssl_support.py │ │ │ ├── unicode_utils.py │ │ │ ├── version.py │ │ │ ├── wheel.py │ │ │ └── windows_support.py │ │ ├── toml │ │ ├── .layout.json │ │ ├── __init__.py │ │ ├── constraints.txt │ │ ├── toml-0.10.2.dist-info │ │ │ ├── INSTALLER │ │ │ ├── LICENSE │ │ │ ├── METADATA │ │ │ ├── WHEEL │ │ │ └── top_level.txt │ │ └── toml │ │ │ ├── __init__.py │ │ │ ├── decoder.py │ │ │ ├── encoder.py │ │ │ ├── ordered.py │ │ │ └── tz.py │ │ └── tomli │ │ ├── .layout.json │ │ ├── __init__.py │ │ ├── constraints.txt │ │ ├── tomli-2.0.1.dist-info │ │ ├── INSTALLER │ │ ├── LICENSE │ │ ├── METADATA │ │ └── WHEEL │ │ └── tomli │ │ ├── __init__.py │ │ ├── _parser.py │ │ ├── _re.py │ │ ├── _types.py │ │ └── py.typed ├── venv │ ├── README.md │ ├── __init__.py │ ├── bin_path.py │ ├── install_scope.py │ ├── installer.py │ ├── installer_configuration.py │ ├── installer_options.py │ ├── venv_pex.py │ ├── virtualenv.py │ └── virtualenv_16.7.12_py ├── version.py ├── wheel.py ├── windows │ └── __init__.py └── ziputils.py ├── pyproject.toml ├── pytest.ini ├── scripts ├── analyze-CI-shard-timeout.py ├── build-cache-image.py ├── build-docs.py ├── create-packages.py ├── dev-cmd-fix-egg-link.py ├── dev-cmd-pip-install-pex-next.py ├── embed-virtualenv.py ├── format.py ├── gen-scie-platform.py ├── lint.py ├── py27 │ └── lint_enum.py ├── requires-python-check.py └── typecheck.py ├── setup.cfg ├── setup.py ├── testing ├── __init__.py ├── bin │ └── run_tests.py ├── build_system.py ├── cli.py ├── data │ ├── __init__.py │ ├── locks │ │ ├── __init__.py │ │ ├── devpi-server.lock.json │ │ ├── issue-2415.lock.json │ │ ├── issue-2683.lock.json │ │ ├── mitmproxy.lock.json │ │ └── requests.lock.json │ ├── pip_logs │ │ ├── issue-2414.pip-23.2.log │ │ └── issue-2414.pip-23.3.1.log │ └── platforms │ │ ├── __init__.py │ │ ├── complete_platform_linux_armv7l_py312.json │ │ ├── complete_platform_linux_x86-64_py311.json │ │ └── macosx_10_13_x86_64-cp-36-m.tags.txt ├── devpi.py ├── dist_metadata.py ├── docker.py ├── find_links.py ├── lock.py ├── mitmproxy.py ├── pep_427.py ├── pex_dist.py ├── pip.py ├── pytest_utils │ ├── __init__.py │ ├── shard.py │ ├── tmp.py │ ├── track_status_hook.py │ ├── track_status_hook_py2.py │ └── track_status_hook_py3.py ├── pythonPI.py ├── resolve.py ├── scie.py ├── subprocess.py └── venv.py ├── tests ├── bin │ └── test_sh_boot.py ├── build_system │ ├── test_issue_2125.py │ ├── test_pep_517.py │ └── test_pep_518.py ├── commands │ └── test_command.py ├── conftest.py ├── example_packages │ ├── MarkupSafe-1.0-cp27-cp27mu-linux_x86_64.whl │ ├── PyAthena-1.11.5-py2.py3-none-any.whl │ ├── PyAthena-1.9.0-py2.py3-none-any.whl │ ├── aws_cfn_bootstrap-1.4-py2-none-any.whl │ └── pyparsing-2.1.10-py2.py3-none-any.whl ├── integration │ ├── __init__.py │ ├── build_system │ │ ├── __init__.py │ │ ├── test_issue_2063.py │ │ ├── test_issue_2125.py │ │ ├── test_pep_517.py │ │ └── test_pep_518.py │ ├── cli │ │ └── commands │ │ │ ├── test_cache_prune.py │ │ │ ├── test_discussion_2752.py │ │ │ ├── test_export.py │ │ │ ├── test_export_subset.lock.json │ │ │ ├── test_export_subset.py │ │ │ ├── test_interpreter_inspect.py │ │ │ ├── test_issue_1413.py │ │ │ ├── test_issue_1665.py │ │ │ ├── test_issue_1667.py │ │ │ ├── test_issue_1688.py │ │ │ ├── test_issue_1711.py │ │ │ ├── test_issue_1734.py │ │ │ ├── test_issue_1741.py │ │ │ ├── test_issue_1801.py │ │ │ ├── test_issue_1821.py │ │ │ ├── test_issue_2050.py │ │ │ ├── test_issue_2057.py │ │ │ ├── test_issue_2059.py │ │ │ ├── test_issue_2098.py │ │ │ ├── test_issue_2211.py │ │ │ ├── test_issue_2268.py │ │ │ ├── test_issue_2313.py │ │ │ ├── test_issue_2414.py │ │ │ ├── test_issue_2519.py │ │ │ ├── test_local_project_lock.py │ │ │ ├── test_lock.py │ │ │ ├── test_lock_dependency_groups.py │ │ │ ├── test_lock_elide_unused_requires_dist.py │ │ │ ├── test_lock_foreign_platform_sdist.py │ │ │ ├── test_lock_reproducibility_hash_seed.py │ │ │ ├── test_lock_requirements_file.py │ │ │ ├── test_lock_resolve_auth.py │ │ │ ├── test_lock_script_metadata.py │ │ │ ├── test_lock_subset.py │ │ │ ├── test_lock_sync.py │ │ │ ├── test_lock_update.py │ │ │ ├── test_lock_update_issues_2332_2334.py │ │ │ ├── test_pep_751.py │ │ │ ├── test_vcs_lock.py │ │ │ ├── test_venv_create.py │ │ │ └── test_venv_inspect.py │ ├── conftest.py │ ├── resolve │ │ ├── __init__.py │ │ ├── pep_691 │ │ │ ├── __init__.py │ │ │ └── test_api.py │ │ ├── test_dependency_groups.py │ │ ├── test_issue_1907.py │ │ ├── test_issue_1918.py │ │ ├── test_issue_2092.py │ │ ├── test_issue_2412.py │ │ ├── test_issue_2532.py │ │ ├── test_issue_2568.py │ │ └── test_issue_2772.py │ ├── scie │ │ ├── __init__.py │ │ ├── test_discussion_2516.py │ │ ├── test_issue_2733.py │ │ ├── test_issue_2740.py │ │ └── test_pex_scie.py │ ├── test_downloads.py │ ├── test_excludes.py │ ├── test_executuon_mode_venv.py │ ├── test_inject_env_and_args.py │ ├── test_inject_python_args.py │ ├── test_integration.py │ ├── test_interpreter.py │ ├── test_interpreter_selection.py │ ├── test_issue_1017.py │ ├── test_issue_1018.py │ ├── test_issue_1025.py │ ├── test_issue_1031.py │ ├── test_issue_1179.py │ ├── test_issue_1201.py │ ├── test_issue_1202.py │ ├── test_issue_1218.py │ ├── test_issue_1225.py │ ├── test_issue_1232.py │ ├── test_issue_1302.py │ ├── test_issue_1316.py │ ├── test_issue_1336.py │ ├── test_issue_1422.py │ ├── test_issue_1447.py │ ├── test_issue_1479.py │ ├── test_issue_1520.py │ ├── test_issue_1537.py │ ├── test_issue_1540.py │ ├── test_issue_1550.py │ ├── test_issue_1560.py │ ├── test_issue_157.py │ ├── test_issue_1597.py │ ├── test_issue_1598.py │ ├── test_issue_1656.py │ ├── test_issue_1683.py │ ├── test_issue_1726.py │ ├── test_issue_1730.py │ ├── test_issue_1802.py │ ├── test_issue_1809.py │ ├── test_issue_1817.py │ ├── test_issue_1825.py │ ├── test_issue_1856.py │ ├── test_issue_1861.py │ ├── test_issue_1870.py │ ├── test_issue_1872.py │ ├── test_issue_1879.py │ ├── test_issue_1933.py │ ├── test_issue_1936.py │ ├── test_issue_1949.py │ ├── test_issue_1995.py │ ├── test_issue_2001.py │ ├── test_issue_2006.py │ ├── test_issue_2017.py │ ├── test_issue_2023.py │ ├── test_issue_2038.py │ ├── test_issue_2073.py │ ├── test_issue_2087.py │ ├── test_issue_2088.py │ ├── test_issue_2113.py │ ├── test_issue_2134.py │ ├── test_issue_2183.py │ ├── test_issue_2186.py │ ├── test_issue_2203.py │ ├── test_issue_2235.py │ ├── test_issue_2249.py │ ├── test_issue_2324.py │ ├── test_issue_2343.py │ ├── test_issue_2348.py │ ├── test_issue_2355.py │ ├── test_issue_2389.py │ ├── test_issue_2391.py │ ├── test_issue_2395.py │ ├── test_issue_2410.py │ ├── test_issue_2412.py │ ├── test_issue_2413.py │ ├── test_issue_2415.py │ ├── test_issue_2432.py │ ├── test_issue_2441.py │ ├── test_issue_2572.py │ ├── test_issue_2706.py │ ├── test_issue_2739.py │ ├── test_issue_298.py │ ├── test_issue_434.py │ ├── test_issue_455.py │ ├── test_issue_539.py │ ├── test_issue_598.py │ ├── test_issue_661.py │ ├── test_issue_729.py │ ├── test_issue_736.py │ ├── test_issue_745.py │ ├── test_issue_749.py │ ├── test_issue_898.py │ ├── test_issue_899.py │ ├── test_issue_940.py │ ├── test_issue_996.py │ ├── test_keyring_support.py │ ├── test_layout.py │ ├── test_lock_resolver.py │ ├── test_locked_resolve.py │ ├── test_no_pre_install_wheels.py │ ├── test_overrides.py │ ├── test_pep_427.py │ ├── test_pex_bootstrapper.py │ ├── test_pex_entry_points.py │ ├── test_pex_import.py │ ├── test_reexec.py │ ├── test_reproducible.py │ ├── test_script_metadata.py │ ├── test_setproctitle.py │ ├── test_sh_boot.py │ ├── test_shebang_length_limit.py │ ├── test_variables.py │ ├── tools │ │ └── commands │ │ │ ├── test_issue_2105.py │ │ │ └── test_venv.py │ └── venv_ITs │ │ ├── __init__.py │ │ ├── conftest.py │ │ ├── test_install_wheel_multiple_site_packages_dirs.py │ │ ├── test_issue_1630.py │ │ ├── test_issue_1637.py │ │ ├── test_issue_1641.py │ │ ├── test_issue_1668.py │ │ ├── test_issue_1745.py │ │ ├── test_issue_1973.py │ │ ├── test_issue_2065.py │ │ ├── test_issue_2160.py │ │ ├── test_issue_2248.py │ │ └── test_virtualenv.py ├── pip │ ├── test_log_analyzer.py │ ├── test_tailer.py │ └── test_version.py ├── resolve │ ├── __init__.py │ ├── conftest.py │ ├── lockfile │ │ ├── __init__.py │ │ ├── test_download_manager.py │ │ ├── test_json_codec.py │ │ ├── test_lockfile.py │ │ ├── test_pep_751.py │ │ └── test_requires_dist.py │ ├── pep_691 │ │ ├── __init__.py │ │ ├── test_api.py │ │ ├── test_fingerprint_service.py │ │ └── test_model.py │ ├── test_dependency_groups.py │ ├── test_locked_resolve.py │ ├── test_locker.py │ ├── test_path_mappings.py │ ├── test_pex_repository_resolver.py │ ├── test_resolved_requirement.py │ ├── test_resolver_options.py │ ├── test_script_metadata.py │ └── test_target_options.py ├── test_artifact_url.py ├── test_atomic_directory.py ├── test_bdist_pex.py ├── test_common.py ├── test_compatibility.py ├── test_compiler.py ├── test_dependency_manager.py ├── test_dist_metadata.py ├── test_enum.py ├── test_environment.py ├── test_executables.py ├── test_execution_mode.py ├── test_executor.py ├── test_fetcher.py ├── test_finders.py ├── test_hashing.py ├── test_inherits_path_option.py ├── test_interpreter.py ├── test_interpreter_constraints.py ├── test_jobs.py ├── test_os.py ├── test_packaging.py ├── test_pep_376.py ├── test_pep_425.py ├── test_pep_508.py ├── test_pep_723.py ├── test_pex.py ├── test_pex_binary.py ├── test_pex_bootstrapper.py ├── test_pex_builder.py ├── test_pex_info.py ├── test_pex_warnings.py ├── test_pip.py ├── test_platform.py ├── test_pth.py ├── test_pyvenv_cfg.py ├── test_requirements.py ├── test_resolver.py ├── test_sorted_tuple.py ├── test_specifier_sets.py ├── test_targets.py ├── test_third_party.py ├── test_util.py ├── test_variables.py ├── test_vendor.py ├── test_windows.py ├── test_zip_utils.py └── tools │ ├── __init__.py │ └── commands │ ├── __init__.py │ ├── test_interpreter_command.py │ ├── test_repository.py │ └── test_venv.py └── uv.lock /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: jsirois 2 | 3 | -------------------------------------------------------------------------------- /.github/workflows/windows-test-report.yml: -------------------------------------------------------------------------------- 1 | name: Windows Test Report 2 | on: 3 | workflow_run: 4 | workflows: 5 | - CI 6 | types: 7 | - completed 8 | permissions: 9 | contents: read 10 | actions: read 11 | checks: write 12 | jobs: 13 | org-check: 14 | name: Check GitHub Organization 15 | if: github.repository_owner == 'pex-tool' 16 | runs-on: ubuntu-24.04 17 | steps: 18 | - name: Noop 19 | if: false 20 | run: | 21 | echo "This is a dummy step that will never run." 22 | report: 23 | runs-on: ubuntu-24.04 24 | needs: org-check 25 | steps: 26 | - uses: dorny/test-reporter@v1 27 | with: 28 | artifact: test-results 29 | name: Windows Test Results 30 | path: dist/test-results/*.xml 31 | reporter: java-junit 32 | fail-on-error: false 33 | fail-on-empty: false 34 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.pyo 3 | __pycache__/ 4 | 5 | *~ 6 | 7 | /.mypy_cache/ 8 | /dist/ 9 | /docs/_static_dynamic/ 10 | /pex/windows/stubs/ 11 | 12 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include CHANGES.md duvrc.sh mypy.ini uv.lock 2 | graft assets 3 | graft build-backend 4 | graft docker 5 | graft docs 6 | graft package 7 | graft scripts 8 | graft testing 9 | graft tests 10 | global-exclude *.pyc *.pyo 11 | -------------------------------------------------------------------------------- /assets/download.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /assets/pdf.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /assets/pex-icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/assets/pex-icon-512.png -------------------------------------------------------------------------------- /assets/pex-icon-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/assets/pex-icon-512x512.png -------------------------------------------------------------------------------- /assets/pex-logo-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/assets/pex-logo-dark.png -------------------------------------------------------------------------------- /assets/pex-logo-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/assets/pex-logo-light.png -------------------------------------------------------------------------------- /assets/python.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /build-backend/pex_build/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | import os 7 | 8 | # When running under MyPy, this will be set to True for us automatically; so we can use it as a 9 | # typing module import guard to protect Python 2 imports of typing - which is not normally available 10 | # in Python 2. 11 | TYPE_CHECKING = False 12 | 13 | 14 | INCLUDE_DOCS = os.environ.get("__PEX_BUILD_INCLUDE_DOCS__", "False").lower() in ("1", "true") 15 | -------------------------------------------------------------------------------- /build-backend/pex_build/setuptools/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | -------------------------------------------------------------------------------- /docker/base/Dockerfile: -------------------------------------------------------------------------------- 1 | # An image with the necessary binaries and libraries to develop pex. 2 | FROM ubuntu:24.04 3 | 4 | # We use pyenv to bootstrap interpreters and pyenv needs most of these packages. 5 | # See: https://github.com/pyenv/pyenv/wiki#suggested-build-environment 6 | # Additionally, some sdists need cargo to build native extensions and we need add-apt-repository 7 | # from software-properties-common to install the deadsnakes ppa and ssh for integration tests to 8 | # use. 9 | RUN apt update && \ 10 | DEBIAN_FRONTEND=noninteractive apt upgrade --yes && \ 11 | DEBIAN_FRONTEND=noninteractive apt install --yes --no-install-recommends \ 12 | build-essential \ 13 | cargo \ 14 | curl \ 15 | git \ 16 | libbz2-dev \ 17 | libffi-dev \ 18 | liblzma-dev \ 19 | libncursesw5-dev \ 20 | libreadline-dev \ 21 | libsqlite3-dev \ 22 | libssl-dev \ 23 | libxml2-dev \ 24 | libxmlsec1-dev \ 25 | software-properties-common \ 26 | ssh \ 27 | tk-dev \ 28 | xz-utils \ 29 | zlib1g-dev 30 | 31 | COPY install_pythons.sh /root/ 32 | RUN /root/install_pythons.sh 33 | 34 | # Setup a modern uv. 35 | RUN curl -LsSf https://astral.sh/uv/install.sh | UV_INSTALL_DIR=/usr/bin sh 36 | -------------------------------------------------------------------------------- /docker/cache/Dockerfile: -------------------------------------------------------------------------------- 1 | # A data image with the necessary binaries and libraries to develop pex. 2 | 3 | # Populate the ~/.pex_dev cache. 4 | FROM ghcr.io/pex-tool/pex/base:latest AS cache 5 | 6 | ARG FINGERPRINT=unset 7 | ARG PEX_REPO=https://github.com/pex-tool/pex 8 | ARG GIT_REF=HEAD 9 | 10 | # These must be set as a comma-separated list of all dev-cmd commands to cache. 11 | ARG TEST_CMDS 12 | 13 | RUN git clone "${PEX_REPO}" /development/pex && \ 14 | cd /development/pex && \ 15 | git reset --hard "${GIT_REF}" 16 | 17 | WORKDIR /development/pex 18 | COPY populate_cache.sh /root/ 19 | RUN /root/populate_cache.sh /development/pex_dev "${TEST_CMDS}" && \ 20 | touch "/development/pex_dev/.fingerprint-${FINGERPRINT}" 21 | 22 | # Grab just the ~/.pex_dev cache files for the final data-only image. 23 | FROM scratch 24 | VOLUME /development/pex_dev 25 | COPY --from=cache /development/pex_dev /development/pex_dev 26 | CMD ["I am a pure data image meant only for volume mounting."] 27 | -------------------------------------------------------------------------------- /docker/cache/populate_cache.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -xuo pipefail 4 | 5 | if (( $# != 2 )); then 6 | echo >&2 "usage: $0 [pex dev cache dir] [cmd][,cmd]*" 7 | echo >&2 "Expected 2 arguments, got $#: $*" 8 | exit 1 9 | fi 10 | 11 | function run_dev_cmd() { 12 | local cmd="$1" 13 | uv run dev-cmd "${cmd}" -- --color --devpi --require-devpi -vvs 14 | if (( $? == 42 )); then 15 | echo >&2 "uv run dev-cmd ${cmd} failed to start or connect to the devpi-server, exiting..." 16 | exit 1 17 | elif (( $? != 0 )); then 18 | echo >&2 "uv run dev-cmd ${cmd} failed, continuing..." 19 | fi 20 | } 21 | 22 | export _PEX_TEST_DEV_ROOT="$1" 23 | for cmd in $(echo "$2" | tr , ' '); do 24 | run_dev_cmd "${cmd}" 25 | 26 | # The pytest runs can leave quite large /tmp/pytest-of- trees; relieve disk pressure by 27 | # cleaning these up as we go. 28 | rm -rf /tmp/pytest* 29 | done 30 | 31 | echo "Cached ${_PEX_TEST_DEV_ROOT}:" 32 | du -sh "${_PEX_TEST_DEV_ROOT}"/* -------------------------------------------------------------------------------- /docker/user/create_docker_image_user.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -xeuo pipefail 4 | 5 | if (( $# != 4 )); then 6 | echo >&2 "Usage $0 " 7 | exit 1 8 | fi 9 | 10 | uid=$2 11 | gid=$4 12 | 13 | if id -un ubuntu; then 14 | userdel -r ubuntu 15 | fi 16 | 17 | if ! id -g ${gid} >/dev/null; then 18 | group=$3 19 | addgroup --gid=${gid} ${group} >&2 20 | fi 21 | 22 | if ! id -u ${uid} >/dev/null; then 23 | user=$1 24 | adduser --disabled-login --gecos "" --uid=${uid} --gid=${gid} --home=/home/${user} ${user} >&2 25 | fi 26 | -------------------------------------------------------------------------------- /docs/_static/pex-icon.png: -------------------------------------------------------------------------------- 1 | ../../assets/pex-icon-512.png -------------------------------------------------------------------------------- /docs/_static/pex-logo-dark.png: -------------------------------------------------------------------------------- 1 | ../../assets/pex-logo-dark.png -------------------------------------------------------------------------------- /docs/_static/pex-logo-light.png: -------------------------------------------------------------------------------- 1 | ../../assets/pex-logo-light.png -------------------------------------------------------------------------------- /docs/_templates/page.html: -------------------------------------------------------------------------------- 1 | {% extends "!page.html" %} 2 | 3 | {% block scripts -%} 4 | {{ super() }} 5 | 9 | {%- endblock scripts %} -------------------------------------------------------------------------------- /docs/api/vars.md: -------------------------------------------------------------------------------- 1 | (vars)= 2 | # PEX runtime environment variables 3 | 4 | ```{vars} 5 | ``` 6 | -------------------------------------------------------------------------------- /mypy.ini: -------------------------------------------------------------------------------- 1 | [mypy] 2 | # TODO: turn on. 3 | check_untyped_defs = False 4 | 5 | no_implicit_optional = True 6 | 7 | warn_unused_configs = True 8 | # TODO: enable `warn_unused_ignores` and `warn_reudandant_casts` once we drop Python 2. Otherwise, 9 | # we need it because some ignores depend on which interpreter we use. 10 | warn_redundant_casts = False 11 | warn_unused_ignores = False 12 | warn_no_return = True 13 | warn_return_any = True 14 | warn_unreachable = True 15 | 16 | implicit_reexport = False 17 | strict_equality = True 18 | 19 | show_error_context = True 20 | show_column_numbers = True 21 | show_error_codes = True 22 | pretty = True 23 | 24 | [mypy-pex.third_party.*] 25 | ignore_missing_imports = True 26 | 27 | [mypy-appdirs] 28 | ignore_missing_imports = True 29 | 30 | [mypy-coloredlogs] 31 | ignore_missing_imports = True 32 | 33 | [mypy-colors] 34 | ignore_missing_imports = True 35 | 36 | [mypy-ConfigParser] 37 | ignore_missing_imports = True 38 | 39 | [mypy-coverage] 40 | ignore_missing_imports = True 41 | 42 | [mypy-pip.*] 43 | follow_imports = skip 44 | 45 | # TODO: Once we can upgrade to Pytest 6, turn this off. 46 | [mypy-pytest] 47 | ignore_missing_imports = True 48 | 49 | [mypy-_pytest.*] 50 | follow_imports = skip 51 | 52 | [mypy-pkg_resources] 53 | ignore_missing_imports = True 54 | 55 | [mypy-setuptools.*] 56 | ignore_missing_imports = True 57 | -------------------------------------------------------------------------------- /package/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | -------------------------------------------------------------------------------- /package/package.toml: -------------------------------------------------------------------------------- 1 | [scie] 2 | pbs-release = "20250409" 3 | python-version = "3.13.3" 4 | 5 | pex-extras = [ 6 | "management", 7 | ] 8 | 9 | # This customization gets us a lockable psutil wheel for armv7l. 10 | extra-lock-args = ["--index", "https://www.piwheels.org/simple"] 11 | 12 | [scie.platforms.linux-aarch64] 13 | [scie.platforms.linux-armv7l] 14 | [scie.platforms.linux-x86_64] 15 | [scie.platforms.macos-aarch64] 16 | [scie.platforms.macos-x86_64] 17 | -------------------------------------------------------------------------------- /pex/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | -------------------------------------------------------------------------------- /pex/__main__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | from pex.bin import pex 7 | 8 | __name__ == "__main__" and pex.main() 9 | -------------------------------------------------------------------------------- /pex/argparse.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | from argparse import Action 7 | 8 | 9 | class HandleBoolAction(Action): 10 | """An action for bool options that parses `--no-foo` or `--not-foo` as `--foo=False`""" 11 | 12 | def __init__(self, *args, **kwargs): 13 | kwargs["nargs"] = 0 14 | super(HandleBoolAction, self).__init__(*args, **kwargs) 15 | 16 | def __call__(self, parser, namespace, value, option_str=None): 17 | setattr(namespace, self.dest, not option_str.startswith("--no")) 18 | -------------------------------------------------------------------------------- /pex/attrs.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | from pex.typing import TYPE_CHECKING 7 | 8 | if TYPE_CHECKING: 9 | from typing import Iterable, Optional, Tuple 10 | 11 | 12 | """Commonly needed attr.ib converters.""" 13 | 14 | 15 | def str_tuple_from_iterable(iterable=None): 16 | # type: (Optional[Iterable[str]]) -> Tuple[str, ...] 17 | return tuple(iterable) if iterable is not None else () 18 | -------------------------------------------------------------------------------- /pex/bin/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | -------------------------------------------------------------------------------- /pex/build_system/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | # The split of PEP-517 / PEP-518 is quite awkward. PEP-518 doesn't really work without also 7 | # specifying a build backend or knowing a default value for one, but the concept is not defined 8 | # until PEP-517. As such, we break this historical? strange division and define the default outside 9 | # both PEPs. 10 | # 11 | # See: https://peps.python.org/pep-0517/#source-trees 12 | DEFAULT_BUILD_BACKEND = "setuptools.build_meta:__legacy__" 13 | -------------------------------------------------------------------------------- /pex/cache/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | -------------------------------------------------------------------------------- /pex/cache/root.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | import os.path 7 | 8 | from pex.compatibility import safe_commonpath 9 | from pex.typing import TYPE_CHECKING, cast 10 | 11 | if TYPE_CHECKING: 12 | import appdirs # vendor:skip 13 | else: 14 | from pex.third_party import appdirs 15 | 16 | 17 | def _user_dir(): 18 | # type: () -> str 19 | return os.path.realpath(os.path.expanduser("~")) 20 | 21 | 22 | def _cache_dir(): 23 | # type: () -> str 24 | return cast(str, os.path.realpath(appdirs.user_cache_dir(appauthor=False, appname="pex"))) 25 | 26 | 27 | _USER_DIR = _user_dir() 28 | _CACHE_DIR = _cache_dir() 29 | 30 | 31 | def path( 32 | expand_user=True, # type: bool 33 | cache=True, # type: bool 34 | ): 35 | # type: (...) -> str 36 | 37 | if cache: 38 | return _path(_USER_DIR, _CACHE_DIR, expand_user) 39 | return _path(_user_dir(), _cache_dir(), expand_user) 40 | 41 | 42 | def _path( 43 | user_dir, # type: str 44 | cache_dir, # type: str 45 | expand_user=True, # type: bool 46 | ): 47 | # type: (...) -> str 48 | 49 | if expand_user or user_dir != safe_commonpath((user_dir, cache_dir)): 50 | return cache_dir 51 | return os.path.join("~", os.path.relpath(cache_dir, user_dir)) 52 | -------------------------------------------------------------------------------- /pex/cli/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | -------------------------------------------------------------------------------- /pex/cli/__main__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | import sys 7 | 8 | from pex.cli import pex 9 | 10 | sys.exit(pex.main()) 11 | -------------------------------------------------------------------------------- /pex/cli/commands/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from pex.cli.command import BuildTimeCommand 5 | from pex.cli.commands.cache.command import Cache 6 | from pex.cli.commands.docs import Docs 7 | from pex.cli.commands.interpreter import Interpreter 8 | from pex.cli.commands.lock import Lock 9 | from pex.cli.commands.venv import Venv 10 | from pex.typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from typing import Iterable, Type 14 | 15 | 16 | def all_commands(): 17 | # type: () -> Iterable[Type[BuildTimeCommand]] 18 | return Cache, Docs, Interpreter, Lock, Venv 19 | -------------------------------------------------------------------------------- /pex/cli/commands/cache/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/cli/commands/cache/__init__.py -------------------------------------------------------------------------------- /pex/cli/pex.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | from argparse import ArgumentError, ArgumentTypeError 7 | 8 | from pex.cli import commands 9 | from pex.cli.command import BuildTimeCommand 10 | from pex.commands.command import GlobalConfigurationError, Main 11 | from pex.result import catch 12 | from pex.typing import TYPE_CHECKING 13 | 14 | if TYPE_CHECKING: 15 | from typing import Union 16 | 17 | 18 | class Pex3(Main[BuildTimeCommand]): 19 | """Tools for building and working with [P]ython [EX]ecutables. 20 | 21 | N.B: This interface is considered unstable until the release of Pex 3.0 at which point it will 22 | replace the current `pex` command. 23 | """ 24 | 25 | 26 | def main(): 27 | # type: () -> Union[int, str] 28 | 29 | pex3 = Pex3(command_types=commands.all_commands()) 30 | try: 31 | with pex3.parsed_command() as command: 32 | result = catch(command.run) 33 | result.maybe_display() 34 | return result.exit_code 35 | except (ArgumentError, ArgumentTypeError, GlobalConfigurationError) as e: 36 | return str(e) 37 | -------------------------------------------------------------------------------- /pex/cli_util.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | import os 7 | import sys 8 | 9 | from pex.compatibility import commonpath 10 | from pex.typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from typing import Optional 14 | 15 | 16 | def prog_path(prog=None): 17 | # type: (Optional[str]) -> str 18 | """Generate the most concise path possible that is still runnable on the command line.""" 19 | 20 | exe_path = os.path.abspath(prog or sys.argv[0]) 21 | cwd = os.path.abspath(os.getcwd()) 22 | if commonpath((exe_path, cwd)) == cwd: 23 | exe_path = os.path.relpath(exe_path, cwd) 24 | # Handle users that do not have . as a PATH entry. 25 | if not os.path.dirname(exe_path) and os.curdir not in os.environ.get("PATH", "").split( 26 | os.pathsep 27 | ): 28 | exe_path = os.path.join(os.curdir, exe_path) 29 | else: 30 | exe_dir = os.path.dirname(exe_path) 31 | for path_entry in os.environ.get("PATH", "").split(os.pathsep): 32 | abs_path_entry = os.path.abspath(path_entry) 33 | if exe_dir == abs_path_entry: 34 | return os.path.basename(exe_path) 35 | return exe_path 36 | -------------------------------------------------------------------------------- /pex/commands/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | -------------------------------------------------------------------------------- /pex/distutils/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | -------------------------------------------------------------------------------- /pex/distutils/commands/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | -------------------------------------------------------------------------------- /pex/docs/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | import os.path 7 | 8 | from pex.typing import TYPE_CHECKING 9 | 10 | if TYPE_CHECKING: 11 | from typing import Optional 12 | 13 | 14 | def root(doc_type="html"): 15 | # type: (str) -> Optional[str] 16 | 17 | doc_root = os.path.join(os.path.dirname(__file__), doc_type) 18 | return doc_root if os.path.isdir(doc_root) else None 19 | -------------------------------------------------------------------------------- /pex/fingerprinted_distribution.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | from pex.dist_metadata import Distribution 7 | from pex.pep_503 import ProjectName 8 | from pex.typing import TYPE_CHECKING 9 | 10 | if TYPE_CHECKING: 11 | import attr # vendor:skip 12 | else: 13 | from pex.third_party import attr 14 | 15 | 16 | @attr.s(frozen=True) 17 | class FingerprintedDistribution(object): 18 | distribution = attr.ib() # type: Distribution 19 | fingerprint = attr.ib() # type: str 20 | 21 | @property 22 | def location(self): 23 | # type: () -> str 24 | return self.distribution.location 25 | 26 | @property 27 | def project_name(self): 28 | # type: () -> ProjectName 29 | return self.distribution.metadata.project_name 30 | -------------------------------------------------------------------------------- /pex/globals.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | 5 | class Globals(dict): 6 | """The globals dict returned by PEX executions that evaluate code without exiting / exec'ing.""" 7 | -------------------------------------------------------------------------------- /pex/inherit_path.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | from pex.enum import Enum 7 | from pex.typing import TYPE_CHECKING 8 | 9 | if TYPE_CHECKING: 10 | from typing import Union 11 | 12 | 13 | class InheritPath(Enum["InheritPath.Value"]): 14 | class Value(Enum.Value): 15 | pass 16 | 17 | FALSE = Value("false") 18 | PREFER = Value("prefer") 19 | FALLBACK = Value("fallback") 20 | 21 | @classmethod 22 | def for_value(cls, value): 23 | # type: (Union[str, bool]) -> InheritPath.Value 24 | if not isinstance(value, bool): 25 | return super(InheritPath, cls).for_value(value) 26 | elif value is False: 27 | return InheritPath.FALSE 28 | elif value is True: 29 | return InheritPath.PREFER 30 | else: 31 | raise ValueError( 32 | "An InheritPath.Value must be a str or a bool; given {} of type {}".format( 33 | value, type(value) 34 | ) 35 | ) 36 | 37 | 38 | InheritPath.seal() 39 | -------------------------------------------------------------------------------- /pex/pex_warnings.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | # Copyright 2019 Pex project contributors. 3 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 4 | 5 | from __future__ import absolute_import 6 | 7 | import warnings 8 | 9 | from pex.typing import TYPE_CHECKING, Literal 10 | 11 | if TYPE_CHECKING: 12 | from typing import Optional 13 | 14 | from pex.pex_info import PexInfo 15 | from pex.variables import Variables 16 | 17 | 18 | class PEXWarning(Warning): 19 | """Indicates a warning from PEX about suspect buildtime or runtime configuration.""" 20 | 21 | 22 | def configure_warnings( 23 | env, # type: Variables 24 | pex_info=None, # type: Optional[PexInfo] 25 | ): 26 | # type: (...) -> None 27 | if env.PEX_VERBOSE > 0: 28 | emit_warnings = True 29 | elif env.PEX_EMIT_WARNINGS is not None: 30 | emit_warnings = env.PEX_EMIT_WARNINGS 31 | elif pex_info: 32 | emit_warnings = pex_info.emit_warnings 33 | else: 34 | emit_warnings = True 35 | 36 | action = "default" if emit_warnings else "ignore" # type: Literal["default", "ignore"] 37 | warnings.filterwarnings(action, category=PEXWarning) 38 | 39 | 40 | def warn(message): 41 | # type: (str) -> None 42 | warnings.warn(message, category=PEXWarning, stacklevel=2) 43 | -------------------------------------------------------------------------------- /pex/pip/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | -------------------------------------------------------------------------------- /pex/pip/foreign_platform/tags.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | import itertools 7 | import json 8 | import os 9 | 10 | 11 | def patch(): 12 | from pip._internal.utils import compatibility_tags 13 | from pip._vendor.packaging import tags 14 | 15 | # N.B.: The following environment variable is used by the Pex runtime to control Pip and must be 16 | # kept in-sync with `__init__.py`. 17 | patched_tags_file = os.environ.pop("_PEX_PATCHED_TAGS_FILE") 18 | with open(patched_tags_file) as fp: 19 | patched_tags = tuple( 20 | itertools.chain.from_iterable(tags.parse_tag(tag) for tag in json.load(fp)) 21 | ) 22 | 23 | def get_supported(*_args, **_kwargs): 24 | return list(patched_tags) 25 | 26 | compatibility_tags.get_supported = get_supported 27 | -------------------------------------------------------------------------------- /pex/repl/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | # For re-export 7 | from pex.repl.pex_repl import create_pex_repl, create_pex_repl_exe, export_pex_cli_run # noqa 8 | 9 | __all__ = ("create_pex_repl", "create_pex_repl_exe", "export_pex_cli_run") 10 | -------------------------------------------------------------------------------- /pex/resolve/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | -------------------------------------------------------------------------------- /pex/resolve/lockfile/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | -------------------------------------------------------------------------------- /pex/resolve/pep_691/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | -------------------------------------------------------------------------------- /pex/tools/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | -------------------------------------------------------------------------------- /pex/tools/__main__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | import sys 7 | 8 | from pex.tools.main import main as tools 9 | 10 | sys.exit(tools()) 11 | -------------------------------------------------------------------------------- /pex/tools/command.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | from abc import abstractmethod 7 | 8 | from pex.commands.command import Command 9 | from pex.pex import PEX 10 | from pex.result import Result 11 | 12 | 13 | class PEXCommand(Command): 14 | @abstractmethod 15 | def run(self, pex): 16 | # type: (PEX) -> Result 17 | raise NotImplementedError() 18 | -------------------------------------------------------------------------------- /pex/tools/commands/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from pex.tools.command import PEXCommand 5 | from pex.tools.commands.graph import Graph 6 | from pex.tools.commands.info import Info 7 | from pex.tools.commands.interpreter import Interpreter 8 | from pex.tools.commands.repository import Repository 9 | from pex.tools.commands.venv import Venv 10 | from pex.typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from typing import Iterable, Type 14 | 15 | 16 | def all_commands(): 17 | # type: () -> Iterable[Type[PEXCommand]] 18 | return Info, Interpreter, Graph, Repository, Venv 19 | -------------------------------------------------------------------------------- /pex/tools/commands/info.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | from argparse import ArgumentParser 7 | 8 | from pex.commands.command import JsonMixin, OutputMixin 9 | from pex.pex import PEX 10 | from pex.result import Ok, Result 11 | from pex.tools.command import PEXCommand 12 | 13 | 14 | class Info(JsonMixin, OutputMixin, PEXCommand): 15 | """Dumps the PEX-INFO json contained in a PEX file.""" 16 | 17 | @classmethod 18 | def add_arguments(cls, parser): 19 | # type: (ArgumentParser) -> None 20 | cls.add_output_option(parser, entity="PEX-INFO json") 21 | cls.add_json_options(parser, entity="PEX-INFO") 22 | cls.register_global_arguments(parser) 23 | 24 | def run(self, pex): 25 | # type: (PEX) -> Result 26 | with self.output(self.options) as out: 27 | self.dump_json(self.options, pex.pex_info().as_json_dict(), out) 28 | out.write("\n") 29 | return Ok() 30 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/__init__.py -------------------------------------------------------------------------------- /pex/vendor/_vendored/ansicolors/.layout.json: -------------------------------------------------------------------------------- 1 | {"fingerprint": "a175b8cdfaabde6458bf70a07cf4ea1a51d4a8edf2502dff5777a049b610f354", "record_relpath": "ansicolors-1.1.8.dist-info/RECORD", "root_is_purelib": true, "stash_dir": ".prefix"} -------------------------------------------------------------------------------- /pex/vendor/_vendored/ansicolors/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/ansicolors/__init__.py -------------------------------------------------------------------------------- /pex/vendor/_vendored/ansicolors/ansicolors-1.1.8.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pex 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/ansicolors/ansicolors-1.1.8.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.29.0) 3 | Root-Is-Purelib: true 4 | Tag: py2-none-any 5 | Tag: py3-none-any 6 | 7 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/ansicolors/ansicolors-1.1.8.dist-info/metadata.json: -------------------------------------------------------------------------------- 1 | {"classifiers": ["Environment :: Console", "Operating System :: OS Independent", "Intended Audience :: Developers", "License :: OSI Approved :: ISC License (ISCL)", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries :: Python Modules"], "extensions": {"python.details": {"contacts": [{"email": "jonathan.eunice@gmail.com", "name": "Jonathan Eunice", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}, "project_urls": {"Home": "http://github.com/jonathaneunice/colors/"}}}, "generator": "bdist_wheel (0.29.0)", "keywords": ["ASNI", "color", "style", "console"], "license": "ISC", "metadata_version": "2.0", "name": "ansicolors", "summary": "ANSI colors for Python", "version": "1.1.8"} -------------------------------------------------------------------------------- /pex/vendor/_vendored/ansicolors/ansicolors-1.1.8.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | colors 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/ansicolors/colors/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from .colors import * 3 | from .csscolors import * 4 | from .version import __version__ 5 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/ansicolors/colors/version.py: -------------------------------------------------------------------------------- 1 | __version__ = '1.1.8' 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/ansicolors/constraints.txt: -------------------------------------------------------------------------------- 1 | ansicolors==1.1.8 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/appdirs/.layout.json: -------------------------------------------------------------------------------- 1 | {"fingerprint": "383339ca0d10d6c4144fc79e24b2c65304bdfcfbebabcf10c8ec6e9b73ee64fd", "record_relpath": "appdirs-1.4.4.dist-info/RECORD", "root_is_purelib": true, "stash_dir": ".prefix"} -------------------------------------------------------------------------------- /pex/vendor/_vendored/appdirs/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/appdirs/__init__.py -------------------------------------------------------------------------------- /pex/vendor/_vendored/appdirs/appdirs-1.4.4.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pex 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/appdirs/appdirs-1.4.4.dist-info/LICENSE.txt: -------------------------------------------------------------------------------- 1 | # This is the MIT license 2 | 3 | Copyright (c) 2010 ActiveState Software Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included 14 | in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/appdirs/appdirs-1.4.4.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.34.2) 3 | Root-Is-Purelib: true 4 | Tag: py2-none-any 5 | Tag: py3-none-any 6 | 7 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/appdirs/appdirs-1.4.4.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | appdirs 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/appdirs/constraints.txt: -------------------------------------------------------------------------------- 1 | appdirs==1.4.4 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/attrs/.layout.json: -------------------------------------------------------------------------------- 1 | {"fingerprint": "f827748f286aa52ec78b7f6d7f0ae069555adff917b19b0097afa8b7ea45389a", "record_relpath": "attrs-21.5.0.dev0.dist-info/RECORD", "root_is_purelib": true, "stash_dir": ".prefix"} -------------------------------------------------------------------------------- /pex/vendor/_vendored/attrs/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/attrs/__init__.py -------------------------------------------------------------------------------- /pex/vendor/_vendored/attrs/attr/_cmp.pyi: -------------------------------------------------------------------------------- 1 | from typing import Type 2 | 3 | from . import _CompareWithType 4 | 5 | def cmp_using( 6 | eq: Optional[_CompareWithType], 7 | lt: Optional[_CompareWithType], 8 | le: Optional[_CompareWithType], 9 | gt: Optional[_CompareWithType], 10 | ge: Optional[_CompareWithType], 11 | require_same_type: bool, 12 | class_name: str, 13 | ) -> Type: ... 14 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/attrs/attr/_config.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: MIT 2 | 3 | from __future__ import absolute_import, division, print_function 4 | 5 | 6 | __all__ = ["set_run_validators", "get_run_validators"] 7 | 8 | _run_validators = True 9 | 10 | 11 | def set_run_validators(run): 12 | """ 13 | Set whether or not validators are run. By default, they are run. 14 | 15 | .. deprecated:: 21.3.0 It will not be removed, but it also will not be 16 | moved to new ``attrs`` namespace. Use `attrs.validators.set_disabled()` 17 | instead. 18 | """ 19 | if not isinstance(run, bool): 20 | raise TypeError("'run' must be bool.") 21 | global _run_validators 22 | _run_validators = run 23 | 24 | 25 | def get_run_validators(): 26 | """ 27 | Return whether or not validators are run. 28 | 29 | .. deprecated:: 21.3.0 It will not be removed, but it also will not be 30 | moved to new ``attrs`` namespace. Use `attrs.validators.get_disabled()` 31 | instead. 32 | """ 33 | return _run_validators 34 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/attrs/attr/_version_info.pyi: -------------------------------------------------------------------------------- 1 | class VersionInfo: 2 | @property 3 | def year(self) -> int: ... 4 | @property 5 | def minor(self) -> int: ... 6 | @property 7 | def micro(self) -> int: ... 8 | @property 9 | def releaselevel(self) -> str: ... 10 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/attrs/attr/converters.pyi: -------------------------------------------------------------------------------- 1 | from typing import Callable, Optional, TypeVar, overload 2 | 3 | from . import _ConverterType 4 | 5 | _T = TypeVar("_T") 6 | 7 | def pipe(*validators: _ConverterType) -> _ConverterType: ... 8 | def optional(converter: _ConverterType) -> _ConverterType: ... 9 | @overload 10 | def default_if_none(default: _T) -> _ConverterType: ... 11 | @overload 12 | def default_if_none(*, factory: Callable[[], _T]) -> _ConverterType: ... 13 | def to_bool(val: str) -> bool: ... 14 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/attrs/attr/exceptions.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | 3 | class FrozenError(AttributeError): 4 | msg: str = ... 5 | 6 | class FrozenInstanceError(FrozenError): ... 7 | class FrozenAttributeError(FrozenError): ... 8 | class AttrsAttributeNotFoundError(ValueError): ... 9 | class NotAnAttrsClassError(ValueError): ... 10 | class DefaultAlreadySetError(RuntimeError): ... 11 | class UnannotatedAttributeError(RuntimeError): ... 12 | class PythonTooOldError(RuntimeError): ... 13 | 14 | class NotCallableError(TypeError): 15 | msg: str = ... 16 | value: Any = ... 17 | def __init__(self, msg: str, value: Any) -> None: ... 18 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/attrs/attr/filters.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: MIT 2 | 3 | """ 4 | Commonly useful filters for `attr.asdict`. 5 | """ 6 | 7 | from __future__ import absolute_import, division, print_function 8 | 9 | from ._compat import isclass 10 | from ._make import Attribute 11 | 12 | 13 | def _split_what(what): 14 | """ 15 | Returns a tuple of `frozenset`s of classes and attributes. 16 | """ 17 | return ( 18 | frozenset(cls for cls in what if isclass(cls)), 19 | frozenset(cls for cls in what if isinstance(cls, Attribute)), 20 | ) 21 | 22 | 23 | def include(*what): 24 | """ 25 | Include *what*. 26 | 27 | :param what: What to include. 28 | :type what: `list` of `type` or `attrs.Attribute`\\ s 29 | 30 | :rtype: `callable` 31 | """ 32 | cls, attrs = _split_what(what) 33 | 34 | def include_(attribute, value): 35 | return value.__class__ in cls or attribute in attrs 36 | 37 | return include_ 38 | 39 | 40 | def exclude(*what): 41 | """ 42 | Exclude *what*. 43 | 44 | :param what: What to exclude. 45 | :type what: `list` of classes or `attrs.Attribute`\\ s. 46 | 47 | :rtype: `callable` 48 | """ 49 | cls, attrs = _split_what(what) 50 | 51 | def exclude_(attribute, value): 52 | return value.__class__ not in cls and attribute not in attrs 53 | 54 | return exclude_ 55 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/attrs/attr/filters.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any, Union 2 | 3 | from . import Attribute, _FilterType 4 | 5 | def include(*what: Union[type, Attribute[Any]]) -> _FilterType[Any]: ... 6 | def exclude(*what: Union[type, Attribute[Any]]) -> _FilterType[Any]: ... 7 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/attrs/attr/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/attrs/attr/py.typed -------------------------------------------------------------------------------- /pex/vendor/_vendored/attrs/attr/setters.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any, NewType, NoReturn, TypeVar, cast 2 | 3 | from . import Attribute, _OnSetAttrType 4 | 5 | _T = TypeVar("_T") 6 | 7 | def frozen( 8 | instance: Any, attribute: Attribute[Any], new_value: Any 9 | ) -> NoReturn: ... 10 | def pipe(*setters: _OnSetAttrType) -> _OnSetAttrType: ... 11 | def validate(instance: Any, attribute: Attribute[_T], new_value: _T) -> _T: ... 12 | 13 | # convert is allowed to return Any, because they can be chained using pipe. 14 | def convert( 15 | instance: Any, attribute: Attribute[Any], new_value: Any 16 | ) -> Any: ... 17 | 18 | _NoOpType = NewType("_NoOpType", object) 19 | NO_OP: _NoOpType 20 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/attrs/attrs-21.5.0.dev0.dist-info/AUTHORS.rst: -------------------------------------------------------------------------------- 1 | Credits 2 | ======= 3 | 4 | ``attrs`` is written and maintained by `Hynek Schlawack `_. 5 | 6 | The development is kindly supported by `Variomedia AG `_. 7 | 8 | A full list of contributors can be found in `GitHub's overview `_. 9 | 10 | It’s the spiritual successor of `characteristic `_ and aspires to fix some of it clunkiness and unfortunate decisions. 11 | Both were inspired by Twisted’s `FancyEqMixin `_ but both are implemented using class decorators because `subclassing is bad for you `_, m’kay? 12 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/attrs/attrs-21.5.0.dev0.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pex 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/attrs/attrs-21.5.0.dev0.dist-info/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Hynek Schlawack 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/attrs/attrs-21.5.0.dev0.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.35.1) 3 | Root-Is-Purelib: true 4 | Tag: py2-none-any 5 | Tag: py3-none-any 6 | 7 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/attrs/attrs-21.5.0.dev0.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | attr 2 | attrs 3 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/attrs/attrs/converters.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: MIT 2 | 3 | if "attrs" in __import__("os").environ.get("__PEX_UNVENDORED__", ""): 4 | from attr.converters import * # vendor:skip 5 | else: 6 | from pex.third_party.attr.converters import * 7 | # noqa 8 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/attrs/attrs/exceptions.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: MIT 2 | 3 | if "attrs" in __import__("os").environ.get("__PEX_UNVENDORED__", ""): 4 | from attr.exceptions import * # vendor:skip 5 | else: 6 | from pex.third_party.attr.exceptions import * 7 | # noqa 8 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/attrs/attrs/filters.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: MIT 2 | 3 | if "attrs" in __import__("os").environ.get("__PEX_UNVENDORED__", ""): 4 | from attr.filters import * # vendor:skip 5 | else: 6 | from pex.third_party.attr.filters import * 7 | # noqa 8 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/attrs/attrs/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/attrs/attrs/py.typed -------------------------------------------------------------------------------- /pex/vendor/_vendored/attrs/attrs/setters.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: MIT 2 | 3 | if "attrs" in __import__("os").environ.get("__PEX_UNVENDORED__", ""): 4 | from attr.setters import * # vendor:skip 5 | else: 6 | from pex.third_party.attr.setters import * 7 | # noqa 8 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/attrs/attrs/validators.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: MIT 2 | 3 | if "attrs" in __import__("os").environ.get("__PEX_UNVENDORED__", ""): 4 | from attr.validators import * # vendor:skip 5 | else: 6 | from pex.third_party.attr.validators import * 7 | # noqa 8 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_20_9/.layout.json: -------------------------------------------------------------------------------- 1 | {"fingerprint": "3946db78a8f564b5e0f20648918e6352f64be213519585fe08750b080a1a21c3", "record_relpath": "packaging-20.9.dist-info/RECORD", "root_is_purelib": true, "stash_dir": ".prefix"} -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_20_9/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/packaging_20_9/__init__.py -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_20_9/constraints.txt: -------------------------------------------------------------------------------- 1 | packaging==20.9 2 | pyparsing==2.4.7 3 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_20_9/packaging-20.9.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pex 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_20_9/packaging-20.9.dist-info/LICENSE: -------------------------------------------------------------------------------- 1 | This software is made available under the terms of *either* of the licenses 2 | found in LICENSE.APACHE or LICENSE.BSD. Contributions to this software is made 3 | under the terms of *both* these licenses. 4 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_20_9/packaging-20.9.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.36.2) 3 | Root-Is-Purelib: true 4 | Tag: py2-none-any 5 | Tag: py3-none-any 6 | 7 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_20_9/packaging-20.9.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | packaging 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_20_9/packaging/__about__.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | from __future__ import absolute_import, division, print_function 5 | 6 | __all__ = [ 7 | "__title__", 8 | "__summary__", 9 | "__uri__", 10 | "__version__", 11 | "__author__", 12 | "__email__", 13 | "__license__", 14 | "__copyright__", 15 | ] 16 | 17 | __title__ = "packaging" 18 | __summary__ = "Core utilities for Python packages" 19 | __uri__ = "https://github.com/pypa/packaging" 20 | 21 | __version__ = "20.9" 22 | 23 | __author__ = "Donald Stufft and individual contributors" 24 | __email__ = "donald@stufft.io" 25 | 26 | __license__ = "BSD-2-Clause or Apache-2.0" 27 | __copyright__ = "2014-2019 %s" % __author__ 28 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_20_9/packaging/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | from __future__ import absolute_import, division, print_function 5 | 6 | from .__about__ import ( 7 | __author__, 8 | __copyright__, 9 | __email__, 10 | __license__, 11 | __summary__, 12 | __title__, 13 | __uri__, 14 | __version__, 15 | ) 16 | 17 | __all__ = [ 18 | "__title__", 19 | "__summary__", 20 | "__uri__", 21 | "__version__", 22 | "__author__", 23 | "__email__", 24 | "__license__", 25 | "__copyright__", 26 | ] 27 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_20_9/packaging/_compat.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | from __future__ import absolute_import, division, print_function 5 | 6 | import sys 7 | 8 | from ._typing import TYPE_CHECKING 9 | 10 | if TYPE_CHECKING: # pragma: no cover 11 | from typing import Any, Dict, Tuple, Type 12 | 13 | 14 | PY2 = sys.version_info[0] == 2 15 | PY3 = sys.version_info[0] == 3 16 | 17 | # flake8: noqa 18 | 19 | if PY3: 20 | string_types = (str,) 21 | else: 22 | string_types = (basestring,) 23 | 24 | 25 | def with_metaclass(meta, *bases): 26 | # type: (Type[Any], Tuple[Type[Any], ...]) -> Any 27 | """ 28 | Create a base class with a metaclass. 29 | """ 30 | # This requires a bit of explanation: the basic idea is to make a dummy 31 | # metaclass for one level of class instantiation that replaces itself with 32 | # the actual metaclass. 33 | class metaclass(meta): # type: ignore 34 | def __new__(cls, name, this_bases, d): 35 | # type: (Type[Any], str, Tuple[Any], Dict[Any, Any]) -> Any 36 | return meta(name, bases, d) 37 | 38 | return type.__new__(metaclass, "temporary_class", (), {}) 39 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_20_9/packaging/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/packaging_20_9/packaging/py.typed -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_20_9/pyparsing-2.4.7.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pex 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_20_9/pyparsing-2.4.7.dist-info/LICENSE: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any person obtaining 2 | a copy of this software and associated documentation files (the 3 | "Software"), to deal in the Software without restriction, including 4 | without limitation the rights to use, copy, modify, merge, publish, 5 | distribute, sublicense, and/or sell copies of the Software, and to 6 | permit persons to whom the Software is furnished to do so, subject to 7 | the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be 10 | included in all copies or substantial portions of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 13 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 14 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 16 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 17 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 18 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_20_9/pyparsing-2.4.7.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.34.2) 3 | Root-Is-Purelib: true 4 | Tag: py2-none-any 5 | Tag: py3-none-any 6 | 7 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_20_9/pyparsing-2.4.7.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | pyparsing 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_21_3/.layout.json: -------------------------------------------------------------------------------- 1 | {"fingerprint": "84b4c176f8bac2d9fc042dd1618394580af666252a61e1d88544b4f6bbf66523", "record_relpath": "packaging-21.3.dist-info/RECORD", "root_is_purelib": true, "stash_dir": ".prefix"} -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_21_3/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/packaging_21_3/__init__.py -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_21_3/constraints.txt: -------------------------------------------------------------------------------- 1 | packaging==21.3 2 | pyparsing==3.0.7 3 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_21_3/packaging-21.3.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pex 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_21_3/packaging-21.3.dist-info/LICENSE: -------------------------------------------------------------------------------- 1 | This software is made available under the terms of *either* of the licenses 2 | found in LICENSE.APACHE or LICENSE.BSD. Contributions to this software is made 3 | under the terms of *both* these licenses. 4 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_21_3/packaging-21.3.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.37.0) 3 | Root-Is-Purelib: true 4 | Tag: py3-none-any 5 | 6 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_21_3/packaging-21.3.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | packaging 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_21_3/packaging/__about__.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | 5 | __all__ = [ 6 | "__title__", 7 | "__summary__", 8 | "__uri__", 9 | "__version__", 10 | "__author__", 11 | "__email__", 12 | "__license__", 13 | "__copyright__", 14 | ] 15 | 16 | __title__ = "packaging" 17 | __summary__ = "Core utilities for Python packages" 18 | __uri__ = "https://github.com/pypa/packaging" 19 | 20 | __version__ = "21.3" 21 | 22 | __author__ = "Donald Stufft and individual contributors" 23 | __email__ = "donald@stufft.io" 24 | 25 | __license__ = "BSD-2-Clause or Apache-2.0" 26 | __copyright__ = "2014-2019 %s" % __author__ 27 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_21_3/packaging/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | 5 | from .__about__ import ( 6 | __author__, 7 | __copyright__, 8 | __email__, 9 | __license__, 10 | __summary__, 11 | __title__, 12 | __uri__, 13 | __version__, 14 | ) 15 | 16 | __all__ = [ 17 | "__title__", 18 | "__summary__", 19 | "__uri__", 20 | "__version__", 21 | "__author__", 22 | "__email__", 23 | "__license__", 24 | "__copyright__", 25 | ] 26 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_21_3/packaging/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/packaging_21_3/packaging/py.typed -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_21_3/pyparsing-3.0.7.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pex 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_21_3/pyparsing-3.0.7.dist-info/LICENSE: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any person obtaining 2 | a copy of this software and associated documentation files (the 3 | "Software"), to deal in the Software without restriction, including 4 | without limitation the rights to use, copy, modify, merge, publish, 5 | distribute, sublicense, and/or sell copies of the Software, and to 6 | permit persons to whom the Software is furnished to do so, subject to 7 | the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be 10 | included in all copies or substantial portions of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 13 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 14 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 16 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 17 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 18 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_21_3/pyparsing-3.0.7.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.36.2) 3 | Root-Is-Purelib: true 4 | Tag: py3-none-any 5 | 6 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_21_3/pyparsing-3.0.7.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | pyparsing 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_21_3/pyparsing/diagram/template.jinja2: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {% if not head %} 5 | 10 | {% else %} 11 | {{ hear | safe }} 12 | {% endif %} 13 | 14 | 15 | {{ body | safe }} 16 | {% for diagram in diagrams %} 17 |
18 |

{{ diagram.title }}

19 |
{{ diagram.text }}
20 |
21 | {{ diagram.svg }} 22 |
23 |
24 | {% endfor %} 25 | 26 | 27 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_24_0/.layout.json: -------------------------------------------------------------------------------- 1 | {"fingerprint": "2752c146bc83b54ff1b8e075b9c0be67eb08afa19a3b140c4bd6455ea71fab5e", "record_relpath": "packaging-24.0.dist-info/RECORD", "root_is_purelib": true, "stash_dir": ".prefix"} -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_24_0/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/packaging_24_0/__init__.py -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_24_0/constraints.txt: -------------------------------------------------------------------------------- 1 | packaging==24.0 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_24_0/packaging-24.0.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pex 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_24_0/packaging-24.0.dist-info/LICENSE: -------------------------------------------------------------------------------- 1 | This software is made available under the terms of *either* of the licenses 2 | found in LICENSE.APACHE or LICENSE.BSD. Contributions to this software is made 3 | under the terms of *both* these licenses. 4 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_24_0/packaging-24.0.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: flit 3.9.0 3 | Root-Is-Purelib: true 4 | Tag: py3-none-any 5 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_24_0/packaging/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | 5 | __title__ = "packaging" 6 | __summary__ = "Core utilities for Python packages" 7 | __uri__ = "https://github.com/pypa/packaging" 8 | 9 | __version__ = "24.0" 10 | 11 | __author__ = "Donald Stufft and individual contributors" 12 | __email__ = "donald@stufft.io" 13 | 14 | __license__ = "BSD-2-Clause or Apache-2.0" 15 | __copyright__ = "2014 %s" % __author__ 16 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_24_0/packaging/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/packaging_24_0/packaging/py.typed -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_25_0/.layout.json: -------------------------------------------------------------------------------- 1 | {"fingerprint": "4390b6077435abbfa59ee50812f10d070650a9169b2bac4c0885764cbc6d2453", "record_relpath": "packaging-25.0.dist-info/RECORD", "root_is_purelib": true, "stash_dir": ".prefix"} -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_25_0/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/packaging_25_0/__init__.py -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_25_0/constraints.txt: -------------------------------------------------------------------------------- 1 | packaging==25.0 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_25_0/packaging-25.0.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pex 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_25_0/packaging-25.0.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: flit 3.12.0 3 | Root-Is-Purelib: true 4 | Tag: py3-none-any 5 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_25_0/packaging-25.0.dist-info/licenses/LICENSE: -------------------------------------------------------------------------------- 1 | This software is made available under the terms of *either* of the licenses 2 | found in LICENSE.APACHE or LICENSE.BSD. Contributions to this software is made 3 | under the terms of *both* these licenses. 4 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_25_0/packaging/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | 5 | __title__ = "packaging" 6 | __summary__ = "Core utilities for Python packages" 7 | __uri__ = "https://github.com/pypa/packaging" 8 | 9 | __version__ = "25.0" 10 | 11 | __author__ = "Donald Stufft and individual contributors" 12 | __email__ = "donald@stufft.io" 13 | 14 | __license__ = "BSD-2-Clause or Apache-2.0" 15 | __copyright__ = f"2014 {__author__}" 16 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/packaging_25_0/packaging/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/packaging_25_0/packaging/py.typed -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/.layout.json: -------------------------------------------------------------------------------- 1 | {"fingerprint": "ba38180edf5b3ac4ad8ff078b3d4ef7d75d778a203f18fe3f7913c96b76fa870", "record_relpath": "pip-20.3.4.dist-info/RECORD", "root_is_purelib": true, "stash_dir": ".prefix"} -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/.prefix/bin/pip: -------------------------------------------------------------------------------- 1 | #!python 2 | # -*- coding: utf-8 -*- 3 | import importlib 4 | import sys 5 | 6 | entry_point = importlib.import_module('pip._internal.cli.main') 7 | for attr in ('main',): 8 | entry_point = getattr(entry_point, attr) 9 | 10 | if __name__ == "__main__": 11 | sys.exit(entry_point()) 12 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/.prefix/bin/pip3: -------------------------------------------------------------------------------- 1 | #!python 2 | # -*- coding: utf-8 -*- 3 | import importlib 4 | import sys 5 | 6 | entry_point = importlib.import_module('pip._internal.cli.main') 7 | for attr in ('main',): 8 | entry_point = getattr(entry_point, attr) 9 | 10 | if __name__ == "__main__": 11 | sys.exit(entry_point()) 12 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/.prefix/bin/pip3.9: -------------------------------------------------------------------------------- 1 | #!python 2 | # -*- coding: utf-8 -*- 3 | import importlib 4 | import sys 5 | 6 | entry_point = importlib.import_module('pip._internal.cli.main') 7 | for attr in ('main',): 8 | entry_point = getattr(entry_point, attr) 9 | 10 | if __name__ == "__main__": 11 | sys.exit(entry_point()) 12 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/pip/__init__.py -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip-20.3.4.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pex 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip-20.3.4.dist-info/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008-2020 The pip developers (see AUTHORS.txt file) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip-20.3.4.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.35.1) 3 | Root-Is-Purelib: true 4 | Tag: py2-none-any 5 | Tag: py3-none-any 6 | 7 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip-20.3.4.dist-info/entry_points.txt: -------------------------------------------------------------------------------- 1 | [console_scripts] 2 | pip = pip._internal.cli.main:main 3 | pip3 = pip._internal.cli.main:main 4 | pip3.9 = pip._internal.cli.main:main 5 | 6 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip-20.3.4.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | pip 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/__init__.py: -------------------------------------------------------------------------------- 1 | from pip._internal.utils.typing import MYPY_CHECK_RUNNING 2 | 3 | if MYPY_CHECK_RUNNING: 4 | from typing import List, Optional 5 | 6 | 7 | __version__ = "20.3.4" 8 | 9 | 10 | def main(args=None): 11 | # type: (Optional[List[str]]) -> int 12 | """This is an internal API only meant for use by pip's own console scripts. 13 | 14 | For additional details, see https://github.com/pypa/pip/issues/7498. 15 | """ 16 | from pip._internal.utils.entrypoints import _wrapper 17 | 18 | return _wrapper(args) 19 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/__main__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import os 4 | import sys 5 | 6 | # Remove '' and current working directory from the first entry 7 | # of sys.path, if present to avoid using current directory 8 | # in pip commands check, freeze, install, list and show, 9 | # when invoked as python -m pip 10 | if sys.path[0] in ('', os.getcwd()): 11 | sys.path.pop(0) 12 | 13 | # If we are running from a wheel, add the wheel to sys.path 14 | # This allows the usage python pip-*.whl/pip install pip-*.whl 15 | if __package__ == '': 16 | # __file__ is pip-*.whl/pip/__main__.py 17 | # first dirname call strips of '/__main__.py', second strips off '/pip' 18 | # Resulting path is the name of the wheel itself 19 | # Add that to sys.path so we can import pip 20 | path = os.path.dirname(os.path.dirname(__file__)) 21 | sys.path.insert(0, path) 22 | 23 | from pip._internal.cli.main import main as _main # isort:skip # noqa 24 | 25 | if __name__ == '__main__': 26 | sys.exit(_main()) 27 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_internal/__init__.py: -------------------------------------------------------------------------------- 1 | import pip._internal.utils.inject_securetransport # noqa 2 | from pip._internal.utils.typing import MYPY_CHECK_RUNNING 3 | 4 | if MYPY_CHECK_RUNNING: 5 | from typing import List, Optional 6 | 7 | 8 | def main(args=None): 9 | # type: (Optional[List[str]]) -> int 10 | """This is preserved for old console scripts that may still be referencing 11 | it. 12 | 13 | For additional details, see https://github.com/pypa/pip/issues/7498. 14 | """ 15 | from pip._internal.utils.entrypoints import _wrapper 16 | 17 | return _wrapper(args) 18 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_internal/cli/__init__.py: -------------------------------------------------------------------------------- 1 | """Subpackage containing all of pip's command line interface related code 2 | """ 3 | 4 | # This file intentionally does not import submodules 5 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_internal/cli/command_context.py: -------------------------------------------------------------------------------- 1 | from contextlib import contextmanager 2 | 3 | from pip._vendor.contextlib2 import ExitStack 4 | 5 | from pip._internal.utils.typing import MYPY_CHECK_RUNNING 6 | 7 | if MYPY_CHECK_RUNNING: 8 | from typing import ContextManager, Iterator, TypeVar 9 | 10 | _T = TypeVar('_T', covariant=True) 11 | 12 | 13 | class CommandContextMixIn(object): 14 | def __init__(self): 15 | # type: () -> None 16 | super(CommandContextMixIn, self).__init__() 17 | self._in_main_context = False 18 | self._main_context = ExitStack() 19 | 20 | @contextmanager 21 | def main_context(self): 22 | # type: () -> Iterator[None] 23 | assert not self._in_main_context 24 | 25 | self._in_main_context = True 26 | try: 27 | with self._main_context: 28 | yield 29 | finally: 30 | self._in_main_context = False 31 | 32 | def enter_context(self, context_provider): 33 | # type: (ContextManager[_T]) -> _T 34 | assert self._in_main_context 35 | 36 | return self._main_context.enter_context(context_provider) 37 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_internal/cli/status_codes.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | SUCCESS = 0 4 | ERROR = 1 5 | UNKNOWN_ERROR = 2 6 | VIRTUALENV_NOT_FOUND = 3 7 | PREVIOUS_BUILD_DIR_ERROR = 4 8 | NO_MATCHES_FOUND = 23 9 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_internal/distributions/__init__.py: -------------------------------------------------------------------------------- 1 | from pip._internal.distributions.sdist import SourceDistribution 2 | from pip._internal.distributions.wheel import WheelDistribution 3 | from pip._internal.utils.typing import MYPY_CHECK_RUNNING 4 | 5 | if MYPY_CHECK_RUNNING: 6 | from pip._internal.distributions.base import AbstractDistribution 7 | from pip._internal.req.req_install import InstallRequirement 8 | 9 | 10 | def make_distribution_for_install_requirement(install_req): 11 | # type: (InstallRequirement) -> AbstractDistribution 12 | """Returns a Distribution for the given InstallRequirement 13 | """ 14 | # Editable requirements will always be source distributions. They use the 15 | # legacy logic until we create a modern standard for them. 16 | if install_req.editable: 17 | return SourceDistribution(install_req) 18 | 19 | # If it's a wheel, it's a WheelDistribution 20 | if install_req.is_wheel: 21 | return WheelDistribution(install_req) 22 | 23 | # Otherwise, a SourceDistribution 24 | return SourceDistribution(install_req) 25 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_internal/distributions/installed.py: -------------------------------------------------------------------------------- 1 | from pip._internal.distributions.base import AbstractDistribution 2 | from pip._internal.utils.typing import MYPY_CHECK_RUNNING 3 | 4 | if MYPY_CHECK_RUNNING: 5 | from typing import Optional 6 | 7 | from pip._vendor.pkg_resources import Distribution 8 | 9 | from pip._internal.index.package_finder import PackageFinder 10 | 11 | 12 | class InstalledDistribution(AbstractDistribution): 13 | """Represents an installed package. 14 | 15 | This does not need any preparation as the required information has already 16 | been computed. 17 | """ 18 | 19 | def get_pkg_resources_distribution(self): 20 | # type: () -> Optional[Distribution] 21 | return self.req.satisfied_by 22 | 23 | def prepare_distribution_metadata(self, finder, build_isolation): 24 | # type: (PackageFinder, bool) -> None 25 | pass 26 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_internal/index/__init__.py: -------------------------------------------------------------------------------- 1 | """Index interaction code 2 | """ 3 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_internal/main.py: -------------------------------------------------------------------------------- 1 | from pip._internal.utils.typing import MYPY_CHECK_RUNNING 2 | 3 | if MYPY_CHECK_RUNNING: 4 | from typing import List, Optional 5 | 6 | 7 | def main(args=None): 8 | # type: (Optional[List[str]]) -> int 9 | """This is preserved for old console scripts that may still be referencing 10 | it. 11 | 12 | For additional details, see https://github.com/pypa/pip/issues/7498. 13 | """ 14 | from pip._internal.utils.entrypoints import _wrapper 15 | 16 | return _wrapper(args) 17 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_internal/models/__init__.py: -------------------------------------------------------------------------------- 1 | """A package that contains models that represent entities. 2 | """ 3 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_internal/models/candidate.py: -------------------------------------------------------------------------------- 1 | from pip._vendor.packaging.version import parse as parse_version 2 | 3 | from pip._internal.utils.models import KeyBasedCompareMixin 4 | from pip._internal.utils.typing import MYPY_CHECK_RUNNING 5 | 6 | if MYPY_CHECK_RUNNING: 7 | from pip._vendor.packaging.version import _BaseVersion 8 | 9 | from pip._internal.models.link import Link 10 | 11 | 12 | class InstallationCandidate(KeyBasedCompareMixin): 13 | """Represents a potential "candidate" for installation. 14 | """ 15 | 16 | __slots__ = ["name", "version", "link"] 17 | 18 | def __init__(self, name, version, link): 19 | # type: (str, str, Link) -> None 20 | self.name = name 21 | self.version = parse_version(version) # type: _BaseVersion 22 | self.link = link 23 | 24 | super(InstallationCandidate, self).__init__( 25 | key=(self.name, self.version, self.link), 26 | defining_class=InstallationCandidate 27 | ) 28 | 29 | def __repr__(self): 30 | # type: () -> str 31 | return "".format( 32 | self.name, self.version, self.link, 33 | ) 34 | 35 | def __str__(self): 36 | # type: () -> str 37 | return '{!r} candidate (version {} at {})'.format( 38 | self.name, self.version, self.link, 39 | ) 40 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_internal/models/index.py: -------------------------------------------------------------------------------- 1 | from pip._vendor.six.moves.urllib import parse as urllib_parse 2 | 3 | 4 | class PackageIndex(object): 5 | """Represents a Package Index and provides easier access to endpoints 6 | """ 7 | 8 | __slots__ = ['url', 'netloc', 'simple_url', 'pypi_url', 9 | 'file_storage_domain'] 10 | 11 | def __init__(self, url, file_storage_domain): 12 | # type: (str, str) -> None 13 | super(PackageIndex, self).__init__() 14 | self.url = url 15 | self.netloc = urllib_parse.urlsplit(url).netloc 16 | self.simple_url = self._url_for_path('simple') 17 | self.pypi_url = self._url_for_path('pypi') 18 | 19 | # This is part of a temporary hack used to block installs of PyPI 20 | # packages which depend on external urls only necessary until PyPI can 21 | # block such packages themselves 22 | self.file_storage_domain = file_storage_domain 23 | 24 | def _url_for_path(self, path): 25 | # type: (str) -> str 26 | return urllib_parse.urljoin(self.url, path) 27 | 28 | 29 | PyPI = PackageIndex( 30 | 'https://pypi.org/', file_storage_domain='files.pythonhosted.org' 31 | ) 32 | TestPyPI = PackageIndex( 33 | 'https://test.pypi.org/', file_storage_domain='test-files.pythonhosted.org' 34 | ) 35 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_internal/models/scheme.py: -------------------------------------------------------------------------------- 1 | """ 2 | For types associated with installation schemes. 3 | 4 | For a general overview of available schemes and their context, see 5 | https://docs.python.org/3/install/index.html#alternate-installation. 6 | """ 7 | 8 | 9 | SCHEME_KEYS = ['platlib', 'purelib', 'headers', 'scripts', 'data'] 10 | 11 | 12 | class Scheme(object): 13 | """A Scheme holds paths which are used as the base directories for 14 | artifacts associated with a Python package. 15 | """ 16 | 17 | __slots__ = SCHEME_KEYS 18 | 19 | def __init__( 20 | self, 21 | platlib, # type: str 22 | purelib, # type: str 23 | headers, # type: str 24 | scripts, # type: str 25 | data, # type: str 26 | ): 27 | self.platlib = platlib 28 | self.purelib = purelib 29 | self.headers = headers 30 | self.scripts = scripts 31 | self.data = data 32 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_internal/network/__init__.py: -------------------------------------------------------------------------------- 1 | """Contains purely network-related utilities. 2 | """ 3 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_internal/operations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/pip/pip/_internal/operations/__init__.py -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_internal/operations/build/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/pip/pip/_internal/operations/build/__init__.py -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_internal/operations/install/__init__.py: -------------------------------------------------------------------------------- 1 | """For modules related to installing packages. 2 | """ 3 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_internal/resolution/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/pip/pip/_internal/resolution/__init__.py -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_internal/resolution/base.py: -------------------------------------------------------------------------------- 1 | from pip._internal.utils.typing import MYPY_CHECK_RUNNING 2 | 3 | if MYPY_CHECK_RUNNING: 4 | from typing import Callable, List 5 | 6 | from pip._internal.req.req_install import InstallRequirement 7 | from pip._internal.req.req_set import RequirementSet 8 | 9 | InstallRequirementProvider = Callable[ 10 | [str, InstallRequirement], InstallRequirement 11 | ] 12 | 13 | 14 | class BaseResolver(object): 15 | def resolve(self, root_reqs, check_supported_wheels): 16 | # type: (List[InstallRequirement], bool) -> RequirementSet 17 | raise NotImplementedError() 18 | 19 | def get_installation_order(self, req_set): 20 | # type: (RequirementSet) -> List[InstallRequirement] 21 | raise NotImplementedError() 22 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_internal/resolution/legacy/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/pip/pip/_internal/resolution/legacy/__init__.py -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_internal/resolution/resolvelib/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/pip/pip/_internal/resolution/resolvelib/__init__.py -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_internal/utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/pip/pip/_internal/utils/__init__.py -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_internal/utils/datetime.py: -------------------------------------------------------------------------------- 1 | """For when pip wants to check the date or time. 2 | """ 3 | 4 | from __future__ import absolute_import 5 | 6 | import datetime 7 | 8 | 9 | def today_is_later_than(year, month, day): 10 | # type: (int, int, int) -> bool 11 | today = datetime.date.today() 12 | given = datetime.date(year, month, day) 13 | 14 | return today > given 15 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_internal/utils/entrypoints.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | from pip._internal.cli.main import main 4 | from pip._internal.utils.typing import MYPY_CHECK_RUNNING 5 | 6 | if MYPY_CHECK_RUNNING: 7 | from typing import List, Optional 8 | 9 | 10 | def _wrapper(args=None): 11 | # type: (Optional[List[str]]) -> int 12 | """Central wrapper for all old entrypoints. 13 | 14 | Historically pip has had several entrypoints defined. Because of issues 15 | arising from PATH, sys.path, multiple Pythons, their interactions, and most 16 | of them having a pip installed, users suffer every time an entrypoint gets 17 | moved. 18 | 19 | To alleviate this pain, and provide a mechanism for warning users and 20 | directing them to an appropriate place for help, we now define all of 21 | our old entrypoints as wrappers for the current one. 22 | """ 23 | sys.stderr.write( 24 | "WARNING: pip is being invoked by an old script wrapper. This will " 25 | "fail in a future version of pip.\n" 26 | "Please see https://github.com/pypa/pip/issues/5599 for advice on " 27 | "fixing the underlying issue.\n" 28 | "To avoid this problem you can invoke Python with '-m pip' instead of " 29 | "running pip directly.\n" 30 | ) 31 | return main(args) 32 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_internal/utils/filetypes.py: -------------------------------------------------------------------------------- 1 | """Filetype information. 2 | """ 3 | from pip._internal.utils.misc import splitext 4 | from pip._internal.utils.typing import MYPY_CHECK_RUNNING 5 | 6 | if MYPY_CHECK_RUNNING: 7 | from typing import Tuple 8 | 9 | WHEEL_EXTENSION = '.whl' 10 | BZ2_EXTENSIONS = ('.tar.bz2', '.tbz') # type: Tuple[str, ...] 11 | XZ_EXTENSIONS = ('.tar.xz', '.txz', '.tlz', 12 | '.tar.lz', '.tar.lzma') # type: Tuple[str, ...] 13 | ZIP_EXTENSIONS = ('.zip', WHEEL_EXTENSION) # type: Tuple[str, ...] 14 | TAR_EXTENSIONS = ('.tar.gz', '.tgz', '.tar') # type: Tuple[str, ...] 15 | ARCHIVE_EXTENSIONS = ( 16 | ZIP_EXTENSIONS + BZ2_EXTENSIONS + TAR_EXTENSIONS + XZ_EXTENSIONS 17 | ) 18 | 19 | 20 | def is_archive_file(name): 21 | # type: (str) -> bool 22 | """Return True if `name` is a considered as an archive file.""" 23 | ext = splitext(name)[1].lower() 24 | if ext in ARCHIVE_EXTENSIONS: 25 | return True 26 | return False 27 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_internal/utils/inject_securetransport.py: -------------------------------------------------------------------------------- 1 | """A helper module that injects SecureTransport, on import. 2 | 3 | The import should be done as early as possible, to ensure all requests and 4 | sessions (or whatever) are created after injecting SecureTransport. 5 | 6 | Note that we only do the injection on macOS, when the linked OpenSSL is too 7 | old to handle TLSv1.2. 8 | """ 9 | 10 | import sys 11 | 12 | 13 | def inject_securetransport(): 14 | # type: () -> None 15 | # Only relevant on macOS 16 | if sys.platform != "darwin": 17 | return 18 | 19 | try: 20 | import ssl 21 | except ImportError: 22 | return 23 | 24 | # Checks for OpenSSL 1.0.1 25 | if ssl.OPENSSL_VERSION_NUMBER >= 0x1000100f: 26 | return 27 | 28 | try: 29 | from pip._vendor.urllib3.contrib import securetransport 30 | except (ImportError, OSError): 31 | return 32 | 33 | securetransport.inject_into_urllib3() 34 | 35 | 36 | inject_securetransport() 37 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_internal/vcs/__init__.py: -------------------------------------------------------------------------------- 1 | # Expose a limited set of classes and functions so callers outside of 2 | # the vcs package don't need to import deeper than `pip._internal.vcs`. 3 | # (The test directory and imports protected by MYPY_CHECK_RUNNING may 4 | # still need to import from a vcs sub-package.) 5 | # Import all vcs modules to register each VCS in the VcsSupport object. 6 | import pip._internal.vcs.bazaar 7 | import pip._internal.vcs.git 8 | import pip._internal.vcs.mercurial 9 | import pip._internal.vcs.subversion # noqa: F401 10 | from pip._internal.vcs.versioncontrol import ( # noqa: F401 11 | RemoteNotFoundError, 12 | is_url, 13 | make_vcs_requirement_url, 14 | vcs, 15 | ) 16 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/cachecontrol/__init__.py: -------------------------------------------------------------------------------- 1 | """CacheControl import Interface. 2 | 3 | Make it easy to import from cachecontrol without long namespaces. 4 | """ 5 | __author__ = "Eric Larson" 6 | __email__ = "eric@ionrock.org" 7 | __version__ = "0.12.6" 8 | 9 | from .wrapper import CacheControl 10 | from .adapter import CacheControlAdapter 11 | from .controller import CacheController 12 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/cachecontrol/cache.py: -------------------------------------------------------------------------------- 1 | """ 2 | The cache object API for implementing caches. The default is a thread 3 | safe in-memory dictionary. 4 | """ 5 | from threading import Lock 6 | 7 | 8 | class BaseCache(object): 9 | 10 | def get(self, key): 11 | raise NotImplementedError() 12 | 13 | def set(self, key, value): 14 | raise NotImplementedError() 15 | 16 | def delete(self, key): 17 | raise NotImplementedError() 18 | 19 | def close(self): 20 | pass 21 | 22 | 23 | class DictCache(BaseCache): 24 | 25 | def __init__(self, init_dict=None): 26 | self.lock = Lock() 27 | self.data = init_dict or {} 28 | 29 | def get(self, key): 30 | return self.data.get(key, None) 31 | 32 | def set(self, key, value): 33 | with self.lock: 34 | self.data.update({key: value}) 35 | 36 | def delete(self, key): 37 | with self.lock: 38 | if key in self.data: 39 | self.data.pop(key) 40 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/cachecontrol/caches/__init__.py: -------------------------------------------------------------------------------- 1 | from .file_cache import FileCache # noqa 2 | from .redis_cache import RedisCache # noqa 3 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/cachecontrol/caches/redis_cache.py: -------------------------------------------------------------------------------- 1 | from __future__ import division 2 | 3 | from datetime import datetime 4 | from pip._vendor.cachecontrol.cache import BaseCache 5 | 6 | 7 | class RedisCache(BaseCache): 8 | 9 | def __init__(self, conn): 10 | self.conn = conn 11 | 12 | def get(self, key): 13 | return self.conn.get(key) 14 | 15 | def set(self, key, value, expires=None): 16 | if not expires: 17 | self.conn.set(key, value) 18 | else: 19 | expires = expires - datetime.utcnow() 20 | self.conn.setex(key, int(expires.total_seconds()), value) 21 | 22 | def delete(self, key): 23 | self.conn.delete(key) 24 | 25 | def clear(self): 26 | """Helper for clearing all the keys in a database. Use with 27 | caution!""" 28 | for key in self.conn.keys(): 29 | self.conn.delete(key) 30 | 31 | def close(self): 32 | """Redis uses connection pooling, no need to close the connection.""" 33 | pass 34 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/cachecontrol/compat.py: -------------------------------------------------------------------------------- 1 | try: 2 | from urllib.parse import urljoin 3 | except ImportError: 4 | from urlparse import urljoin 5 | 6 | 7 | try: 8 | import cPickle as pickle 9 | except ImportError: 10 | import pickle 11 | 12 | 13 | # Handle the case where the requests module has been patched to not have 14 | # urllib3 bundled as part of its source. 15 | try: 16 | from pip._vendor.requests.packages.urllib3.response import HTTPResponse 17 | except ImportError: 18 | from pip._vendor.urllib3.response import HTTPResponse 19 | 20 | try: 21 | from pip._vendor.requests.packages.urllib3.util import is_fp_closed 22 | except ImportError: 23 | from pip._vendor.urllib3.util import is_fp_closed 24 | 25 | # Replicate some six behaviour 26 | try: 27 | text_type = unicode 28 | except NameError: 29 | text_type = str 30 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/cachecontrol/wrapper.py: -------------------------------------------------------------------------------- 1 | from .adapter import CacheControlAdapter 2 | from .cache import DictCache 3 | 4 | 5 | def CacheControl( 6 | sess, 7 | cache=None, 8 | cache_etags=True, 9 | serializer=None, 10 | heuristic=None, 11 | controller_class=None, 12 | adapter_class=None, 13 | cacheable_methods=None, 14 | ): 15 | 16 | cache = DictCache() if cache is None else cache 17 | adapter_class = adapter_class or CacheControlAdapter 18 | adapter = adapter_class( 19 | cache, 20 | cache_etags=cache_etags, 21 | serializer=serializer, 22 | heuristic=heuristic, 23 | controller_class=controller_class, 24 | cacheable_methods=cacheable_methods, 25 | ) 26 | sess.mount("http://", adapter) 27 | sess.mount("https://", adapter) 28 | 29 | return sess 30 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/certifi/__init__.py: -------------------------------------------------------------------------------- 1 | from .core import contents, where 2 | 3 | __version__ = "2020.11.08" 4 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/certifi/__main__.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | 3 | from pip._vendor.certifi import contents, where 4 | 5 | parser = argparse.ArgumentParser() 6 | parser.add_argument("-c", "--contents", action="store_true") 7 | args = parser.parse_args() 8 | 9 | if args.contents: 10 | print(contents()) 11 | else: 12 | print(where()) 13 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/chardet/cli/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/chardet/compat.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # Contributor(s): 3 | # Dan Blanchard 4 | # Ian Cordasco 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU Lesser General Public 8 | # License as published by the Free Software Foundation; either 9 | # version 2.1 of the License, or (at your option) any later version. 10 | # 11 | # This library is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | # Lesser General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU Lesser General Public 17 | # License along with this library; if not, write to the Free Software 18 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 19 | # 02110-1301 USA 20 | ######################### END LICENSE BLOCK ######################### 21 | 22 | import sys 23 | 24 | 25 | if sys.version_info < (3, 0): 26 | PY2 = True 27 | PY3 = False 28 | base_str = (str, unicode) 29 | text_type = unicode 30 | else: 31 | PY2 = False 32 | PY3 = True 33 | base_str = (bytes, str) 34 | text_type = str 35 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/chardet/version.py: -------------------------------------------------------------------------------- 1 | """ 2 | This module exists only to simplify retrieving the version number of chardet 3 | from within setup.py and from chardet subpackages. 4 | 5 | :author: Dan Blanchard (dan.blanchard@gmail.com) 6 | """ 7 | 8 | __version__ = "3.0.4" 9 | VERSION = __version__.split('.') 10 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/colorama/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. 2 | from .initialise import init, deinit, reinit, colorama_text 3 | from .ansi import Fore, Back, Style, Cursor 4 | from .ansitowin32 import AnsiToWin32 5 | 6 | __version__ = '0.4.4' 7 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/distlib/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (C) 2012-2019 Vinay Sajip. 4 | # Licensed to the Python Software Foundation under a contributor agreement. 5 | # See LICENSE.txt and CONTRIBUTORS.txt. 6 | # 7 | import logging 8 | 9 | __version__ = '0.3.1' 10 | 11 | class DistlibException(Exception): 12 | pass 13 | 14 | try: 15 | from logging import NullHandler 16 | except ImportError: # pragma: no cover 17 | class NullHandler(logging.Handler): 18 | def handle(self, record): pass 19 | def emit(self, record): pass 20 | def createLock(self): self.lock = None 21 | 22 | logger = logging.getLogger(__name__) 23 | logger.addHandler(NullHandler()) 24 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/distlib/_backport/__init__.py: -------------------------------------------------------------------------------- 1 | """Modules copied from Python 3 standard libraries, for internal use only. 2 | 3 | Individual classes and functions are found in d2._backport.misc. Intended 4 | usage is to always import things missing from 3.1 from that module: the 5 | built-in/stdlib objects will be used if found. 6 | """ 7 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/distlib/_backport/misc.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (C) 2012 The Python Software Foundation. 4 | # See LICENSE.txt and CONTRIBUTORS.txt. 5 | # 6 | """Backports for individual classes and functions.""" 7 | 8 | import os 9 | import sys 10 | 11 | __all__ = ['cache_from_source', 'callable', 'fsencode'] 12 | 13 | 14 | try: 15 | from imp import cache_from_source 16 | except ImportError: 17 | def cache_from_source(py_file, debug=__debug__): 18 | ext = debug and 'c' or 'o' 19 | return py_file + ext 20 | 21 | 22 | try: 23 | callable = callable 24 | except NameError: 25 | from collections import Callable 26 | 27 | def callable(obj): 28 | return isinstance(obj, Callable) 29 | 30 | 31 | try: 32 | fsencode = os.fsencode 33 | except AttributeError: 34 | def fsencode(filename): 35 | if isinstance(filename, bytes): 36 | return filename 37 | elif isinstance(filename, str): 38 | return filename.encode(sys.getfilesystemencoding()) 39 | else: 40 | raise TypeError("expect bytes or str, not %s" % 41 | type(filename).__name__) 42 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/distlib/t32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/pip/pip/_vendor/distlib/t32.exe -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/distlib/t64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/pip/pip/_vendor/distlib/t64.exe -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/distlib/w32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/pip/pip/_vendor/distlib/w32.exe -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/distlib/w64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/pip/pip/_vendor/distlib/w64.exe -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/html5lib/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | HTML parsing library based on the `WHATWG HTML specification 3 | `_. The parser is designed to be compatible with 4 | existing HTML found in the wild and implements well-defined error recovery that 5 | is largely compatible with modern desktop web browsers. 6 | 7 | Example usage:: 8 | 9 | from pip._vendor import html5lib 10 | with open("my_document.html", "rb") as f: 11 | tree = html5lib.parse(f) 12 | 13 | For convenience, this module re-exports the following names: 14 | 15 | * :func:`~.html5parser.parse` 16 | * :func:`~.html5parser.parseFragment` 17 | * :class:`~.html5parser.HTMLParser` 18 | * :func:`~.treebuilders.getTreeBuilder` 19 | * :func:`~.treewalkers.getTreeWalker` 20 | * :func:`~.serializer.serialize` 21 | """ 22 | 23 | from __future__ import absolute_import, division, unicode_literals 24 | 25 | from .html5parser import HTMLParser, parse, parseFragment 26 | from .treebuilders import getTreeBuilder 27 | from .treewalkers import getTreeWalker 28 | from .serializer import serialize 29 | 30 | __all__ = ["HTMLParser", "parse", "parseFragment", "getTreeBuilder", 31 | "getTreeWalker", "serialize"] 32 | 33 | # this has to be at the top level, see how setup.py parses this 34 | #: Distribution version number. 35 | __version__ = "1.1" 36 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/html5lib/_trie/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | from .py import Trie 4 | 5 | __all__ = ["Trie"] 6 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/html5lib/_trie/_base.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | try: 4 | from collections.abc import Mapping 5 | except ImportError: # Python 2.7 6 | from collections import Mapping 7 | 8 | 9 | class Trie(Mapping): 10 | """Abstract base class for tries""" 11 | 12 | def keys(self, prefix=None): 13 | # pylint:disable=arguments-differ 14 | keys = super(Trie, self).keys() 15 | 16 | if prefix is None: 17 | return set(keys) 18 | 19 | return {x for x in keys if x.startswith(prefix)} 20 | 21 | def has_keys_with_prefix(self, prefix): 22 | for key in self.keys(): 23 | if key.startswith(prefix): 24 | return True 25 | 26 | return False 27 | 28 | def longest_prefix(self, prefix): 29 | if prefix in self: 30 | return prefix 31 | 32 | for i in range(1, len(prefix) + 1): 33 | if prefix[:-i] in self: 34 | return prefix[:-i] 35 | 36 | raise KeyError(prefix) 37 | 38 | def longest_prefix_item(self, prefix): 39 | lprefix = self.longest_prefix(prefix) 40 | return (lprefix, self[lprefix]) 41 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/html5lib/filters/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/pip/pip/_vendor/html5lib/filters/__init__.py -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/html5lib/filters/alphabeticalattributes.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | from . import base 4 | 5 | from collections import OrderedDict 6 | 7 | 8 | def _attr_key(attr): 9 | """Return an appropriate key for an attribute for sorting 10 | 11 | Attributes have a namespace that can be either ``None`` or a string. We 12 | can't compare the two because they're different types, so we convert 13 | ``None`` to an empty string first. 14 | 15 | """ 16 | return (attr[0][0] or ''), attr[0][1] 17 | 18 | 19 | class Filter(base.Filter): 20 | """Alphabetizes attributes for elements""" 21 | def __iter__(self): 22 | for token in base.Filter.__iter__(self): 23 | if token["type"] in ("StartTag", "EmptyTag"): 24 | attrs = OrderedDict() 25 | for name, value in sorted(token["data"].items(), 26 | key=_attr_key): 27 | attrs[name] = value 28 | token["data"] = attrs 29 | yield token 30 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/html5lib/filters/base.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | 4 | class Filter(object): 5 | def __init__(self, source): 6 | self.source = source 7 | 8 | def __iter__(self): 9 | return iter(self.source) 10 | 11 | def __getattr__(self, name): 12 | return getattr(self.source, name) 13 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/html5lib/treeadapters/__init__.py: -------------------------------------------------------------------------------- 1 | """Tree adapters let you convert from one tree structure to another 2 | 3 | Example: 4 | 5 | .. code-block:: python 6 | 7 | from pip._vendor import html5lib 8 | from pip._vendor.html5lib.treeadapters import genshi 9 | 10 | doc = 'Hi!' 11 | treebuilder = html5lib.getTreeBuilder('etree') 12 | parser = html5lib.HTMLParser(tree=treebuilder) 13 | tree = parser.parse(doc) 14 | TreeWalker = html5lib.getTreeWalker('etree') 15 | 16 | genshi_tree = genshi.to_genshi(TreeWalker(tree)) 17 | 18 | """ 19 | from __future__ import absolute_import, division, unicode_literals 20 | 21 | from . import sax 22 | 23 | __all__ = ["sax"] 24 | 25 | try: 26 | from . import genshi # noqa 27 | except ImportError: 28 | pass 29 | else: 30 | __all__.append("genshi") 31 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/idna/__init__.py: -------------------------------------------------------------------------------- 1 | from .package_data import __version__ 2 | from .core import * 3 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/idna/compat.py: -------------------------------------------------------------------------------- 1 | from .core import * 2 | from .codec import * 3 | 4 | def ToASCII(label): 5 | return encode(label) 6 | 7 | def ToUnicode(label): 8 | return decode(label) 9 | 10 | def nameprep(s): 11 | raise NotImplementedError("IDNA 2008 does not utilise nameprep protocol") 12 | 13 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/idna/package_data.py: -------------------------------------------------------------------------------- 1 | __version__ = '2.10' 2 | 3 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/msgpack/__init__.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | from ._version import version 3 | from .exceptions import * 4 | from .ext import ExtType, Timestamp 5 | 6 | import os 7 | import sys 8 | 9 | 10 | if os.environ.get("MSGPACK_PUREPYTHON") or sys.version_info[0] == 2: 11 | from .fallback import Packer, unpackb, Unpacker 12 | else: 13 | try: 14 | from ._cmsgpack import Packer, unpackb, Unpacker 15 | except ImportError: 16 | from .fallback import Packer, unpackb, Unpacker 17 | 18 | 19 | def pack(o, stream, **kwargs): 20 | """ 21 | Pack object `o` and write it to `stream` 22 | 23 | See :class:`Packer` for options. 24 | """ 25 | packer = Packer(**kwargs) 26 | stream.write(packer.pack(o)) 27 | 28 | 29 | def packb(o, **kwargs): 30 | """ 31 | Pack object `o` and return packed bytes 32 | 33 | See :class:`Packer` for options. 34 | """ 35 | return Packer(**kwargs).pack(o) 36 | 37 | 38 | def unpack(stream, **kwargs): 39 | """ 40 | Unpack an object from `stream`. 41 | 42 | Raises `ExtraData` when `stream` contains extra bytes. 43 | See :class:`Unpacker` for options. 44 | """ 45 | data = stream.read() 46 | return unpackb(data, **kwargs) 47 | 48 | 49 | # alias for compatibility to simplejson/marshal/pickle. 50 | load = unpack 51 | loads = unpackb 52 | 53 | dump = pack 54 | dumps = packb 55 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/msgpack/_version.py: -------------------------------------------------------------------------------- 1 | version = (1, 0, 0) 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/msgpack/exceptions.py: -------------------------------------------------------------------------------- 1 | class UnpackException(Exception): 2 | """Base class for some exceptions raised while unpacking. 3 | 4 | NOTE: unpack may raise exception other than subclass of 5 | UnpackException. If you want to catch all error, catch 6 | Exception instead. 7 | """ 8 | 9 | 10 | class BufferFull(UnpackException): 11 | pass 12 | 13 | 14 | class OutOfData(UnpackException): 15 | pass 16 | 17 | 18 | class FormatError(ValueError, UnpackException): 19 | """Invalid msgpack format""" 20 | 21 | 22 | class StackError(ValueError, UnpackException): 23 | """Too nested""" 24 | 25 | 26 | # Deprecated. Use ValueError instead 27 | UnpackValueError = ValueError 28 | 29 | 30 | class ExtraData(UnpackValueError): 31 | """ExtraData is raised when there is trailing data. 32 | 33 | This exception is raised while only one-shot (not streaming) 34 | unpack. 35 | """ 36 | 37 | def __init__(self, unpacked, extra): 38 | self.unpacked = unpacked 39 | self.extra = extra 40 | 41 | def __str__(self): 42 | return "unpack(b) received extra data." 43 | 44 | 45 | # Deprecated. Use Exception instead to catch all exception during packing. 46 | PackException = Exception 47 | PackValueError = ValueError 48 | PackOverflowError = OverflowError 49 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/packaging/__about__.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | from __future__ import absolute_import, division, print_function 5 | 6 | __all__ = [ 7 | "__title__", 8 | "__summary__", 9 | "__uri__", 10 | "__version__", 11 | "__author__", 12 | "__email__", 13 | "__license__", 14 | "__copyright__", 15 | ] 16 | 17 | __title__ = "packaging" 18 | __summary__ = "Core utilities for Python packages" 19 | __uri__ = "https://github.com/pypa/packaging" 20 | 21 | __version__ = "20.9" 22 | 23 | __author__ = "Donald Stufft and individual contributors" 24 | __email__ = "donald@stufft.io" 25 | 26 | __license__ = "BSD-2-Clause or Apache-2.0" 27 | __copyright__ = "2014-2019 %s" % __author__ 28 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/packaging/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | from __future__ import absolute_import, division, print_function 5 | 6 | from .__about__ import ( 7 | __author__, 8 | __copyright__, 9 | __email__, 10 | __license__, 11 | __summary__, 12 | __title__, 13 | __uri__, 14 | __version__, 15 | ) 16 | 17 | __all__ = [ 18 | "__title__", 19 | "__summary__", 20 | "__uri__", 21 | "__version__", 22 | "__author__", 23 | "__email__", 24 | "__license__", 25 | "__copyright__", 26 | ] 27 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/packaging/_compat.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | from __future__ import absolute_import, division, print_function 5 | 6 | import sys 7 | 8 | from ._typing import TYPE_CHECKING 9 | 10 | if TYPE_CHECKING: # pragma: no cover 11 | from typing import Any, Dict, Tuple, Type 12 | 13 | 14 | PY2 = sys.version_info[0] == 2 15 | PY3 = sys.version_info[0] == 3 16 | 17 | # flake8: noqa 18 | 19 | if PY3: 20 | string_types = (str,) 21 | else: 22 | string_types = (basestring,) 23 | 24 | 25 | def with_metaclass(meta, *bases): 26 | # type: (Type[Any], Tuple[Type[Any], ...]) -> Any 27 | """ 28 | Create a base class with a metaclass. 29 | """ 30 | # This requires a bit of explanation: the basic idea is to make a dummy 31 | # metaclass for one level of class instantiation that replaces itself with 32 | # the actual metaclass. 33 | class metaclass(meta): # type: ignore 34 | def __new__(cls, name, this_bases, d): 35 | # type: (Type[Any], str, Tuple[Any], Dict[Any, Any]) -> Any 36 | return meta(name, bases, d) 37 | 38 | return type.__new__(metaclass, "temporary_class", (), {}) 39 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/pep517/__init__.py: -------------------------------------------------------------------------------- 1 | """Wrappers to build Python packages using PEP 517 hooks 2 | """ 3 | 4 | __version__ = '0.9.1' 5 | 6 | from .wrappers import * # noqa: F401, F403 7 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/pep517/compat.py: -------------------------------------------------------------------------------- 1 | """Python 2/3 compatibility""" 2 | import json 3 | import sys 4 | 5 | 6 | # Handle reading and writing JSON in UTF-8, on Python 3 and 2. 7 | 8 | if sys.version_info[0] >= 3: 9 | # Python 3 10 | def write_json(obj, path, **kwargs): 11 | with open(path, 'w', encoding='utf-8') as f: 12 | json.dump(obj, f, **kwargs) 13 | 14 | def read_json(path): 15 | with open(path, 'r', encoding='utf-8') as f: 16 | return json.load(f) 17 | 18 | else: 19 | # Python 2 20 | def write_json(obj, path, **kwargs): 21 | with open(path, 'wb') as f: 22 | json.dump(obj, f, encoding='utf-8', **kwargs) 23 | 24 | def read_json(path): 25 | with open(path, 'rb') as f: 26 | return json.load(f) 27 | 28 | 29 | # FileNotFoundError 30 | 31 | try: 32 | FileNotFoundError = FileNotFoundError 33 | except NameError: 34 | FileNotFoundError = IOError 35 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/pep517/dirtools.py: -------------------------------------------------------------------------------- 1 | import os 2 | import io 3 | import contextlib 4 | import tempfile 5 | import shutil 6 | import errno 7 | import zipfile 8 | 9 | 10 | @contextlib.contextmanager 11 | def tempdir(): 12 | """Create a temporary directory in a context manager.""" 13 | td = tempfile.mkdtemp() 14 | try: 15 | yield td 16 | finally: 17 | shutil.rmtree(td) 18 | 19 | 20 | def mkdir_p(*args, **kwargs): 21 | """Like `mkdir`, but does not raise an exception if the 22 | directory already exists. 23 | """ 24 | try: 25 | return os.mkdir(*args, **kwargs) 26 | except OSError as exc: 27 | if exc.errno != errno.EEXIST: 28 | raise 29 | 30 | 31 | def dir_to_zipfile(root): 32 | """Construct an in-memory zip file for a directory.""" 33 | buffer = io.BytesIO() 34 | zip_file = zipfile.ZipFile(buffer, 'w') 35 | for root, dirs, files in os.walk(root): 36 | for path in dirs: 37 | fs_path = os.path.join(root, path) 38 | rel_path = os.path.relpath(fs_path, root) 39 | zip_file.writestr(rel_path + '/', '') 40 | for path in files: 41 | fs_path = os.path.join(root, path) 42 | rel_path = os.path.relpath(fs_path, root) 43 | zip_file.write(fs_path, rel_path) 44 | return zip_file 45 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/pkg_resources/py31compat.py: -------------------------------------------------------------------------------- 1 | import os 2 | import errno 3 | import sys 4 | 5 | from pip._vendor import six 6 | 7 | 8 | def _makedirs_31(path, exist_ok=False): 9 | try: 10 | os.makedirs(path) 11 | except OSError as exc: 12 | if not exist_ok or exc.errno != errno.EEXIST: 13 | raise 14 | 15 | 16 | # rely on compatibility behavior until mode considerations 17 | # and exists_ok considerations are disentangled. 18 | # See https://github.com/pypa/setuptools/pull/1083#issuecomment-315168663 19 | needs_makedirs = ( 20 | six.PY2 or 21 | (3, 4) <= sys.version_info < (3, 4, 1) 22 | ) 23 | makedirs = _makedirs_31 if needs_makedirs else os.makedirs 24 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/requests/__version__.py: -------------------------------------------------------------------------------- 1 | # .-. .-. .-. . . .-. .-. .-. .-. 2 | # |( |- |.| | | |- `-. | `-. 3 | # ' ' `-' `-`.`-' `-' `-' ' `-' 4 | 5 | __title__ = 'requests' 6 | __description__ = 'Python HTTP for Humans.' 7 | __url__ = 'https://requests.readthedocs.io' 8 | __version__ = '2.25.0' 9 | __build__ = 0x022500 10 | __author__ = 'Kenneth Reitz' 11 | __author_email__ = 'me@kennethreitz.org' 12 | __license__ = 'Apache 2.0' 13 | __copyright__ = 'Copyright 2020 Kenneth Reitz' 14 | __cake__ = u'\u2728 \U0001f370 \u2728' 15 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/requests/_internal_utils.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | requests._internal_utils 5 | ~~~~~~~~~~~~~~ 6 | 7 | Provides utility functions that are consumed internally by Requests 8 | which depend on extremely few external helpers (such as compat) 9 | """ 10 | 11 | from .compat import is_py2, builtin_str, str 12 | 13 | 14 | def to_native_string(string, encoding='ascii'): 15 | """Given a string object, regardless of type, returns a representation of 16 | that string in the native string type, encoding and decoding where 17 | necessary. This assumes ASCII unless told otherwise. 18 | """ 19 | if isinstance(string, builtin_str): 20 | out = string 21 | else: 22 | if is_py2: 23 | out = string.encode(encoding) 24 | else: 25 | out = string.decode(encoding) 26 | 27 | return out 28 | 29 | 30 | def unicode_is_ascii(u_string): 31 | """Determine if unicode string only contains ASCII characters. 32 | 33 | :param str u_string: unicode string to check. Must be unicode 34 | and not Python 2 `str`. 35 | :rtype: bool 36 | """ 37 | assert isinstance(u_string, str) 38 | try: 39 | u_string.encode('ascii') 40 | return True 41 | except UnicodeEncodeError: 42 | return False 43 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/requests/certs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ 5 | requests.certs 6 | ~~~~~~~~~~~~~~ 7 | 8 | This module returns the preferred default CA certificate bundle. There is 9 | only one — the one from the certifi package. 10 | 11 | If you are packaging Requests, e.g., for a Linux distribution or a managed 12 | environment, you can change the definition of where() to return a separately 13 | packaged CA bundle. 14 | """ 15 | from pip._vendor.certifi import where 16 | 17 | if __name__ == '__main__': 18 | print(where()) 19 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/requests/hooks.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | requests.hooks 5 | ~~~~~~~~~~~~~~ 6 | 7 | This module provides the capabilities for the Requests hooks system. 8 | 9 | Available hooks: 10 | 11 | ``response``: 12 | The response generated from a Request. 13 | """ 14 | HOOKS = ['response'] 15 | 16 | 17 | def default_hooks(): 18 | return {event: [] for event in HOOKS} 19 | 20 | # TODO: response is the only one 21 | 22 | 23 | def dispatch_hook(key, hooks, hook_data, **kwargs): 24 | """Dispatches a hook dictionary on a given piece of data.""" 25 | hooks = hooks or {} 26 | hooks = hooks.get(key) 27 | if hooks: 28 | if hasattr(hooks, '__call__'): 29 | hooks = [hooks] 30 | for hook in hooks: 31 | _hook_data = hook(hook_data, **kwargs) 32 | if _hook_data is not None: 33 | hook_data = _hook_data 34 | return hook_data 35 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/requests/packages.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | # This code exists for backwards compatibility reasons. 4 | # I don't like it either. Just look the other way. :) 5 | 6 | for package in ('urllib3', 'idna', 'chardet'): 7 | vendored_package = "pip._vendor." + package 8 | locals()[package] = __import__(vendored_package) 9 | # This traversal is apparently necessary such that the identities are 10 | # preserved (requests.packages.urllib3.* is urllib3.*) 11 | for mod in list(sys.modules): 12 | if mod == vendored_package or mod.startswith(vendored_package + '.'): 13 | unprefixed_mod = mod[len("pip._vendor."):] 14 | sys.modules['pip._vendor.requests.packages.' + unprefixed_mod] = sys.modules[mod] 15 | 16 | # Kinda cool, though, right? 17 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/resolvelib/__init__.py: -------------------------------------------------------------------------------- 1 | __all__ = [ 2 | "__version__", 3 | "AbstractProvider", 4 | "AbstractResolver", 5 | "BaseReporter", 6 | "InconsistentCandidate", 7 | "Resolver", 8 | "RequirementsConflicted", 9 | "ResolutionError", 10 | "ResolutionImpossible", 11 | "ResolutionTooDeep", 12 | ] 13 | 14 | __version__ = "0.5.4" 15 | 16 | 17 | from .providers import AbstractProvider, AbstractResolver 18 | from .reporters import BaseReporter 19 | from .resolvers import ( 20 | InconsistentCandidate, 21 | RequirementsConflicted, 22 | Resolver, 23 | ResolutionError, 24 | ResolutionImpossible, 25 | ResolutionTooDeep, 26 | ) 27 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/resolvelib/compat/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/pip/pip/_vendor/resolvelib/compat/__init__.py -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/resolvelib/compat/collections_abc.py: -------------------------------------------------------------------------------- 1 | __all__ = ["Sequence"] 2 | 3 | try: 4 | from collections.abc import Sequence 5 | except ImportError: 6 | from collections import Sequence 7 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/toml/__init__.py: -------------------------------------------------------------------------------- 1 | """Python module which parses and emits TOML. 2 | 3 | Released under the MIT license. 4 | """ 5 | 6 | from pip._vendor.toml import encoder 7 | from pip._vendor.toml import decoder 8 | 9 | __version__ = "0.10.2" 10 | _spec_ = "0.5.0" 11 | 12 | load = decoder.load 13 | loads = decoder.loads 14 | TomlDecoder = decoder.TomlDecoder 15 | TomlDecodeError = decoder.TomlDecodeError 16 | TomlPreserveCommentDecoder = decoder.TomlPreserveCommentDecoder 17 | 18 | dump = encoder.dump 19 | dumps = encoder.dumps 20 | TomlEncoder = encoder.TomlEncoder 21 | TomlArraySeparatorEncoder = encoder.TomlArraySeparatorEncoder 22 | TomlPreserveInlineDictEncoder = encoder.TomlPreserveInlineDictEncoder 23 | TomlNumpyEncoder = encoder.TomlNumpyEncoder 24 | TomlPreserveCommentEncoder = encoder.TomlPreserveCommentEncoder 25 | TomlPathlibEncoder = encoder.TomlPathlibEncoder 26 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/toml/ordered.py: -------------------------------------------------------------------------------- 1 | from collections import OrderedDict 2 | from pip._vendor.toml import TomlEncoder 3 | from pip._vendor.toml import TomlDecoder 4 | 5 | 6 | class TomlOrderedDecoder(TomlDecoder): 7 | 8 | def __init__(self): 9 | super(self.__class__, self).__init__(_dict=OrderedDict) 10 | 11 | 12 | class TomlOrderedEncoder(TomlEncoder): 13 | 14 | def __init__(self): 15 | super(self.__class__, self).__init__(_dict=OrderedDict) 16 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/toml/tz.py: -------------------------------------------------------------------------------- 1 | from datetime import tzinfo, timedelta 2 | 3 | 4 | class TomlTz(tzinfo): 5 | def __init__(self, toml_offset): 6 | if toml_offset == "Z": 7 | self._raw_offset = "+00:00" 8 | else: 9 | self._raw_offset = toml_offset 10 | self._sign = -1 if self._raw_offset[0] == '-' else 1 11 | self._hours = int(self._raw_offset[1:3]) 12 | self._minutes = int(self._raw_offset[4:6]) 13 | 14 | def __deepcopy__(self, memo): 15 | return self.__class__(self._raw_offset) 16 | 17 | def tzname(self, dt): 18 | return "UTC" + self._raw_offset 19 | 20 | def utcoffset(self, dt): 21 | return self._sign * timedelta(hours=self._hours, minutes=self._minutes) 22 | 23 | def dst(self, dt): 24 | return timedelta(0) 25 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/urllib3/_version.py: -------------------------------------------------------------------------------- 1 | # This file is protected via CODEOWNERS 2 | __version__ = "1.26.2" 3 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/urllib3/contrib/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/pip/pip/_vendor/urllib3/contrib/__init__.py -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/urllib3/contrib/_appengine_environ.py: -------------------------------------------------------------------------------- 1 | """ 2 | This module provides means to detect the App Engine environment. 3 | """ 4 | 5 | import os 6 | 7 | 8 | def is_appengine(): 9 | return is_local_appengine() or is_prod_appengine() 10 | 11 | 12 | def is_appengine_sandbox(): 13 | """Reports if the app is running in the first generation sandbox. 14 | 15 | The second generation runtimes are technically still in a sandbox, but it 16 | is much less restrictive, so generally you shouldn't need to check for it. 17 | see https://cloud.google.com/appengine/docs/standard/runtimes 18 | """ 19 | return is_appengine() and os.environ["APPENGINE_RUNTIME"] == "python27" 20 | 21 | 22 | def is_local_appengine(): 23 | return "APPENGINE_RUNTIME" in os.environ and os.environ.get( 24 | "SERVER_SOFTWARE", "" 25 | ).startswith("Development/") 26 | 27 | 28 | def is_prod_appengine(): 29 | return "APPENGINE_RUNTIME" in os.environ and os.environ.get( 30 | "SERVER_SOFTWARE", "" 31 | ).startswith("Google App Engine/") 32 | 33 | 34 | def is_prod_appengine_mvms(): 35 | """Deprecated.""" 36 | return False 37 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/urllib3/contrib/_securetransport/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/pip/pip/_vendor/urllib3/contrib/_securetransport/__init__.py -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/urllib3/packages/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from . import ssl_match_hostname 4 | 5 | __all__ = ("ssl_match_hostname",) 6 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/urllib3/packages/backports/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/pip/pip/_vendor/urllib3/packages/backports/__init__.py -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/urllib3/packages/ssl_match_hostname/__init__.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | try: 4 | # Our match_hostname function is the same as 3.5's, so we only want to 5 | # import the match_hostname function if it's at least that good. 6 | if sys.version_info < (3, 5): 7 | raise ImportError("Fallback to vendored code") 8 | 9 | from ssl import CertificateError, match_hostname 10 | except ImportError: 11 | try: 12 | # Backport of the function from a pypi module 13 | from backports.ssl_match_hostname import ( # type: ignore 14 | CertificateError, 15 | match_hostname, 16 | ) 17 | except ImportError: 18 | # Our vendored copy 19 | from ._implementation import CertificateError, match_hostname # type: ignore 20 | 21 | # Not needed, but documenting what we provide. 22 | __all__ = ("CertificateError", "match_hostname") 23 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/urllib3/util/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | # For backwards compatibility, provide imports that used to be here. 4 | from .connection import is_connection_dropped 5 | from .request import SKIP_HEADER, SKIPPABLE_HEADERS, make_headers 6 | from .response import is_fp_closed 7 | from .retry import Retry 8 | from .ssl_ import ( 9 | ALPN_PROTOCOLS, 10 | HAS_SNI, 11 | IS_PYOPENSSL, 12 | IS_SECURETRANSPORT, 13 | PROTOCOL_TLS, 14 | SSLContext, 15 | assert_fingerprint, 16 | resolve_cert_reqs, 17 | resolve_ssl_version, 18 | ssl_wrap_socket, 19 | ) 20 | from .timeout import Timeout, current_time 21 | from .url import Url, get_host, parse_url, split_first 22 | from .wait import wait_for_read, wait_for_write 23 | 24 | __all__ = ( 25 | "HAS_SNI", 26 | "IS_PYOPENSSL", 27 | "IS_SECURETRANSPORT", 28 | "SSLContext", 29 | "PROTOCOL_TLS", 30 | "ALPN_PROTOCOLS", 31 | "Retry", 32 | "Timeout", 33 | "Url", 34 | "assert_fingerprint", 35 | "current_time", 36 | "is_connection_dropped", 37 | "is_fp_closed", 38 | "get_host", 39 | "parse_url", 40 | "make_headers", 41 | "resolve_cert_reqs", 42 | "resolve_ssl_version", 43 | "split_first", 44 | "ssl_wrap_socket", 45 | "wait_for_read", 46 | "wait_for_write", 47 | "SKIP_HEADER", 48 | "SKIPPABLE_HEADERS", 49 | ) 50 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/urllib3/util/queue.py: -------------------------------------------------------------------------------- 1 | import collections 2 | 3 | from ..packages import six 4 | from ..packages.six.moves import queue 5 | 6 | if six.PY2: 7 | # Queue is imported for side effects on MS Windows. See issue #229. 8 | import Queue as _unused_module_Queue # noqa: F401 9 | 10 | 11 | class LifoQueue(queue.Queue): 12 | def _init(self, _): 13 | self.queue = collections.deque() 14 | 15 | def _qsize(self, len=len): 16 | return len(self.queue) 17 | 18 | def _put(self, item): 19 | self.queue.append(item) 20 | 21 | def _get(self): 22 | return self.queue.pop() 23 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/pip/pip/_vendor/vendor.txt: -------------------------------------------------------------------------------- 1 | appdirs==1.4.4 2 | CacheControl==0.12.6 3 | colorama==0.4.4 4 | contextlib2==0.6.0.post1 5 | distlib==0.3.1 6 | distro==1.5.0 7 | html5lib==1.1 8 | ipaddress==1.0.23 # Only needed on 2.6 and 2.7 9 | msgpack==1.0.0 10 | packaging==20.9 11 | pep517==0.9.1 12 | progress==1.5 13 | pyparsing==2.4.7 14 | requests==2.25.0 15 | certifi==2020.11.08 16 | chardet==3.0.4 17 | idna==2.10 18 | urllib3==1.26.2 19 | resolvelib==0.5.4 20 | retrying==1.3.3 21 | setuptools==44.0.0 22 | six==1.15.0 23 | toml==0.10.2 24 | webencodings==0.5.1 25 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/.layout.json: -------------------------------------------------------------------------------- 1 | {"fingerprint": "3ed0a88e9187417528887dc52d09fcfc8f0166098f63499834ddef53f9e46890", "record_relpath": "setuptools-44.0.0+3acb925dd708430aeaf197ea53ac8a752f7c1863.dist-info/RECORD", "root_is_purelib": true, "stash_dir": ".prefix"} -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/.prefix/bin/easy_install: -------------------------------------------------------------------------------- 1 | #!python 2 | # -*- coding: utf-8 -*- 3 | import importlib 4 | import sys 5 | 6 | entry_point = importlib.import_module('setuptools.command.easy_install') 7 | for attr in ('main',): 8 | entry_point = getattr(entry_point, attr) 9 | 10 | if __name__ == "__main__": 11 | sys.exit(entry_point()) 12 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/.prefix/bin/easy_install-3.9: -------------------------------------------------------------------------------- 1 | #!python 2 | # -*- coding: utf-8 -*- 3 | import importlib 4 | import sys 5 | 6 | entry_point = importlib.import_module('setuptools.command.easy_install') 7 | for attr in ('main',): 8 | entry_point = getattr(entry_point, attr) 9 | 10 | if __name__ == "__main__": 11 | sys.exit(entry_point()) 12 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/setuptools/__init__.py -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/easy_install.py: -------------------------------------------------------------------------------- 1 | """Run the EasyInstall command""" 2 | 3 | if __name__ == '__main__': 4 | if "setuptools" in __import__("os").environ.get("__PEX_UNVENDORED__", ""): 5 | from setuptools.command.easy_install import main # vendor:skip 6 | else: 7 | from pex.third_party.setuptools.command.easy_install import main 8 | 9 | main() 10 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/pkg_resources/_vendor/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/setuptools/pkg_resources/_vendor/__init__.py -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/pkg_resources/_vendor/packaging/__about__.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | from __future__ import absolute_import, division, print_function 5 | 6 | __all__ = [ 7 | "__title__", "__summary__", "__uri__", "__version__", "__author__", 8 | "__email__", "__license__", "__copyright__", 9 | ] 10 | 11 | __title__ = "packaging" 12 | __summary__ = "Core utilities for Python packages" 13 | __uri__ = "https://github.com/pypa/packaging" 14 | 15 | __version__ = "16.8" 16 | 17 | __author__ = "Donald Stufft and individual contributors" 18 | __email__ = "donald@stufft.io" 19 | 20 | __license__ = "BSD or Apache License, Version 2.0" 21 | __copyright__ = "Copyright 2014-2016 %s" % __author__ 22 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/pkg_resources/_vendor/packaging/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | from __future__ import absolute_import, division, print_function 5 | 6 | from .__about__ import ( 7 | __author__, __copyright__, __email__, __license__, __summary__, __title__, 8 | __uri__, __version__ 9 | ) 10 | 11 | __all__ = [ 12 | "__title__", "__summary__", "__uri__", "__version__", "__author__", 13 | "__email__", "__license__", "__copyright__", 14 | ] 15 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/pkg_resources/_vendor/packaging/_compat.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | from __future__ import absolute_import, division, print_function 5 | 6 | import sys 7 | 8 | 9 | PY2 = sys.version_info[0] == 2 10 | PY3 = sys.version_info[0] == 3 11 | 12 | # flake8: noqa 13 | 14 | if PY3: 15 | string_types = str, 16 | else: 17 | string_types = basestring, 18 | 19 | 20 | def with_metaclass(meta, *bases): 21 | """ 22 | Create a base class with a metaclass. 23 | """ 24 | # This requires a bit of explanation: the basic idea is to make a dummy 25 | # metaclass for one level of class instantiation that replaces itself with 26 | # the actual metaclass. 27 | class metaclass(meta): 28 | def __new__(cls, name, this_bases, d): 29 | return meta(name, bases, d) 30 | return type.__new__(metaclass, 'temporary_class', (), {}) 31 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/pkg_resources/_vendor/packaging/utils.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | from __future__ import absolute_import, division, print_function 5 | 6 | import re 7 | 8 | 9 | _canonicalize_regex = re.compile(r"[-_.]+") 10 | 11 | 12 | def canonicalize_name(name): 13 | # This is taken from PEP 503. 14 | return _canonicalize_regex.sub("-", name).lower() 15 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/pkg_resources/py31compat.py: -------------------------------------------------------------------------------- 1 | import os 2 | import errno 3 | import sys 4 | 5 | from .extern import six 6 | 7 | 8 | def _makedirs_31(path, exist_ok=False): 9 | try: 10 | os.makedirs(path) 11 | except OSError as exc: 12 | if not exist_ok or exc.errno != errno.EEXIST: 13 | raise 14 | 15 | 16 | # rely on compatibility behavior until mode considerations 17 | # and exists_ok considerations are disentangled. 18 | # See https://github.com/pypa/setuptools/pull/1083#issuecomment-315168663 19 | needs_makedirs = ( 20 | six.PY2 or 21 | (3, 4) <= sys.version_info < (3, 4, 1) 22 | ) 23 | makedirs = _makedirs_31 if needs_makedirs else os.makedirs 24 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools-44.0.0+3acb925dd708430aeaf197ea53ac8a752f7c1863.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pex 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools-44.0.0+3acb925dd708430aeaf197ea53ac8a752f7c1863.dist-info/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2016 Jason R Coombs 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do 8 | so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools-44.0.0+3acb925dd708430aeaf197ea53ac8a752f7c1863.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.35.1) 3 | Root-Is-Purelib: true 4 | Tag: py2-none-any 5 | Tag: py3-none-any 6 | 7 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools-44.0.0+3acb925dd708430aeaf197ea53ac8a752f7c1863.dist-info/dependency_links.txt: -------------------------------------------------------------------------------- 1 | https://files.pythonhosted.org/packages/source/c/certifi/certifi-2016.9.26.tar.gz#md5=baa81e951a29958563689d868ef1064d 2 | https://files.pythonhosted.org/packages/source/w/wincertstore/wincertstore-0.2.zip#md5=ae728f2f007185648d0c7a8679b361e2 3 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools-44.0.0+3acb925dd708430aeaf197ea53ac8a752f7c1863.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | easy_install 2 | pkg_resources 3 | setuptools 4 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools-44.0.0+3acb925dd708430aeaf197ea53ac8a752f7c1863.dist-info/zip-safe: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools/_deprecation_warning.py: -------------------------------------------------------------------------------- 1 | class SetuptoolsDeprecationWarning(Warning): 2 | """ 3 | Base class for warning deprecations in ``setuptools`` 4 | 5 | This class is not derived from ``DeprecationWarning``, and as such is 6 | visible by default. 7 | """ 8 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools/_vendor/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/setuptools/setuptools/_vendor/__init__.py -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools/_vendor/packaging/__about__.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | from __future__ import absolute_import, division, print_function 5 | 6 | __all__ = [ 7 | "__title__", 8 | "__summary__", 9 | "__uri__", 10 | "__version__", 11 | "__author__", 12 | "__email__", 13 | "__license__", 14 | "__copyright__", 15 | ] 16 | 17 | __title__ = "packaging" 18 | __summary__ = "Core utilities for Python packages" 19 | __uri__ = "https://github.com/pypa/packaging" 20 | 21 | __version__ = "19.2" 22 | 23 | __author__ = "Donald Stufft and individual contributors" 24 | __email__ = "donald@stufft.io" 25 | 26 | __license__ = "BSD or Apache License, Version 2.0" 27 | __copyright__ = "Copyright 2014-2019 %s" % __author__ 28 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools/_vendor/packaging/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | from __future__ import absolute_import, division, print_function 5 | 6 | from .__about__ import ( 7 | __author__, 8 | __copyright__, 9 | __email__, 10 | __license__, 11 | __summary__, 12 | __title__, 13 | __uri__, 14 | __version__, 15 | ) 16 | 17 | __all__ = [ 18 | "__title__", 19 | "__summary__", 20 | "__uri__", 21 | "__version__", 22 | "__author__", 23 | "__email__", 24 | "__license__", 25 | "__copyright__", 26 | ] 27 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools/_vendor/packaging/_compat.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | from __future__ import absolute_import, division, print_function 5 | 6 | import sys 7 | 8 | 9 | PY2 = sys.version_info[0] == 2 10 | PY3 = sys.version_info[0] == 3 11 | 12 | # flake8: noqa 13 | 14 | if PY3: 15 | string_types = (str,) 16 | else: 17 | string_types = (basestring,) 18 | 19 | 20 | def with_metaclass(meta, *bases): 21 | """ 22 | Create a base class with a metaclass. 23 | """ 24 | # This requires a bit of explanation: the basic idea is to make a dummy 25 | # metaclass for one level of class instantiation that replaces itself with 26 | # the actual metaclass. 27 | class metaclass(meta): 28 | def __new__(cls, name, this_bases, d): 29 | return meta(name, bases, d) 30 | 31 | return type.__new__(metaclass, "temporary_class", (), {}) 32 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools/cli-32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/setuptools/setuptools/cli-32.exe -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools/cli-64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/setuptools/setuptools/cli-64.exe -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools/cli.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/setuptools/setuptools/cli.exe -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools/command/__init__.py: -------------------------------------------------------------------------------- 1 | __all__ = [ 2 | 'alias', 'bdist_egg', 'bdist_rpm', 'build_ext', 'build_py', 'develop', 3 | 'easy_install', 'egg_info', 'install', 'install_lib', 'rotate', 'saveopts', 4 | 'sdist', 'setopt', 'test', 'install_egg_info', 'install_scripts', 5 | 'bdist_wininst', 'upload_docs', 'build_clib', 'dist_info', 6 | ] 7 | 8 | from distutils.command.bdist import bdist 9 | import sys 10 | 11 | if "setuptools" in __import__("os").environ.get("__PEX_UNVENDORED__", ""): 12 | from setuptools.command import install_scripts # vendor:skip 13 | else: 14 | from pex.third_party.setuptools.command import install_scripts 15 | 16 | 17 | if 'egg' not in bdist.format_commands: 18 | bdist.format_command['egg'] = ('bdist_egg', "Python .egg file") 19 | bdist.format_commands.append('egg') 20 | 21 | del bdist, sys 22 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools/command/bdist_wininst.py: -------------------------------------------------------------------------------- 1 | import distutils.command.bdist_wininst as orig 2 | 3 | 4 | class bdist_wininst(orig.bdist_wininst): 5 | def reinitialize_command(self, command, reinit_subcommands=0): 6 | """ 7 | Supplement reinitialize_command to work around 8 | http://bugs.python.org/issue20819 9 | """ 10 | cmd = self.distribution.reinitialize_command( 11 | command, reinit_subcommands) 12 | if command in ('install', 'install_lib'): 13 | cmd.install_lib = None 14 | return cmd 15 | 16 | def run(self): 17 | self._is_running = True 18 | try: 19 | orig.bdist_wininst.run(self) 20 | finally: 21 | self._is_running = False 22 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools/command/dist_info.py: -------------------------------------------------------------------------------- 1 | """ 2 | Create a dist_info directory 3 | As defined in the wheel specification 4 | """ 5 | 6 | import os 7 | 8 | from distutils.core import Command 9 | from distutils import log 10 | 11 | 12 | class dist_info(Command): 13 | 14 | description = 'create a .dist-info directory' 15 | 16 | user_options = [ 17 | ('egg-base=', 'e', "directory containing .egg-info directories" 18 | " (default: top of the source tree)"), 19 | ] 20 | 21 | def initialize_options(self): 22 | self.egg_base = None 23 | 24 | def finalize_options(self): 25 | pass 26 | 27 | def run(self): 28 | egg_info = self.get_finalized_command('egg_info') 29 | egg_info.egg_base = self.egg_base 30 | egg_info.finalize_options() 31 | egg_info.run() 32 | dist_info_dir = egg_info.egg_info[:-len('.egg-info')] + '.dist-info' 33 | log.info("creating '{}'".format(os.path.abspath(dist_info_dir))) 34 | 35 | bdist_wheel = self.get_finalized_command('bdist_wheel') 36 | bdist_wheel.egg2dist(egg_info.egg_info, dist_info_dir) 37 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools/command/launcher manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools/command/register.py: -------------------------------------------------------------------------------- 1 | from distutils import log 2 | import distutils.command.register as orig 3 | 4 | if "setuptools" in __import__("os").environ.get("__PEX_UNVENDORED__", ""): 5 | from setuptools.errors import RemovedCommandError # vendor:skip 6 | else: 7 | from pex.third_party.setuptools.errors import RemovedCommandError 8 | 9 | 10 | 11 | class register(orig.register): 12 | """Formerly used to register packages on PyPI.""" 13 | 14 | def run(self): 15 | msg = ( 16 | "The register command has been removed, use twine to upload " 17 | + "instead (https://pypi.org/p/twine)" 18 | ) 19 | 20 | self.announce("ERROR: " + msg, log.ERROR) 21 | 22 | raise RemovedCommandError(msg) 23 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools/command/saveopts.py: -------------------------------------------------------------------------------- 1 | if "setuptools" in __import__("os").environ.get("__PEX_UNVENDORED__", ""): 2 | from setuptools.command.setopt import edit_config, option_base # vendor:skip 3 | else: 4 | from pex.third_party.setuptools.command.setopt import edit_config, option_base 5 | 6 | 7 | 8 | class saveopts(option_base): 9 | """Save command-line options to a file""" 10 | 11 | description = "save supplied options to setup.cfg or other config file" 12 | 13 | def run(self): 14 | dist = self.distribution 15 | settings = {} 16 | 17 | for cmd in dist.command_options: 18 | 19 | if cmd == 'saveopts': 20 | continue # don't save our own options! 21 | 22 | for opt, (src, val) in dist.get_option_dict(cmd).items(): 23 | if src == "command line": 24 | settings.setdefault(cmd, {})[opt] = val 25 | 26 | edit_config(self.filename, settings, self.dry_run) 27 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools/command/upload.py: -------------------------------------------------------------------------------- 1 | from distutils import log 2 | from distutils.command import upload as orig 3 | 4 | if "setuptools" in __import__("os").environ.get("__PEX_UNVENDORED__", ""): 5 | from setuptools.errors import RemovedCommandError # vendor:skip 6 | else: 7 | from pex.third_party.setuptools.errors import RemovedCommandError 8 | 9 | 10 | 11 | class upload(orig.upload): 12 | """Formerly used to upload packages to PyPI.""" 13 | 14 | def run(self): 15 | msg = ( 16 | "The upload command has been removed, use twine to upload " 17 | + "instead (https://pypi.org/p/twine)" 18 | ) 19 | 20 | self.announce("ERROR: " + msg, log.ERROR) 21 | raise RemovedCommandError(msg) 22 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools/dep_util.py: -------------------------------------------------------------------------------- 1 | from distutils.dep_util import newer_group 2 | 3 | # yes, this is was almost entirely copy-pasted from 4 | # 'newer_pairwise()', this is just another convenience 5 | # function. 6 | def newer_pairwise_group(sources_groups, targets): 7 | """Walk both arguments in parallel, testing if each source group is newer 8 | than its corresponding target. Returns a pair of lists (sources_groups, 9 | targets) where sources is newer than target, according to the semantics 10 | of 'newer_group()'. 11 | """ 12 | if len(sources_groups) != len(targets): 13 | raise ValueError("'sources_group' and 'targets' must be the same length") 14 | 15 | # build a pair of lists (sources_groups, targets) where source is newer 16 | n_sources = [] 17 | n_targets = [] 18 | for i in range(len(sources_groups)): 19 | if newer_group(sources_groups[i], targets[i]): 20 | n_sources.append(sources_groups[i]) 21 | n_targets.append(targets[i]) 22 | 23 | return n_sources, n_targets 24 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools/errors.py: -------------------------------------------------------------------------------- 1 | """setuptools.errors 2 | 3 | Provides exceptions used by setuptools modules. 4 | """ 5 | 6 | from distutils.errors import DistutilsError 7 | 8 | 9 | class RemovedCommandError(DistutilsError, RuntimeError): 10 | """Error used for commands that have been removed in setuptools. 11 | 12 | Since ``setuptools`` is built on ``distutils``, simply removing a command 13 | from ``setuptools`` will make the behavior fall back to ``distutils``; this 14 | error is raised if a command exists in ``distutils`` but has been actively 15 | removed in ``setuptools``. 16 | """ 17 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools/gui-32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/setuptools/setuptools/gui-32.exe -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools/gui-64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/setuptools/setuptools/gui-64.exe -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools/gui.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/setuptools/setuptools/gui.exe -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools/launch.py: -------------------------------------------------------------------------------- 1 | """ 2 | Launch the Python script on the command line after 3 | setuptools is bootstrapped via import. 4 | """ 5 | 6 | # Note that setuptools gets imported implicitly by the 7 | # invocation of this script using python -m setuptools.launch 8 | 9 | import tokenize 10 | import sys 11 | 12 | 13 | def run(): 14 | """ 15 | Run the script in sys.argv[1] as if it had 16 | been invoked naturally. 17 | """ 18 | __builtins__ 19 | script_name = sys.argv[1] 20 | namespace = dict( 21 | __file__=script_name, 22 | __name__='__main__', 23 | __doc__=None, 24 | ) 25 | sys.argv[:] = sys.argv[1:] 26 | 27 | open_ = getattr(tokenize, 'open', open) 28 | script = open_(script_name).read() 29 | norm_script = script.replace('\\r\\n', '\\n') 30 | code = compile(norm_script, script_name, 'exec') 31 | exec(code, namespace) 32 | 33 | 34 | if __name__ == '__main__': 35 | run() 36 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools/py31compat.py: -------------------------------------------------------------------------------- 1 | __all__ = [] 2 | 3 | __metaclass__ = type 4 | 5 | 6 | try: 7 | # Python >=3.2 8 | from tempfile import TemporaryDirectory 9 | except ImportError: 10 | import shutil 11 | import tempfile 12 | 13 | class TemporaryDirectory: 14 | """ 15 | Very simple temporary directory context manager. 16 | Will try to delete afterward, but will also ignore OS and similar 17 | errors on deletion. 18 | """ 19 | 20 | def __init__(self, **kwargs): 21 | self.name = None # Handle mkdtemp raising an exception 22 | self.name = tempfile.mkdtemp(**kwargs) 23 | 24 | def __enter__(self): 25 | return self.name 26 | 27 | def __exit__(self, exctype, excvalue, exctrace): 28 | try: 29 | shutil.rmtree(self.name, True) 30 | except OSError: # removal errors are not the only possible 31 | pass 32 | self.name = None 33 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools/py34compat.py: -------------------------------------------------------------------------------- 1 | import importlib 2 | 3 | try: 4 | import importlib.util 5 | except ImportError: 6 | pass 7 | 8 | 9 | try: 10 | module_from_spec = importlib.util.module_from_spec 11 | except AttributeError: 12 | def module_from_spec(spec): 13 | return spec.loader.load_module(spec.name) 14 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools/script (dev).tmpl: -------------------------------------------------------------------------------- 1 | # EASY-INSTALL-DEV-SCRIPT: %(spec)r,%(script_name)r 2 | __requires__ = %(spec)r 3 | __import__('pkg_resources').require(%(spec)r) 4 | __file__ = %(dev_path)r 5 | with open(__file__) as f: 6 | exec(compile(f.read(), __file__, 'exec')) 7 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools/script.tmpl: -------------------------------------------------------------------------------- 1 | # EASY-INSTALL-SCRIPT: %(spec)r,%(script_name)r 2 | __requires__ = %(spec)r 3 | __import__('pkg_resources').run_script(%(spec)r, %(script_name)r) 4 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools/unicode_utils.py: -------------------------------------------------------------------------------- 1 | import unicodedata 2 | import sys 3 | 4 | if "setuptools" in __import__("os").environ.get("__PEX_UNVENDORED__", ""): 5 | from setuptools.extern import six # vendor:skip 6 | else: 7 | from pex.third_party.setuptools.extern import six 8 | 9 | 10 | 11 | # HFS Plus uses decomposed UTF-8 12 | def decompose(path): 13 | if isinstance(path, six.text_type): 14 | return unicodedata.normalize('NFD', path) 15 | try: 16 | path = path.decode('utf-8') 17 | path = unicodedata.normalize('NFD', path) 18 | path = path.encode('utf-8') 19 | except UnicodeError: 20 | pass # Not UTF-8 21 | return path 22 | 23 | 24 | def filesys_decode(path): 25 | """ 26 | Ensure that the given path is decoded, 27 | NONE when no expected encoding works 28 | """ 29 | 30 | if isinstance(path, six.text_type): 31 | return path 32 | 33 | fs_enc = sys.getfilesystemencoding() or 'utf-8' 34 | candidates = fs_enc, 'utf-8' 35 | 36 | for enc in candidates: 37 | try: 38 | return path.decode(enc) 39 | except UnicodeDecodeError: 40 | continue 41 | 42 | 43 | def try_encode(string, enc): 44 | "turn unicode encoding into a functional routine" 45 | try: 46 | return string.encode(enc) 47 | except UnicodeEncodeError: 48 | return None 49 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools/version.py: -------------------------------------------------------------------------------- 1 | if "setuptools" in __import__("os").environ.get("__PEX_UNVENDORED__", ""): 2 | import pkg_resources # vendor:skip 3 | else: 4 | import pex.third_party.pkg_resources as pkg_resources 5 | 6 | 7 | try: 8 | __version__ = pkg_resources.get_distribution('setuptools').version 9 | except Exception: 10 | __version__ = 'unknown' 11 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/setuptools/setuptools/windows_support.py: -------------------------------------------------------------------------------- 1 | import platform 2 | import ctypes 3 | 4 | 5 | def windows_only(func): 6 | if platform.system() != 'Windows': 7 | return lambda *args, **kwargs: None 8 | return func 9 | 10 | 11 | @windows_only 12 | def hide_file(path): 13 | """ 14 | Set the hidden attribute on a file or directory. 15 | 16 | From http://stackoverflow.com/questions/19622133/ 17 | 18 | `path` must be text. 19 | """ 20 | __import__('ctypes.wintypes') 21 | SetFileAttributes = ctypes.windll.kernel32.SetFileAttributesW 22 | SetFileAttributes.argtypes = ctypes.wintypes.LPWSTR, ctypes.wintypes.DWORD 23 | SetFileAttributes.restype = ctypes.wintypes.BOOL 24 | 25 | FILE_ATTRIBUTE_HIDDEN = 0x02 26 | 27 | ret = SetFileAttributes(path, FILE_ATTRIBUTE_HIDDEN) 28 | if not ret: 29 | raise ctypes.WinError() 30 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/toml/.layout.json: -------------------------------------------------------------------------------- 1 | {"fingerprint": "3fd281547bbc087c77a8de1a2ccdd19711d62164aa3edef5a801f8092650db08", "record_relpath": "toml-0.10.2.dist-info/RECORD", "root_is_purelib": true, "stash_dir": ".prefix"} -------------------------------------------------------------------------------- /pex/vendor/_vendored/toml/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/toml/__init__.py -------------------------------------------------------------------------------- /pex/vendor/_vendored/toml/constraints.txt: -------------------------------------------------------------------------------- 1 | toml==0.10.2 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/toml/toml-0.10.2.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pex 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/toml/toml-0.10.2.dist-info/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright 2013-2019 William Pearson 4 | Copyright 2015-2016 Julien Enselme 5 | Copyright 2016 Google Inc. 6 | Copyright 2017 Samuel Vasko 7 | Copyright 2017 Nate Prewitt 8 | Copyright 2017 Jack Evans 9 | Copyright 2019 Filippo Broggini 10 | 11 | Permission is hereby granted, free of charge, to any person obtaining a copy 12 | of this software and associated documentation files (the "Software"), to deal 13 | in the Software without restriction, including without limitation the rights 14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | copies of the Software, and to permit persons to whom the Software is 16 | furnished to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included in 19 | all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | THE SOFTWARE. -------------------------------------------------------------------------------- /pex/vendor/_vendored/toml/toml-0.10.2.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.35.1) 3 | Root-Is-Purelib: true 4 | Tag: py2-none-any 5 | Tag: py3-none-any 6 | 7 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/toml/toml-0.10.2.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | toml 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/toml/toml/__init__.py: -------------------------------------------------------------------------------- 1 | """Python module which parses and emits TOML. 2 | 3 | Released under the MIT license. 4 | """ 5 | 6 | if "toml" in __import__("os").environ.get("__PEX_UNVENDORED__", ""): 7 | from toml import encoder # vendor:skip 8 | else: 9 | from pex.third_party.toml import encoder 10 | 11 | if "toml" in __import__("os").environ.get("__PEX_UNVENDORED__", ""): 12 | from toml import decoder # vendor:skip 13 | else: 14 | from pex.third_party.toml import decoder 15 | 16 | 17 | __version__ = "0.10.2" 18 | _spec_ = "0.5.0" 19 | 20 | load = decoder.load 21 | loads = decoder.loads 22 | TomlDecoder = decoder.TomlDecoder 23 | TomlDecodeError = decoder.TomlDecodeError 24 | TomlPreserveCommentDecoder = decoder.TomlPreserveCommentDecoder 25 | 26 | dump = encoder.dump 27 | dumps = encoder.dumps 28 | TomlEncoder = encoder.TomlEncoder 29 | TomlArraySeparatorEncoder = encoder.TomlArraySeparatorEncoder 30 | TomlPreserveInlineDictEncoder = encoder.TomlPreserveInlineDictEncoder 31 | TomlNumpyEncoder = encoder.TomlNumpyEncoder 32 | TomlPreserveCommentEncoder = encoder.TomlPreserveCommentEncoder 33 | TomlPathlibEncoder = encoder.TomlPathlibEncoder 34 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/toml/toml/ordered.py: -------------------------------------------------------------------------------- 1 | from collections import OrderedDict 2 | if "toml" in __import__("os").environ.get("__PEX_UNVENDORED__", ""): 3 | from toml import TomlEncoder # vendor:skip 4 | else: 5 | from pex.third_party.toml import TomlEncoder 6 | 7 | if "toml" in __import__("os").environ.get("__PEX_UNVENDORED__", ""): 8 | from toml import TomlDecoder # vendor:skip 9 | else: 10 | from pex.third_party.toml import TomlDecoder 11 | 12 | 13 | 14 | class TomlOrderedDecoder(TomlDecoder): 15 | 16 | def __init__(self): 17 | super(self.__class__, self).__init__(_dict=OrderedDict) 18 | 19 | 20 | class TomlOrderedEncoder(TomlEncoder): 21 | 22 | def __init__(self): 23 | super(self.__class__, self).__init__(_dict=OrderedDict) 24 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/toml/toml/tz.py: -------------------------------------------------------------------------------- 1 | from datetime import tzinfo, timedelta 2 | 3 | 4 | class TomlTz(tzinfo): 5 | def __init__(self, toml_offset): 6 | if toml_offset == "Z": 7 | self._raw_offset = "+00:00" 8 | else: 9 | self._raw_offset = toml_offset 10 | self._sign = -1 if self._raw_offset[0] == '-' else 1 11 | self._hours = int(self._raw_offset[1:3]) 12 | self._minutes = int(self._raw_offset[4:6]) 13 | 14 | def __deepcopy__(self, memo): 15 | return self.__class__(self._raw_offset) 16 | 17 | def tzname(self, dt): 18 | return "UTC" + self._raw_offset 19 | 20 | def utcoffset(self, dt): 21 | return self._sign * timedelta(hours=self._hours, minutes=self._minutes) 22 | 23 | def dst(self, dt): 24 | return timedelta(0) 25 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/tomli/.layout.json: -------------------------------------------------------------------------------- 1 | {"fingerprint": "0454d05ff5986998a7ace56edd25253452f464fd365f7ab4295edba84b58162f", "record_relpath": "tomli-2.0.1.dist-info/RECORD", "root_is_purelib": true, "stash_dir": ".prefix"} -------------------------------------------------------------------------------- /pex/vendor/_vendored/tomli/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/pex/vendor/_vendored/tomli/__init__.py -------------------------------------------------------------------------------- /pex/vendor/_vendored/tomli/constraints.txt: -------------------------------------------------------------------------------- 1 | tomli==2.0.1 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/tomli/tomli-2.0.1.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pex 2 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/tomli/tomli-2.0.1.dist-info/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Taneli Hukkinen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/tomli/tomli-2.0.1.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: flit 3.6.0 3 | Root-Is-Purelib: true 4 | Tag: py3-none-any 5 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/tomli/tomli/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: MIT 2 | # SPDX-FileCopyrightText: 2021 Taneli Hukkinen 3 | # Licensed to PSF under a Contributor Agreement. 4 | 5 | __all__ = ("loads", "load", "TOMLDecodeError") 6 | __version__ = "2.0.1" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT 7 | 8 | from ._parser import TOMLDecodeError, load, loads 9 | 10 | # Pretend this exception was created here. 11 | TOMLDecodeError.__module__ = __name__ 12 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/tomli/tomli/_types.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: MIT 2 | # SPDX-FileCopyrightText: 2021 Taneli Hukkinen 3 | # Licensed to PSF under a Contributor Agreement. 4 | 5 | from typing import Any, Callable, Tuple 6 | 7 | # Type annotations 8 | ParseFloat = Callable[[str], Any] 9 | Key = Tuple[str, ...] 10 | Pos = int 11 | -------------------------------------------------------------------------------- /pex/vendor/_vendored/tomli/tomli/py.typed: -------------------------------------------------------------------------------- 1 | # Marker file for PEP 561 2 | -------------------------------------------------------------------------------- /pex/venv/README.md: -------------------------------------------------------------------------------- 1 | The [Venv](../tools/commands/venv.py) command uses the 2 | [virtualenv](https://github.com/pypa/virtualenv) project to support creating Python 2.7 virtual 3 | environments (The Python `venv` stdlib module was added only 4 | in Python 3). 5 | 6 | We use the last virtualenv version to support Python 2.7, embedding it as the 7 | [virtualenv_16.7.12_py](virtualenv_16.7.12_py) resource via the 8 | [embed_virtualenv.sh](/scripts/embed_virtualenv.sh) script. 9 | 10 | -------------------------------------------------------------------------------- /pex/venv/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | -------------------------------------------------------------------------------- /pex/venv/bin_path.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | from pex.enum import Enum 7 | 8 | 9 | class BinPath(Enum["BinPath.Value"]): 10 | class Value(Enum.Value): 11 | pass 12 | 13 | FALSE = Value("false") 14 | PREPEND = Value("prepend") 15 | APPEND = Value("append") 16 | 17 | 18 | BinPath.seal() 19 | -------------------------------------------------------------------------------- /pex/venv/install_scope.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | from pex.enum import Enum 7 | 8 | 9 | class InstallScope(Enum["InstallScope.Value"]): 10 | class Value(Enum.Value): 11 | pass 12 | 13 | ALL = Value("all") 14 | DEPS_ONLY = Value("deps") 15 | SOURCE_ONLY = Value("srcs") 16 | 17 | 18 | InstallScope.seal() 19 | -------------------------------------------------------------------------------- /pex/venv/installer_configuration.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | from pex.typing import TYPE_CHECKING 7 | from pex.venv.bin_path import BinPath 8 | from pex.venv.install_scope import InstallScope 9 | 10 | if TYPE_CHECKING: 11 | from typing import Optional 12 | 13 | import attr # vendor:skip 14 | else: 15 | from pex.third_party import attr 16 | 17 | 18 | @attr.s(frozen=True) 19 | class InstallerConfiguration(object): 20 | scope = attr.ib(default=InstallScope.ALL) # type: InstallScope.Value 21 | bin_path = attr.ib(default=BinPath.FALSE) # type: BinPath.Value 22 | force = attr.ib(default=False) # type: bool 23 | collisions_ok = attr.ib(default=False) # type: bool 24 | pip = attr.ib(default=False) # type: bool 25 | copies = attr.ib(default=False) # type: bool 26 | site_packages_copies = attr.ib(default=False) # type: bool 27 | system_site_packages = attr.ib(default=False) # type: bool 28 | compile = attr.ib(default=False) # type: bool 29 | prompt = attr.ib(default=None) # type: Optional[str] 30 | hermetic_scripts = attr.ib(default=False) # type: bool 31 | -------------------------------------------------------------------------------- /pex/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | __version__ = "2.40.1" 5 | -------------------------------------------------------------------------------- /pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | # This leaves behind the minimum number of prior test run tmp files (only the last run). 3 | tmp_path_retention_count = 1 4 | 5 | # And, further, only leave behind failed test tmp dirs. 6 | tmp_path_retention_policy = failed 7 | 8 | # Auto-enable markdown report summary for failures and errors (this only works for Python 3.9+). 9 | md_report = true 10 | md_report_exclude_outcomes = 11 | passed 12 | skipped 13 | xpassed 14 | 15 | # Auto-enable junit.xml results for reporting. 16 | addopts = --junit-xml dist/test-report.xml 17 | junit_family = xunit2 18 | junit_logging = system-err 19 | junit_log_passing_tests = false 20 | -------------------------------------------------------------------------------- /scripts/dev-cmd-pip-install-pex-next.py: -------------------------------------------------------------------------------- 1 | import os 2 | import subprocess 3 | import sys 4 | 5 | TYPE_CHECKING = False 6 | if TYPE_CHECKING: 7 | from typing import Any 8 | 9 | 10 | def main(): 11 | # type: () -> Any 12 | 13 | if len(sys.argv) != 2: 14 | return "Usage: {prog} [_PEX_REQUIRES_PYTHON_VALUE]".format(prog=sys.argv[0]) 15 | 16 | return subprocess.call( 17 | args=[sys.executable, "-m", "pip", "install", "-e", "."], 18 | env={**os.environ, "_PEX_REQUIRES_PYTHON": sys.argv[1]}, 19 | ) 20 | 21 | 22 | if __name__ == "__main__": 23 | sys.exit(main()) 24 | -------------------------------------------------------------------------------- /scripts/embed-virtualenv.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os 4 | import subprocess 5 | import sys 6 | from pathlib import Path 7 | 8 | import httpx 9 | 10 | from pex.util import named_temporary_file 11 | 12 | VIRTUALENV_16_7_12_RELEASE_SHA = "fdfec65ff031997503fb409f365ee3aeb4c2c89f" 13 | 14 | 15 | def find_repo_root() -> Path: 16 | return Path( 17 | subprocess.run( 18 | args=["git", "rev-parse", "--show-toplevel"], 19 | text=True, 20 | stdout=subprocess.PIPE, 21 | check=True, 22 | ).stdout.strip() 23 | ) 24 | 25 | 26 | def main() -> None: 27 | out_path = find_repo_root() / "pex/venv/virtualenv_16.7.12_py" 28 | with httpx.stream( 29 | "GET", 30 | f"https://raw.githubusercontent.com/pypa/virtualenv/" 31 | f"{VIRTUALENV_16_7_12_RELEASE_SHA}/virtualenv.py", 32 | ) as response, named_temporary_file( 33 | dir=out_path.parent, prefix=f"{out_path.name}.", suffix=".downloading" 34 | ) as out_fp: 35 | for chunk in response.iter_bytes(): 36 | out_fp.write(chunk) 37 | os.rename(out_fp.name, out_path) 38 | 39 | 40 | if __name__ == "__main__": 41 | try: 42 | main() 43 | except subprocess.CalledProcessError as e: 44 | sys.exit(e.returncode) 45 | -------------------------------------------------------------------------------- /scripts/requires-python-check.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import sys 4 | from textwrap import dedent 5 | from typing import Any 6 | 7 | from pex import toml 8 | from pex.compatibility import ConfigParser 9 | 10 | 11 | def main() -> Any: 12 | config_parser = ConfigParser() 13 | config_parser.read("setup.cfg") 14 | setup_cfg_python_requires = config_parser.get("options", "python_requires") 15 | 16 | pyproject_data = toml.load("pyproject.toml") 17 | pyproject_requires_python = pyproject_data["project"]["requires-python"] 18 | 19 | if setup_cfg_python_requires != pyproject_requires_python: 20 | return dedent( 21 | """\ 22 | The project Requires-Python metadata is inconsistent. Please align the following values: 23 | 24 | setup.cfg: 25 | [options] 26 | python_requires = {setup_cfg_python_requires} 27 | 28 | pyproject.toml: 29 | [project] 30 | requires-python = "{pyproject_requires_python}" 31 | """.format( 32 | setup_cfg_python_requires=setup_cfg_python_requires, 33 | pyproject_requires_python=pyproject_requires_python, 34 | ) 35 | ) 36 | 37 | 38 | if __name__ == "__main__": 39 | sys.exit(main()) 40 | -------------------------------------------------------------------------------- /testing/cli.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | import subprocess 7 | import sys 8 | 9 | from pex.compatibility import to_unicode 10 | from pex.typing import TYPE_CHECKING, cast 11 | from testing import IntegResults 12 | 13 | if TYPE_CHECKING: 14 | from typing import Text # noqa 15 | from typing import Any 16 | 17 | 18 | def run_pex3( 19 | *args, # type: str 20 | **kwargs # type: Any 21 | ): 22 | # type: (...) -> IntegResults 23 | 24 | python = cast("Text", kwargs.pop("python", None) or to_unicode(sys.executable)) 25 | process = subprocess.Popen( 26 | args=[python, "-mpex.cli"] + list(args), 27 | stdout=subprocess.PIPE, 28 | stderr=subprocess.PIPE, 29 | **kwargs 30 | ) 31 | stdout, stderr = process.communicate() 32 | return IntegResults( 33 | output=stdout.decode("utf-8"), error=stderr.decode("utf-8"), return_code=process.returncode 34 | ) 35 | -------------------------------------------------------------------------------- /testing/data/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | import os.path 7 | import pkgutil 8 | 9 | 10 | def load(rel_path): 11 | # type: (str) -> bytes 12 | data = pkgutil.get_data(__name__, rel_path) 13 | if data is None: 14 | raise ValueError( 15 | "No resource found at {rel_path} from package {name}.".format( 16 | rel_path=rel_path, name=__name__ 17 | ) 18 | ) 19 | return data 20 | 21 | 22 | def path(*rel_path): 23 | # type: (*str) -> str 24 | path = os.path.join(os.path.dirname(__file__), *rel_path) 25 | if not os.path.isfile(path): 26 | raise ValueError("No resource found at {path}.".format(path=path)) 27 | return path 28 | -------------------------------------------------------------------------------- /testing/data/locks/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | -------------------------------------------------------------------------------- /testing/data/platforms/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | -------------------------------------------------------------------------------- /testing/pep_427.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | from pex.pep_427 import InstallableType 7 | 8 | 9 | def get_installable_type_flag(installable_type): 10 | # type: (InstallableType.Value) -> str 11 | return ( 12 | "--no-pre-install-wheels" 13 | if installable_type is InstallableType.WHEEL_FILE 14 | else "--pre-install-wheels" 15 | ) 16 | -------------------------------------------------------------------------------- /testing/pip.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | import pytest 7 | 8 | from pex.pip.version import PipVersion 9 | 10 | skip_if_only_vendored_pip_supported = pytest.mark.skipif( 11 | PipVersion.LATEST_COMPATIBLE is PipVersion.VENDORED, reason="This test requires `pip>=22.2.2`." 12 | ) 13 | -------------------------------------------------------------------------------- /testing/pytest_utils/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | import os 7 | 8 | IS_CI = "true" == os.environ.get("CI", "false") 9 | -------------------------------------------------------------------------------- /testing/pytest_utils/track_status_hook_py2.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import, print_function 5 | 6 | from _pytest.config import hookimpl # type: ignore[import] 7 | 8 | from pex.typing import TYPE_CHECKING 9 | 10 | if TYPE_CHECKING: 11 | from typing import Any, Generator 12 | 13 | from _pytest.nodes import Item 14 | from pluggy.callers import _Result # type: ignore[import] 15 | 16 | 17 | @hookimpl(hookwrapper=True, tryfirst=True) 18 | def track_status_hook( 19 | item, # type: Item 20 | call, # type: Any 21 | ): 22 | # type: (...) -> Generator[None, _Result, None] 23 | 24 | from testing.pytest_utils.track_status_hook import mark_passed 25 | 26 | report = yield 27 | result = report.get_result() 28 | if result.when == "call" and result.passed: 29 | mark_passed(item) 30 | return 31 | -------------------------------------------------------------------------------- /testing/pytest_utils/track_status_hook_py3.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | import sys 7 | 8 | from _pytest.config import hookimpl 9 | 10 | from pex.typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from typing import Any, Generator 14 | 15 | from _pytest.nodes import Item 16 | from _pytest.reports import TestReport 17 | 18 | 19 | @hookimpl(tryfirst=True, **{"wrapper" if sys.version_info[:2] >= (3, 7) else "hookwrapper": True}) 20 | def track_status_hook( 21 | item, # type: Item 22 | call, # type: Any 23 | ): 24 | # type: (...) -> Generator[None, TestReport, TestReport] 25 | 26 | from testing.pytest_utils.track_status_hook import mark_passed 27 | 28 | report = yield 29 | if sys.version_info[:2] < (3, 7): 30 | report = report.get_result() 31 | if report.when == "call" and report.passed: 32 | mark_passed(item) 33 | return report 34 | -------------------------------------------------------------------------------- /testing/pythonPI.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | import sys 7 | 8 | import pytest 9 | 10 | # Utilities related to Pex Python PI support bring-up. 11 | # These will all be removed as tracked by https://github.com/pex-tool/pex/issues/2564 12 | 13 | skip_flit_core_39 = pytest.mark.skipif( 14 | sys.version_info[:2] >= (3, 14), 15 | reason=( 16 | "As of its latest 3.9.0 release, flit_core relies on ast.Str which was removed in Python " 17 | "3.14. This was fixed in" 18 | "https://github.com/pypa/flit/commit/6ab62c91d0db451b5e9ab000f0dba5471550b442 and will be " 19 | "released in 3.10 at which point this skip can be removed." 20 | ), 21 | ) 22 | -------------------------------------------------------------------------------- /testing/scie.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | import pytest 7 | 8 | from pex.sysconfig import SysPlatform 9 | from testing import IS_PYPY, PY_VER 10 | 11 | 12 | def has_provider(): 13 | # type: () -> bool 14 | if IS_PYPY: 15 | if PY_VER == (2, 7): 16 | return True 17 | 18 | if SysPlatform.LINUX_AARCH64 is SysPlatform.CURRENT: 19 | return PY_VER >= (3, 7) 20 | elif SysPlatform.MACOS_AARCH64 is SysPlatform.CURRENT: 21 | return PY_VER >= (3, 8) 22 | else: 23 | return PY_VER >= (3, 6) 24 | else: 25 | return (3, 9) <= PY_VER < (3, 14) 26 | 27 | 28 | skip_if_no_provider = pytest.mark.skipif( 29 | not has_provider(), 30 | reason=( 31 | "Either A PBS or PyPy release must be available for the current interpreter to run this " 32 | "test." 33 | ), 34 | ) 35 | -------------------------------------------------------------------------------- /tests/example_packages/MarkupSafe-1.0-cp27-cp27mu-linux_x86_64.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/tests/example_packages/MarkupSafe-1.0-cp27-cp27mu-linux_x86_64.whl -------------------------------------------------------------------------------- /tests/example_packages/PyAthena-1.11.5-py2.py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/tests/example_packages/PyAthena-1.11.5-py2.py3-none-any.whl -------------------------------------------------------------------------------- /tests/example_packages/PyAthena-1.9.0-py2.py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/tests/example_packages/PyAthena-1.9.0-py2.py3-none-any.whl -------------------------------------------------------------------------------- /tests/example_packages/aws_cfn_bootstrap-1.4-py2-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/tests/example_packages/aws_cfn_bootstrap-1.4-py2-none-any.whl -------------------------------------------------------------------------------- /tests/example_packages/pyparsing-2.1.10-py2.py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pex-tool/pex/6c8c3fe8565196be213caee75b782dc7063e8ce9/tests/example_packages/pyparsing-2.1.10-py2.py3-none-any.whl -------------------------------------------------------------------------------- /tests/integration/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | -------------------------------------------------------------------------------- /tests/integration/build_system/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | -------------------------------------------------------------------------------- /tests/integration/build_system/test_issue_2063.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | import sys 5 | 6 | import pytest 7 | 8 | from pex.typing import TYPE_CHECKING 9 | from testing.cli import run_pex3 10 | 11 | if TYPE_CHECKING: 12 | from typing import Any 13 | 14 | 15 | @pytest.mark.skipif( 16 | sys.version_info[:2] < (3, 5) or sys.version_info[:2] >= (3, 12), 17 | reason=( 18 | "The tested distribution is only compatible with Python >= 3.5 and it requires lxml (4.9.2)" 19 | " which only has pre-built wheels available through 3.11." 20 | ), 21 | ) 22 | def test_build_system_no_build_backend(tmpdir): 23 | # type: (Any) -> None 24 | 25 | run_pex3("lock", "create", "xmlsec==1.3.13").assert_success() 26 | -------------------------------------------------------------------------------- /tests/integration/build_system/test_issue_2125.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | import sys 5 | 6 | import pytest 7 | 8 | from pex.typing import TYPE_CHECKING 9 | from testing.cli import run_pex3 10 | 11 | if TYPE_CHECKING: 12 | from typing import Any 13 | 14 | 15 | @pytest.mark.skipif( 16 | sys.version_info[:2] < (3, 7), 17 | reason="The tested distribution is only compatible with Python >= 3.7", 18 | ) 19 | def test_get_requires_for_build_wheel(tmpdir): 20 | # type: (Any) -> None 21 | 22 | run_pex3("lock", "create", "cairocffi==1.5.1").assert_success() 23 | -------------------------------------------------------------------------------- /tests/integration/resolve/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | -------------------------------------------------------------------------------- /tests/integration/resolve/pep_691/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | -------------------------------------------------------------------------------- /tests/integration/scie/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | -------------------------------------------------------------------------------- /tests/integration/test_issue_1201.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | import os 5 | 6 | from pex.typing import TYPE_CHECKING 7 | from testing import run_pex_command, subprocess 8 | 9 | if TYPE_CHECKING: 10 | from typing import Any 11 | 12 | 13 | def test_old_requires_metadata_used_for_requires_python(tmpdir): 14 | # type: (Any) -> None 15 | pex_file = os.path.join(str(tmpdir), "et-xmlfile.pex") 16 | result = run_pex_command(args=["et-xmlfile==1.0.1", "-o", pex_file]) 17 | result.assert_success() 18 | subprocess.check_call(args=[pex_file, "-c", "import et_xmlfile"]) 19 | -------------------------------------------------------------------------------- /tests/integration/test_issue_1316.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | import os 5 | import sys 6 | 7 | import pytest 8 | 9 | from pex.typing import TYPE_CHECKING 10 | from testing import run_pex_command, subprocess 11 | 12 | if TYPE_CHECKING: 13 | from typing import Any 14 | 15 | 16 | @pytest.mark.skipif(sys.version_info[:2] < (3, 6), reason="PyYAML 6.0.1 requires Python >= 3.6") 17 | def test_resolve_cyclic_dependency_graph(tmpdir): 18 | # type: (Any) -> None 19 | naked_pex = os.path.join(str(tmpdir), "naked.pex") 20 | 21 | # N.B.: Naked 0.1.31 requires PyYAML unbounded and old versions of PyYAML that work with Python 22 | # 2.7 have been broken by the Cython 3.0.0 release. As such we exclude older versions of Python 23 | # from this test and pin PyYAML to a newer version that works with Cython>=3. 24 | constraints = os.path.join(str(tmpdir), "constraints.txt") 25 | with open(constraints, "w") as fp: 26 | fp.write("PyYAML==6.0.1") 27 | 28 | run_pex_command( 29 | args=["Naked==0.1.31", "--constraints", constraints, "-o", naked_pex] 30 | ).assert_success() 31 | subprocess.check_call(args=[naked_pex, "-c", "import Naked"]) 32 | -------------------------------------------------------------------------------- /tests/integration/test_issue_1336.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | import os 5 | 6 | from pex.compatibility import safe_commonpath 7 | from pex.typing import TYPE_CHECKING 8 | from testing import PY310, ensure_python_interpreter, run_pex_command, subprocess 9 | 10 | if TYPE_CHECKING: 11 | from typing import Any 12 | 13 | 14 | def test_pip_leak(tmpdir): 15 | # type: (Any) -> None 16 | python = ensure_python_interpreter(PY310) 17 | pip = os.path.join(os.path.dirname(python), "pip") 18 | subprocess.check_call(args=[pip, "install", "setuptools_scm==6.0.1"]) 19 | 20 | pex_root = os.path.join(str(tmpdir), "pex_root") 21 | result = run_pex_command( 22 | args=[ 23 | "--pex-root", 24 | pex_root, 25 | "--runtime-pex-root", 26 | pex_root, 27 | "--python", 28 | python, 29 | "bitstring==3.1.7", 30 | "--", 31 | "-c", 32 | "import bitstring, os; print(os.path.realpath(bitstring.__file__))", 33 | ], 34 | python=python, 35 | ) 36 | result.assert_success() 37 | assert os.path.realpath(pex_root) == safe_commonpath( 38 | [os.path.realpath(pex_root), result.output.strip()] 39 | ) 40 | -------------------------------------------------------------------------------- /tests/integration/test_issue_1447.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | import os 4 | import shutil 5 | import sys 6 | 7 | from pex.pex_info import PexInfo 8 | from pex.typing import TYPE_CHECKING 9 | from pex.variables import unzip_dir 10 | from testing import run_pex_command, subprocess 11 | 12 | if TYPE_CHECKING: 13 | from typing import Any 14 | 15 | 16 | def test_layout_identification(tmpdir): 17 | # type: (Any) -> None 18 | 19 | pex_root = os.path.join(str(tmpdir), "pex_root") 20 | pex_file = os.path.join(str(tmpdir), "a.pex") 21 | run_pex_command( 22 | args=["-o", pex_file, "--pex-root", pex_root, "--runtime-pex-root", pex_root] 23 | ).assert_success() 24 | 25 | pex_hash = PexInfo.from_pex(pex_file).pex_hash 26 | assert pex_hash is not None 27 | 28 | expected_unzip_dir = unzip_dir(pex_root, pex_hash) 29 | assert not os.path.exists(expected_unzip_dir) 30 | 31 | subprocess.check_call(args=[pex_file, "-c", ""]) 32 | assert os.path.isdir(expected_unzip_dir) 33 | 34 | shutil.rmtree(expected_unzip_dir) 35 | os.chmod(pex_file, 0o644) 36 | subprocess.check_call(args=[sys.executable, pex_file, "-c", ""]) 37 | assert os.path.isdir(expected_unzip_dir) 38 | -------------------------------------------------------------------------------- /tests/integration/test_issue_1550.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | import os.path 4 | 5 | from pex import dist_metadata 6 | from pex.dist_metadata import ProjectNameAndVersion 7 | from pex.orderedset import OrderedSet 8 | from pex.pex_info import PexInfo 9 | from pex.typing import TYPE_CHECKING 10 | from testing import run_pex_command, subprocess 11 | 12 | if TYPE_CHECKING: 13 | from typing import Any 14 | 15 | 16 | def test_duplicate_requirements_issues_1550(tmpdir): 17 | # type: (Any) -> None 18 | 19 | pex_file = os.path.join(str(tmpdir), "pex") 20 | run_pex_command( 21 | args=[ 22 | "PyJWT", 23 | "PyJWT==1.7.1", 24 | "--resolver-version", 25 | "pip-2020-resolver", 26 | "-o", 27 | pex_file, 28 | ] 29 | ).assert_success() 30 | 31 | subprocess.check_call(args=[pex_file, "-c", "import jwt"]) 32 | pex_info = PexInfo.from_pex(pex_file) 33 | assert 1 == len(pex_info.distributions) 34 | assert ProjectNameAndVersion("PyJWT", "1.7.1") == dist_metadata.project_name_and_version( 35 | next(iter(pex_info.distributions.keys())) 36 | ), "ex_info.distributions: {}".format(pex_info.distributions) 37 | assert OrderedSet(("PyJWT", "PyJWT==1.7.1")) == pex_info.requirements 38 | -------------------------------------------------------------------------------- /tests/integration/test_issue_1861.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | import os 5 | 6 | from pex.cache.dirs import CacheDir 7 | from pex.typing import TYPE_CHECKING 8 | from testing import make_env, run_pex_command 9 | 10 | if TYPE_CHECKING: 11 | from typing import Any 12 | 13 | 14 | def test_confounding_site_packages_directory(tmpdir): 15 | # type: (Any) -> None 16 | 17 | pex_root = os.path.join(str(tmpdir), "pex_root") 18 | local_app_data = os.path.join(str(tmpdir), "local_app_data") 19 | result = run_pex_command( 20 | args=[ 21 | "--pex-root", 22 | pex_root, 23 | "--runtime-pex-root", 24 | pex_root, 25 | "python-certifi-win32==1.6.1", 26 | "--", 27 | "-c", 28 | "import certifi_win32; print(certifi_win32.__file__)", 29 | ], 30 | # N.B.: certifi_win32 requires `LOCALAPPDATA` be set in the env to import at all. 31 | env=make_env(LOCALAPPDATA=local_app_data), 32 | ) 33 | result.assert_success() 34 | assert result.output.startswith(CacheDir.INSTALLED_WHEELS.path(pex_root=pex_root)) 35 | -------------------------------------------------------------------------------- /tests/integration/test_issue_2572.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | import os 7 | import shutil 8 | 9 | from pex.fs import safe_symlink 10 | from testing import make_env, run_pex_command, subprocess 11 | from testing.pytest_utils.tmp import Tempdir 12 | 13 | 14 | def test_symlinked_home(tmpdir): 15 | # type: (Tempdir) -> None 16 | 17 | real_home = tmpdir.join("a", "b", "c") 18 | symlinked_home = tmpdir.join("lnk") 19 | safe_symlink(real_home, symlinked_home) 20 | env = make_env(HOME=symlinked_home, XDG_CACHE_HOME=None, PEX_ROOT=None) 21 | 22 | pex = tmpdir.join("pex") 23 | run_pex_command(args=["cowsay==5.0", "-c", "cowsay", "-o", pex], env=env).assert_success() 24 | 25 | def test_pex(): 26 | # type: () -> None 27 | assert ( 28 | "5.0" 29 | == subprocess.check_output(args=[pex, "--version"], env=env).decode("utf-8").strip() 30 | ) 31 | 32 | test_pex() 33 | 34 | shutil.rmtree(real_home) 35 | os.makedirs(real_home) 36 | test_pex() 37 | -------------------------------------------------------------------------------- /tests/integration/test_issue_434.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | import os 5 | 6 | from pex.common import temporary_dir 7 | from testing import PY310, ensure_python_interpreter, run_pex_command, run_simple_pex 8 | 9 | 10 | def test_entry_point_targeting(): 11 | # type: () -> None 12 | """Test bugfix for https://github.com/pex-tool/pex/issues/434.""" 13 | with temporary_dir() as td: 14 | pexrc_path = os.path.join(td, ".pexrc") 15 | with open(pexrc_path, "w") as pexrc: 16 | pex_python = ensure_python_interpreter(PY310) 17 | pexrc.write("PEX_PYTHON=%s" % pex_python) 18 | 19 | # test pex with entry point 20 | pex_out_path = os.path.join(td, "pex.pex") 21 | res = run_pex_command( 22 | ["--disable-cache", "autopep8==1.5.6", "-e", "autopep8", "-o", pex_out_path] 23 | ) 24 | res.assert_success() 25 | 26 | stdout, rc = run_simple_pex(pex_out_path) 27 | assert "usage: autopep8".encode() in stdout 28 | -------------------------------------------------------------------------------- /tests/integration/test_issue_598.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | import os 5 | 6 | from pex.common import temporary_dir 7 | from testing import make_env, run_pex_command, subprocess 8 | 9 | 10 | def test_force_local_implicit_ns_packages(): 11 | # type: () -> None 12 | # This was a minimal repro for the issue documented in #598. 13 | with temporary_dir() as out: 14 | tcl_pex = os.path.join(out, "tcl.pex") 15 | run_pex_command(["twitter.common.lang==0.3.9", "-o", tcl_pex]) 16 | 17 | subprocess.check_call( 18 | [tcl_pex, "-c", "from twitter.common.lang import Singleton"], 19 | env=make_env(PEX_FORCE_LOCAL="1", PEX_PATH=tcl_pex), 20 | ) 21 | -------------------------------------------------------------------------------- /tests/integration/venv_ITs/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | -------------------------------------------------------------------------------- /tests/integration/venv_ITs/conftest.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | import pytest 7 | 8 | from pex.typing import TYPE_CHECKING 9 | from testing.docker import DockerVirtualenvRunner 10 | 11 | if TYPE_CHECKING: 12 | from typing import Any 13 | 14 | 15 | @pytest.fixture 16 | def fedora39_virtualenv_runner(tmpdir): 17 | # type: (Any) -> DockerVirtualenvRunner 18 | 19 | return DockerVirtualenvRunner.create( 20 | base_image="fedora:39", 21 | python="python3.12", 22 | virtualenv_version="20.25.1", 23 | tmpdir=str(tmpdir), 24 | ) 25 | -------------------------------------------------------------------------------- /tests/pip/test_version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from pex.pip.version import PipVersion 5 | 6 | 7 | def test_latest(): 8 | # type: () -> None 9 | 10 | assert PipVersion.LATEST != PipVersion.VENDORED 11 | assert PipVersion.LATEST >= PipVersion.v23_1 12 | assert ( 13 | max( 14 | (version for version in PipVersion.values() if not version.hidden), 15 | key=lambda pv: pv.version, 16 | ) 17 | is PipVersion.LATEST 18 | ) 19 | -------------------------------------------------------------------------------- /tests/resolve/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | -------------------------------------------------------------------------------- /tests/resolve/conftest.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from argparse import ArgumentParser 5 | 6 | import pytest 7 | 8 | 9 | @pytest.fixture 10 | def parser(): 11 | # type: () -> ArgumentParser 12 | return ArgumentParser() 13 | -------------------------------------------------------------------------------- /tests/resolve/lockfile/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | -------------------------------------------------------------------------------- /tests/resolve/pep_691/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | -------------------------------------------------------------------------------- /tests/test_artifact_url.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | from pex.artifact_url import VCS, ArchiveScheme, VCSScheme, parse_scheme 7 | 8 | 9 | def test_parse_scheme(): 10 | # type: () -> None 11 | 12 | assert "not a scheme" == parse_scheme("not a scheme") 13 | assert "gopher" == parse_scheme("gopher") 14 | 15 | assert ArchiveScheme.FTP == parse_scheme("ftp") 16 | assert ArchiveScheme.HTTP == parse_scheme("http") 17 | assert ArchiveScheme.HTTPS == parse_scheme("https") 18 | 19 | assert VCSScheme(VCS.Bazaar, "nfs") == parse_scheme("bzr+nfs") 20 | assert VCSScheme(VCS.Git, "file") == parse_scheme("git+file") 21 | assert VCSScheme(VCS.Mercurial, "http") == parse_scheme("hg+http") 22 | assert VCSScheme(VCS.Subversion, "https") == parse_scheme("svn+https") 23 | 24 | assert "cvs+https" == parse_scheme("cvs+https") 25 | -------------------------------------------------------------------------------- /tests/test_os.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | import os 7 | 8 | from pex.common import touch 9 | from pex.executables import chmod_plus_x 10 | from pex.os import is_exe 11 | from testing.pytest_utils.tmp import Tempdir 12 | 13 | 14 | def test_is_exe(tmpdir): 15 | # type: (Tempdir) -> None 16 | 17 | all_exe = tmpdir.join("all_exe") 18 | touch(all_exe) 19 | chmod_plus_x(all_exe) 20 | assert is_exe(all_exe) 21 | 22 | other_exe = tmpdir.join("other_exe") 23 | touch(other_exe) 24 | os.chmod(other_exe, 0o665) 25 | assert not is_exe(other_exe) 26 | 27 | not_exe = tmpdir.join("not_exe") 28 | touch(not_exe) 29 | assert not is_exe(not_exe) 30 | 31 | exe_dir = tmpdir.join("exe_dir") 32 | os.mkdir(exe_dir) 33 | chmod_plus_x(exe_dir) 34 | assert not is_exe(exe_dir) 35 | -------------------------------------------------------------------------------- /tests/test_sorted_tuple.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from pex.sorted_tuple import SortedTuple 5 | 6 | 7 | def test_empty(): 8 | # type: () -> None 9 | empty = SortedTuple() 10 | assert 0 == len(empty) 11 | assert [] == list(empty) 12 | 13 | 14 | def test_non_empty(): 15 | # type: () -> None 16 | non_empty = SortedTuple([1]) 17 | assert [1] == list(non_empty) 18 | 19 | 20 | def test_sorting(): 21 | # type: () -> None 22 | sorted_tuple = SortedTuple([3, 1, 5, 1, 3, 2, 4, 0]) 23 | assert [0, 1, 1, 2, 3, 3, 4, 5] == list(sorted_tuple) 24 | -------------------------------------------------------------------------------- /tests/test_windows.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | 4 | from __future__ import absolute_import 5 | 6 | from pex import windows 7 | from pex.sysconfig import SysPlatform 8 | from testing.pytest_utils.tmp import Tempdir 9 | 10 | 11 | def test_is_script(tmpdir): 12 | # type: (Tempdir) -> None 13 | 14 | assert windows.is_script( 15 | windows.create_script( 16 | tmpdir.join("script"), "import sys; sys.exit(0)", SysPlatform.WINDOWS_X86_64 17 | ) 18 | ) 19 | -------------------------------------------------------------------------------- /tests/tools/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | -------------------------------------------------------------------------------- /tests/tools/commands/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Pex project contributors. 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). 3 | --------------------------------------------------------------------------------