├── .gitignore ├── .idea ├── .gitignore ├── Python.iml ├── inspectionProfiles │ ├── Project_Default.xml │ └── profiles_settings.xml ├── misc.xml └── modules.xml ├── README.md ├── strip-harbor.yml ├── strip-harbor ├── .idea │ ├── .gitignore │ ├── inspectionProfiles │ │ ├── Project_Default.xml │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ └── strip-harbor.iml ├── manage.py ├── requirements.txt ├── strip_harbor_api │ ├── .idea │ │ ├── .gitignore │ │ ├── inspectionProfiles │ │ │ ├── Project_Default.xml │ │ │ └── profiles_settings.xml │ │ ├── misc.xml │ │ ├── modules.xml │ │ └── strip_harbor_api.iml │ ├── __init__.py │ ├── asgi.py │ ├── settings.py │ ├── urls.py │ └── wsgi.py └── sync │ ├── MailerSendNewApiClientAPI.py │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── harbor.py │ ├── models.py │ ├── tests.py │ └── views.py └── template ├── python-waitress ├── .idea │ ├── .gitignore │ ├── inspectionProfiles │ │ ├── Project_Default.xml │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ └── python-waitress.iml ├── Dockerfile ├── function │ └── requirements.txt ├── index.py ├── requirements.txt ├── template.yml ├── template │ ├── csharp │ │ ├── .dockerignore │ │ ├── .gitignore │ │ ├── Dockerfile │ │ ├── Program.cs │ │ ├── function │ │ │ ├── .gitignore │ │ │ ├── Function.csproj │ │ │ └── FunctionHandler.cs │ │ ├── root.csproj │ │ └── template.yml │ ├── dockerfile │ │ ├── function │ │ │ └── Dockerfile │ │ └── template.yml │ ├── go │ │ ├── Dockerfile │ │ ├── function │ │ │ └── handler.go │ │ ├── go.mod │ │ ├── main.go │ │ └── template.yml │ ├── java11-vert-x │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── build.gradle │ │ ├── entrypoint │ │ │ ├── build.gradle │ │ │ ├── settings.gradle │ │ │ └── src │ │ │ │ ├── main │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── openfaas │ │ │ │ │ └── entrypoint │ │ │ │ │ └── App.java │ │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── AppTest.java │ │ ├── function │ │ │ ├── build.gradle │ │ │ ├── settings.gradle │ │ │ └── src │ │ │ │ ├── main │ │ │ │ ├── java │ │ │ │ │ └── com │ │ │ │ │ │ └── openfaas │ │ │ │ │ │ └── function │ │ │ │ │ │ └── Handler.java │ │ │ │ └── resources │ │ │ │ │ └── webroot │ │ │ │ │ └── index.html │ │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── HandlerTest.java │ │ ├── settings.gradle │ │ └── template.yml │ ├── java11 │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── build.gradle │ │ ├── function │ │ │ ├── build.gradle │ │ │ ├── gradle │ │ │ │ └── wrapper │ │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradlew │ │ │ ├── gradlew.bat │ │ │ ├── settings.gradle │ │ │ └── src │ │ │ │ ├── main │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── openfaas │ │ │ │ │ └── function │ │ │ │ │ └── Handler.java │ │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── HandlerTest.java │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── settings.gradle │ │ └── template.yml │ ├── node │ │ ├── .dockerignore │ │ ├── Dockerfile │ │ ├── function │ │ │ ├── handler.js │ │ │ └── package.json │ │ ├── index.js │ │ ├── package.json │ │ └── template.yml │ ├── node12 │ │ ├── .dockerignore │ │ ├── Dockerfile │ │ ├── function │ │ │ ├── handler.js │ │ │ └── package.json │ │ ├── index.js │ │ ├── package.json │ │ └── template.yml │ ├── php7 │ │ ├── Dockerfile │ │ ├── function │ │ │ ├── composer.json │ │ │ ├── php-extension.sh │ │ │ └── src │ │ │ │ └── Handler.php │ │ ├── index.php │ │ ├── php-extension.sh-example │ │ ├── readme.md │ │ └── template.yml │ ├── python │ │ ├── Dockerfile │ │ ├── function │ │ │ ├── handler.py │ │ │ └── requirements.txt │ │ ├── index.py │ │ ├── requirements.txt │ │ └── template.yml │ ├── python3-debian │ │ ├── Dockerfile │ │ ├── function │ │ │ ├── __init__.py │ │ │ ├── handler.py │ │ │ └── requirements.txt │ │ ├── index.py │ │ ├── requirements.txt │ │ └── template.yml │ ├── python3 │ │ ├── Dockerfile │ │ ├── function │ │ │ ├── __init__.py │ │ │ ├── handler.py │ │ │ └── requirements.txt │ │ ├── index.py │ │ ├── requirements.txt │ │ └── template.yml │ └── ruby │ │ ├── Dockerfile │ │ ├── Gemfile │ │ ├── function │ │ ├── Gemfile │ │ └── handler.rb │ │ ├── index.rb │ │ └── template.yml └── venv │ ├── bin │ ├── activate │ ├── activate.csh │ ├── activate.fish │ ├── pip │ ├── pip3 │ ├── pip3.6 │ ├── python │ ├── python3 │ ├── python3.6 │ └── waitress-serve │ ├── lib │ └── python3.6 │ │ └── site-packages │ │ ├── _distutils_hack │ │ ├── __init__.py │ │ └── override.py │ │ ├── distutils-precedence.pth │ │ ├── pip-21.0.dist-info │ │ ├── INSTALLER │ │ ├── LICENSE.txt │ │ ├── METADATA │ │ ├── RECORD │ │ ├── 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 │ │ │ │ ├── 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 │ │ │ ├── langgreekmodel.py │ │ │ ├── langhebrewmodel.py │ │ │ ├── langhungarianmodel.py │ │ │ ├── langrussianmodel.py │ │ │ ├── langthaimodel.py │ │ │ ├── langturkishmodel.py │ │ │ ├── latin1prober.py │ │ │ ├── mbcharsetprober.py │ │ │ ├── mbcsgroupprober.py │ │ │ ├── mbcssm.py │ │ │ ├── metadata │ │ │ │ ├── __init__.py │ │ │ │ └── languages.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 │ │ │ ├── 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 │ │ ├── pkg_resources │ │ ├── __init__.py │ │ ├── _vendor │ │ │ ├── __init__.py │ │ │ ├── appdirs.py │ │ │ ├── packaging │ │ │ │ ├── __about__.py │ │ │ │ ├── __init__.py │ │ │ │ ├── _compat.py │ │ │ │ ├── _structures.py │ │ │ │ ├── _typing.py │ │ │ │ ├── markers.py │ │ │ │ ├── requirements.py │ │ │ │ ├── specifiers.py │ │ │ │ ├── tags.py │ │ │ │ ├── utils.py │ │ │ │ └── version.py │ │ │ └── pyparsing.py │ │ ├── extern │ │ │ └── __init__.py │ │ └── tests │ │ │ └── data │ │ │ └── my-test-package-source │ │ │ └── setup.py │ │ ├── setuptools-52.0.0.dist-info │ │ ├── INSTALLER │ │ ├── LICENSE │ │ ├── METADATA │ │ ├── RECORD │ │ ├── WHEEL │ │ ├── dependency_links.txt │ │ ├── entry_points.txt │ │ └── top_level.txt │ │ ├── setuptools │ │ ├── __init__.py │ │ ├── _deprecation_warning.py │ │ ├── _distutils │ │ │ ├── __init__.py │ │ │ ├── _msvccompiler.py │ │ │ ├── archive_util.py │ │ │ ├── bcppcompiler.py │ │ │ ├── ccompiler.py │ │ │ ├── cmd.py │ │ │ ├── command │ │ │ │ ├── __init__.py │ │ │ │ ├── bdist.py │ │ │ │ ├── bdist_dumb.py │ │ │ │ ├── bdist_msi.py │ │ │ │ ├── bdist_rpm.py │ │ │ │ ├── bdist_wininst.py │ │ │ │ ├── build.py │ │ │ │ ├── build_clib.py │ │ │ │ ├── build_ext.py │ │ │ │ ├── build_py.py │ │ │ │ ├── build_scripts.py │ │ │ │ ├── check.py │ │ │ │ ├── clean.py │ │ │ │ ├── config.py │ │ │ │ ├── install.py │ │ │ │ ├── install_data.py │ │ │ │ ├── install_egg_info.py │ │ │ │ ├── install_headers.py │ │ │ │ ├── install_lib.py │ │ │ │ ├── install_scripts.py │ │ │ │ ├── py37compat.py │ │ │ │ ├── register.py │ │ │ │ ├── sdist.py │ │ │ │ └── upload.py │ │ │ ├── config.py │ │ │ ├── core.py │ │ │ ├── cygwinccompiler.py │ │ │ ├── debug.py │ │ │ ├── dep_util.py │ │ │ ├── dir_util.py │ │ │ ├── dist.py │ │ │ ├── errors.py │ │ │ ├── extension.py │ │ │ ├── fancy_getopt.py │ │ │ ├── file_util.py │ │ │ ├── filelist.py │ │ │ ├── log.py │ │ │ ├── msvc9compiler.py │ │ │ ├── msvccompiler.py │ │ │ ├── py35compat.py │ │ │ ├── py38compat.py │ │ │ ├── spawn.py │ │ │ ├── sysconfig.py │ │ │ ├── text_file.py │ │ │ ├── unixccompiler.py │ │ │ ├── util.py │ │ │ ├── version.py │ │ │ └── versionpredicate.py │ │ ├── _imp.py │ │ ├── _vendor │ │ │ ├── __init__.py │ │ │ ├── ordered_set.py │ │ │ ├── packaging │ │ │ │ ├── __about__.py │ │ │ │ ├── __init__.py │ │ │ │ ├── _compat.py │ │ │ │ ├── _structures.py │ │ │ │ ├── _typing.py │ │ │ │ ├── markers.py │ │ │ │ ├── requirements.py │ │ │ │ ├── specifiers.py │ │ │ │ ├── tags.py │ │ │ │ ├── utils.py │ │ │ │ └── version.py │ │ │ └── pyparsing.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 │ │ ├── py34compat.py │ │ ├── sandbox.py │ │ ├── script (dev).tmpl │ │ ├── script.tmpl │ │ ├── ssl_support.py │ │ ├── unicode_utils.py │ │ ├── version.py │ │ ├── wheel.py │ │ └── windows_support.py │ │ ├── waitress-1.4.4.dist-info │ │ ├── INSTALLER │ │ ├── LICENSE.txt │ │ ├── METADATA │ │ ├── RECORD │ │ ├── REQUESTED │ │ ├── WHEEL │ │ ├── entry_points.txt │ │ └── top_level.txt │ │ └── waitress │ │ ├── __init__.py │ │ ├── __main__.py │ │ ├── adjustments.py │ │ ├── buffers.py │ │ ├── channel.py │ │ ├── compat.py │ │ ├── parser.py │ │ ├── proxy_headers.py │ │ ├── receiver.py │ │ ├── rfc7230.py │ │ ├── runner.py │ │ ├── server.py │ │ ├── task.py │ │ ├── trigger.py │ │ ├── utilities.py │ │ └── wasyncore.py │ ├── lib64 │ └── pyvenv.cfg └── template ├── csharp ├── .dockerignore ├── .gitignore ├── Dockerfile ├── Program.cs ├── function │ ├── .gitignore │ ├── Function.csproj │ └── FunctionHandler.cs ├── root.csproj └── template.yml ├── dockerfile ├── function │ └── Dockerfile └── template.yml ├── go ├── Dockerfile ├── function │ └── handler.go ├── go.mod ├── main.go └── template.yml ├── java11-vert-x ├── Dockerfile ├── README.md ├── build.gradle ├── entrypoint │ ├── build.gradle │ ├── settings.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── openfaas │ │ │ └── entrypoint │ │ │ └── App.java │ │ └── test │ │ └── java │ │ └── AppTest.java ├── function │ ├── build.gradle │ ├── settings.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── openfaas │ │ │ │ └── function │ │ │ │ └── Handler.java │ │ └── resources │ │ │ └── webroot │ │ │ └── index.html │ │ └── test │ │ └── java │ │ └── HandlerTest.java ├── settings.gradle └── template.yml ├── java11 ├── Dockerfile ├── README.md ├── build.gradle ├── function │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── openfaas │ │ │ └── function │ │ │ └── Handler.java │ │ └── test │ │ └── java │ │ └── HandlerTest.java ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── settings.gradle └── template.yml ├── node ├── .dockerignore ├── Dockerfile ├── function │ ├── handler.js │ └── package.json ├── index.js ├── package.json └── template.yml ├── node12 ├── .dockerignore ├── Dockerfile ├── function │ ├── handler.js │ └── package.json ├── index.js ├── package.json └── template.yml ├── php7 ├── Dockerfile ├── function │ ├── composer.json │ ├── php-extension.sh │ └── src │ │ └── Handler.php ├── index.php ├── php-extension.sh-example ├── readme.md └── template.yml ├── python ├── Dockerfile ├── function │ ├── handler.py │ └── requirements.txt ├── index.py ├── requirements.txt └── template.yml ├── python3-debian ├── Dockerfile ├── function │ ├── __init__.py │ ├── handler.py │ └── requirements.txt ├── index.py ├── requirements.txt └── template.yml ├── python3 ├── Dockerfile ├── function │ ├── __init__.py │ ├── handler.py │ └── requirements.txt ├── index.py ├── requirements.txt └── template.yml └── ruby ├── Dockerfile ├── Gemfile ├── function ├── Gemfile └── handler.rb ├── index.rb └── template.yml /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | .python-version 3 | **/*.sqlite3 4 | **/.env 5 | build 6 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /.idea/Python.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 12 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /strip-harbor.yml: -------------------------------------------------------------------------------- 1 | version: 1.0 2 | provider: 3 | name: openfaas 4 | gateway: https://gw.app.8gears.com 5 | 6 | functions: 7 | strip-harbor: 8 | lang: python-waitress 9 | handler: ./strip-harbor 10 | image: stage.c8n.io/striptest/strip-harbor:1.0 11 | environment: 12 | WSGI_APP: strip_harbor_api.wsgi:application 13 | -------------------------------------------------------------------------------- /strip-harbor/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /strip-harbor/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /strip-harbor/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | -------------------------------------------------------------------------------- /strip-harbor/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /strip-harbor/.idea/strip-harbor.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 14 | -------------------------------------------------------------------------------- /strip-harbor/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'strip_harbor_api.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /strip-harbor/requirements.txt: -------------------------------------------------------------------------------- 1 | django 2 | stripe 3 | django-environ 4 | mailersend -------------------------------------------------------------------------------- /strip-harbor/strip_harbor_api/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /strip-harbor/strip_harbor_api/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /strip-harbor/strip_harbor_api/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | -------------------------------------------------------------------------------- /strip-harbor/strip_harbor_api/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /strip-harbor/strip_harbor_api/.idea/strip_harbor_api.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /strip-harbor/strip_harbor_api/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/strip-harbor/strip_harbor_api/__init__.py -------------------------------------------------------------------------------- /strip-harbor/strip_harbor_api/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for strip_harbor_api project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'strip_harbor_api.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /strip-harbor/strip_harbor_api/urls.py: -------------------------------------------------------------------------------- 1 | """strip_harbor_api URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/3.1/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path 18 | from sync import views 19 | 20 | urlpatterns = [ 21 | #path('hello/', views.hello) 22 | path('admin/', admin.site.urls), 23 | path('payment', views.webhook_handler) 24 | ] 25 | -------------------------------------------------------------------------------- /strip-harbor/strip_harbor_api/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for strip_harbor_api project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'strip_harbor_api.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /strip-harbor/sync/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/strip-harbor/sync/__init__.py -------------------------------------------------------------------------------- /strip-harbor/sync/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import * 3 | # Register your models here. 4 | admin.site.register(Customer) -------------------------------------------------------------------------------- /strip-harbor/sync/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class SyncConfig(AppConfig): 5 | name = 'sync' 6 | -------------------------------------------------------------------------------- /strip-harbor/sync/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | import string 3 | import environ 4 | import stripe 5 | import logging as log 6 | import sync.harbor as h 7 | import json 8 | 9 | env = environ.Env(DEBUG=(bool, False)) 10 | stripe.api_key = env('STRIPE_API_KEY') 11 | 12 | 13 | class Customer(models.Model): 14 | email = models.CharField(max_length=70, null=True) 15 | name = models.CharField(max_length=70, null=True) 16 | stripe_id = models.CharField(max_length=70, null=True) 17 | harbor_login = models.CharField(max_length=70, null=True) 18 | 19 | def create_stripe_customer(self): 20 | if (not self.stripe_id) and self.email: 21 | customer = stripe.Customer.create(email=self.email) 22 | self.stripe_id = customer.id 23 | return self.stripe_id 24 | else: 25 | print("Could not create a Stripe customer") 26 | 27 | def ensure_email(self): 28 | if not self.email or not self.name: 29 | cust_data = stripe.Customer.retrieve(self.stripe_id) 30 | self.email = cust_data['email'] 31 | self.name = cust_data['name'] 32 | 33 | def create_harbor_user(self): 34 | harbor_account = h.create_harbor_user_from_customer(self.email, self.stripe_id, self.name) 35 | self.harbor_login = harbor_account['name'] 36 | self.save() 37 | -------------------------------------------------------------------------------- /strip-harbor/sync/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /template/python-waitress/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /template/python-waitress/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /template/python-waitress/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /template/python-waitress/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /template/python-waitress/.idea/python-waitress.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /template/python-waitress/function/requirements.txt: -------------------------------------------------------------------------------- 1 | django -------------------------------------------------------------------------------- /template/python-waitress/index.py: -------------------------------------------------------------------------------- 1 | import os 2 | from subprocess import check_output 3 | 4 | 5 | check_output( 6 | ["waitress-serve", "--listen", "0.0.0.0:5000", os.environ["WSGI_APP"]], 7 | cwd="/home/app/function", 8 | ) 9 | -------------------------------------------------------------------------------- /template/python-waitress/requirements.txt: -------------------------------------------------------------------------------- 1 | waitress -------------------------------------------------------------------------------- /template/python-waitress/template.yml: -------------------------------------------------------------------------------- 1 | language: python-waitress 2 | fprocess: python index.py 3 | -------------------------------------------------------------------------------- /template/python-waitress/template/csharp/.dockerignore: -------------------------------------------------------------------------------- 1 | bin 2 | obj 3 | -------------------------------------------------------------------------------- /template/python-waitress/template/csharp/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | -------------------------------------------------------------------------------- /template/python-waitress/template/csharp/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ghcr.io/openfaas/classic-watchdog:0.1.4 as watchdog 2 | 3 | FROM mcr.microsoft.com/dotnet/core/sdk:3.1 as builder 4 | 5 | # Supress collection of data. 6 | ENV DOTNET_CLI_TELEMETRY_OPTOUT 1 7 | 8 | # Optimize for Docker builder caching by adding projects first. 9 | 10 | RUN mkdir -p /home/app/src/function 11 | WORKDIR /home/app/src/function 12 | COPY ./function/Function.csproj . 13 | 14 | WORKDIR /home/app/src/ 15 | COPY ./root.csproj . 16 | RUN dotnet restore ./root.csproj 17 | 18 | COPY . . 19 | 20 | RUN dotnet publish -c release -o published 21 | 22 | FROM mcr.microsoft.com/dotnet/core/runtime:3.1 23 | 24 | COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog 25 | RUN chmod +x /usr/bin/fwatchdog 26 | 27 | # Create a non-root user 28 | RUN addgroup --system app \ 29 | && adduser --system --ingroup app app 30 | 31 | WORKDIR /home/app/ 32 | COPY --from=builder /home/app/src/published . 33 | RUN chown app:app -R /home/app 34 | 35 | USER app 36 | 37 | ENV fprocess="dotnet ./root.dll" 38 | EXPOSE 8080 39 | 40 | HEALTHCHECK --interval=3s CMD [ -e /tmp/.lock ] || exit 1 41 | 42 | CMD ["fwatchdog"] 43 | -------------------------------------------------------------------------------- /template/python-waitress/template/csharp/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Alex Ellis 2017. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | using System.Text; 6 | using Function; 7 | 8 | namespace root 9 | { 10 | class Program 11 | { 12 | static void Main(string[] args) 13 | { 14 | string buffer = Console.In.ReadToEnd(); 15 | FunctionHandler f = new FunctionHandler(); 16 | 17 | string responseValue = f.Handle(buffer); 18 | 19 | if(responseValue != null) { 20 | Console.Write(responseValue); 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /template/python-waitress/template/csharp/function/.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | obj/ 3 | .nuget/ 4 | .dotnet/ 5 | .templateengine/ 6 | -------------------------------------------------------------------------------- /template/python-waitress/template/csharp/function/Function.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | false 8 | 9 | 10 | -------------------------------------------------------------------------------- /template/python-waitress/template/csharp/function/FunctionHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | 4 | namespace Function 5 | { 6 | public class FunctionHandler 7 | { 8 | public string Handle(string input) { 9 | return $"Hi there - your input was: {input}\n"; 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /template/python-waitress/template/csharp/root.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | false 8 | 9 | 10 | 11 | 12 | 13 | 14 | Exe 15 | netcoreapp3.1 16 | 17 | 18 | false 19 | 20 | 21 | -------------------------------------------------------------------------------- /template/python-waitress/template/csharp/template.yml: -------------------------------------------------------------------------------- 1 | language: csharp 2 | fprocess: dotnet ./root.dll 3 | welcome_message: | 4 | You have created a C# function using the Classic OpenFaaS Template. 5 | 6 | To include third-party dependencies edit your .csproj file or install 7 | Nuget packages with VSCode. 8 | 9 | For high-throughput applications, we recommend using the csharp-kestrel 10 | or csharp-httprequest templates available in the OpenFaaS template 11 | store. -------------------------------------------------------------------------------- /template/python-waitress/template/dockerfile/function/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ghcr.io/openfaas/classic-watchdog:0.1.4 as watchdog 2 | 3 | FROM alpine:3.12 4 | 5 | RUN mkdir -p /home/app 6 | 7 | COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog 8 | RUN chmod +x /usr/bin/fwatchdog 9 | 10 | # Add non root user 11 | RUN addgroup -S app && adduser app -S -G app 12 | RUN chown app /home/app 13 | 14 | WORKDIR /home/app 15 | 16 | USER app 17 | 18 | # Populate example here - i.e. "cat", "sha512sum" or "node index.js" 19 | ENV fprocess="cat" 20 | # Set to true to see request in function logs 21 | ENV write_debug="false" 22 | 23 | EXPOSE 8080 24 | 25 | HEALTHCHECK --interval=3s CMD [ -e /tmp/.lock ] || exit 1 26 | 27 | CMD ["fwatchdog"] 28 | -------------------------------------------------------------------------------- /template/python-waitress/template/dockerfile/template.yml: -------------------------------------------------------------------------------- 1 | language: dockerfile 2 | -------------------------------------------------------------------------------- /template/python-waitress/template/go/function/handler.go: -------------------------------------------------------------------------------- 1 | package function 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | // Handle a serverless request 8 | func Handle(req []byte) string { 9 | return fmt.Sprintf("Hello, Go. You said: %s", string(req)) 10 | } 11 | -------------------------------------------------------------------------------- /template/python-waitress/template/go/go.mod: -------------------------------------------------------------------------------- 1 | module handler 2 | 3 | go 1.13 4 | 5 | replace handler/function => ./function 6 | -------------------------------------------------------------------------------- /template/python-waitress/template/go/main.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) Alex Ellis 2017. All rights reserved. 2 | // Copyright (c) OpenFaaS Author(s) 2018. All rights reserved. 3 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 4 | 5 | package main 6 | 7 | import ( 8 | "fmt" 9 | "io/ioutil" 10 | "log" 11 | "os" 12 | 13 | "handler/function" 14 | ) 15 | 16 | func main() { 17 | input, err := ioutil.ReadAll(os.Stdin) 18 | if err != nil { 19 | log.Fatalf("Unable to read standard input: %s", err.Error()) 20 | } 21 | 22 | fmt.Println(function.Handle(input)) 23 | } 24 | -------------------------------------------------------------------------------- /template/python-waitress/template/go/template.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | fprocess: ./handler 3 | build_options: 4 | - name: dev 5 | packages: 6 | - make 7 | - automake 8 | - gcc 9 | - g++ 10 | - subversion 11 | - python3-dev 12 | - musl-dev 13 | - libffi-dev 14 | - git 15 | - name: mysql 16 | packages: 17 | - mysql-client 18 | - mysql-dev 19 | welcome_message: | 20 | You have created a new function which uses Golang 1.13 and the Classic 21 | OpenFaaS template. 22 | 23 | To include third-party dependencies, use Go modules and use 24 | "--build-arg GO111MODULE=on" with faas-cli build or configure this 25 | via your stack.yml file. 26 | 27 | See more: https://docs.openfaas.com/cli/templates/ 28 | 29 | For high-throughput applications, we recommend using the golang-http 30 | or golang-middleware templates instead available via the store. 31 | -------------------------------------------------------------------------------- /template/python-waitress/template/java11-vert-x/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by the Gradle 'init' task. 3 | * 4 | * This is a general purpose Gradle build. 5 | * Learn how to create Gradle builds at https://guides.gradle.org/creating-new-gradle-builds/ 6 | */ 7 | 8 | allprojects { 9 | repositories { 10 | jcenter() 11 | } 12 | } 13 | 14 | subprojects { 15 | // apply plugin: 'java' 16 | 17 | version = '1.0' 18 | 19 | // jar { 20 | // manifest.attributes provider: 'gradle' 21 | // } 22 | } 23 | -------------------------------------------------------------------------------- /template/python-waitress/template/java11-vert-x/entrypoint/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by the Gradle 'init' task. 3 | * 4 | * This generated file contains a sample Java project to get you started. 5 | * For more details take a look at the Java Quickstart chapter in the Gradle 6 | * user guide available at https://docs.gradle.org/4.8.1/userguide/tutorial_java_projects.html 7 | */ 8 | 9 | plugins { 10 | // Apply the java plugin to add support for Java 11 | id 'java' 12 | 13 | // Apply the application plugin to add support for building an application 14 | id 'application' 15 | 16 | } 17 | 18 | // Define the main class for the application 19 | mainClassName = 'App' 20 | 21 | dependencies { 22 | // Vert.x project 23 | compile 'io.vertx:vertx-web:3.5.4' 24 | 25 | // Use JUnit test framework 26 | testCompile 'junit:junit:4.12' 27 | 28 | compile project(':function') 29 | } 30 | 31 | jar { 32 | manifest { 33 | attributes 'Implementation-Title': 'OpenFaaS Function', 34 | 'Implementation-Version': version 35 | } 36 | } 37 | 38 | // In this section you declare where to find the dependencies of your project 39 | repositories { 40 | // Use jcenter for resolving your dependencies. 41 | // You can declare any Maven/Ivy/file repository here. 42 | jcenter() 43 | } 44 | 45 | uploadArchives { 46 | repositories { 47 | flatDir { 48 | dirs 'repos' 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /template/python-waitress/template/java11-vert-x/entrypoint/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by the Gradle 'init' task. 3 | * 4 | * The settings file is used to specify which projects to include in your build. 5 | * 6 | * Detailed information about configuring a multi-project build in Gradle can be found 7 | * in the user guide at https://docs.gradle.org/4.8.1/userguide/multi_project_builds.html 8 | */ 9 | 10 | rootProject.name = 'entrypoint' 11 | -------------------------------------------------------------------------------- /template/python-waitress/template/java11-vert-x/entrypoint/src/test/java/AppTest.java: -------------------------------------------------------------------------------- 1 | public class AppTest { 2 | 3 | } -------------------------------------------------------------------------------- /template/python-waitress/template/java11-vert-x/function/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by the Gradle 'init' task. 3 | * 4 | * This generated file contains a sample Java Library project to get you started. 5 | * For more details take a look at the Java Libraries chapter in the Gradle 6 | * user guide available at https://docs.gradle.org/4.8.1/userguide/java_library_plugin.html 7 | */ 8 | 9 | plugins { 10 | // Apply the java-library plugin to add support for Java Library 11 | id 'java-library' 12 | } 13 | 14 | dependencies { 15 | // Vert.x project 16 | compile 'io.vertx:vertx-web:3.5.4' 17 | 18 | // Use JUnit test framework 19 | testImplementation 'junit:junit:4.12' 20 | } 21 | 22 | // In this section you declare where to find the dependencies of your project 23 | repositories { 24 | // Use jcenter for resolving your dependencies. 25 | // You can declare any Maven/Ivy/file repository here. 26 | jcenter() 27 | } 28 | -------------------------------------------------------------------------------- /template/python-waitress/template/java11-vert-x/function/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by the Gradle 'init' task. 3 | * 4 | * The settings file is used to specify which projects to include in your build. 5 | * 6 | * Detailed information about configuring a multi-project build in Gradle can be found 7 | * in the user guide at https://docs.gradle.org/4.8.1/userguide/multi_project_builds.html 8 | */ 9 | 10 | rootProject.name = 'function' 11 | -------------------------------------------------------------------------------- /template/python-waitress/template/java11-vert-x/function/src/main/java/com/openfaas/function/Handler.java: -------------------------------------------------------------------------------- 1 | package com.openfaas.function; 2 | 3 | import io.vertx.ext.web.RoutingContext; 4 | import io.vertx.core.json.JsonObject; 5 | 6 | public class Handler implements io.vertx.core.Handler { 7 | 8 | public void handle(RoutingContext routingContext) { 9 | routingContext.response() 10 | .putHeader("content-type", "application/json;charset=UTF-8") 11 | .end( 12 | new JsonObject() 13 | .put("status", "ok") 14 | .encodePrettily() 15 | ); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /template/python-waitress/template/java11-vert-x/function/src/main/resources/webroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | WebApp with Vert.x and Java 7 | 8 | 9 | 10 | 42 | 43 | 44 |
45 |
46 |

47 | WebApp with Vert.x and Java 48 |

49 |

50 | Hosted with ❤️ on OpenFaaS 51 |

52 |
53 |
54 | 55 | -------------------------------------------------------------------------------- /template/python-waitress/template/java11-vert-x/function/src/test/java/HandlerTest.java: -------------------------------------------------------------------------------- 1 | import org.junit.Test; 2 | import static org.junit.Assert.*; 3 | 4 | import com.openfaas.function.Handler; 5 | 6 | public class HandlerTest { 7 | @Test public void handlerIsNotNull() { 8 | Handler handler = new Handler(); 9 | assertTrue("Expected handler not to be null", handler != null); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /template/python-waitress/template/java11-vert-x/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by the Gradle 'init' task. 3 | * 4 | * The settings file is used to specify which projects to include in your build. 5 | * 6 | * Detailed information about configuring a multi-project build in Gradle can be found 7 | * in the user guide at https://docs.gradle.org/4.8.1/userguide/multi_project_builds.html 8 | */ 9 | 10 | rootProject.name = 'java8-vert-x' 11 | 12 | include 'function', 'entrypoint' 13 | -------------------------------------------------------------------------------- /template/python-waitress/template/java11-vert-x/template.yml: -------------------------------------------------------------------------------- 1 | language: java8-vert-x 2 | -------------------------------------------------------------------------------- /template/python-waitress/template/java11/README.md: -------------------------------------------------------------------------------- 1 | ## Template: java11 2 | 3 | The Java11 template uses gradle as a build system. 4 | 5 | Gradle version: 5.5.1 6 | 7 | ### Structure 8 | 9 | There are three projects which make up a single gradle build: 10 | 11 | - model - (Library) classes for parsing request/response 12 | - function - (Library) your function code as a developer, you will only ever see this folder 13 | - entrypoint - (App) HTTP server for re-using the JVM between requests 14 | 15 | ### Handler 16 | 17 | The handler is written in the `./src/main/Handler.java` folder 18 | 19 | Tests are supported with junit via files in `./src/test` 20 | 21 | ### External dependencies 22 | 23 | External dependencies can be specified in ./build.gradle in the normal way using jcenter, a local JAR or some other remote repository. 24 | 25 | -------------------------------------------------------------------------------- /template/python-waitress/template/java11/build.gradle: -------------------------------------------------------------------------------- 1 | allprojects { 2 | repositories { 3 | jcenter() 4 | } 5 | } 6 | 7 | subprojects { 8 | version = '1.0' 9 | } 10 | 11 | repositories { 12 | jcenter() 13 | 14 | flatDir { 15 | dirs 'libs' 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /template/python-waitress/template/java11/function/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/template/java11/function/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /template/python-waitress/template/java11/function/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /template/python-waitress/template/java11/function/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'function' 2 | -------------------------------------------------------------------------------- /template/python-waitress/template/java11/function/src/main/java/com/openfaas/function/Handler.java: -------------------------------------------------------------------------------- 1 | package com.openfaas.function; 2 | 3 | import com.openfaas.model.IHandler; 4 | import com.openfaas.model.IResponse; 5 | import com.openfaas.model.IRequest; 6 | import com.openfaas.model.Response; 7 | 8 | public class Handler extends com.openfaas.model.AbstractHandler { 9 | 10 | public IResponse Handle(IRequest req) { 11 | Response res = new Response(); 12 | res.setBody("Hello, world!"); 13 | 14 | return res; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /template/python-waitress/template/java11/function/src/test/java/HandlerTest.java: -------------------------------------------------------------------------------- 1 | import org.junit.Test; 2 | import static org.junit.Assert.*; 3 | 4 | import com.openfaas.function.Handler; 5 | import com.openfaas.model.IHandler; 6 | 7 | public class HandlerTest { 8 | @Test public void handlerIsNotNull() { 9 | IHandler handler = new Handler(); 10 | assertTrue("Expected handler not to be null", handler != null); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /template/python-waitress/template/java11/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/template/java11/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /template/python-waitress/template/java11/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /template/python-waitress/template/java11/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'java11' 2 | 3 | include 'model', 'function', 'entrypoint' 4 | -------------------------------------------------------------------------------- /template/python-waitress/template/java11/template.yml: -------------------------------------------------------------------------------- 1 | language: java11 2 | welcome_message: | 3 | You have created a function using the java11 template which uses an LTS 4 | version of the OpenJDK. 5 | -------------------------------------------------------------------------------- /template/python-waitress/template/node/.dockerignore: -------------------------------------------------------------------------------- 1 | */node_modules 2 | -------------------------------------------------------------------------------- /template/python-waitress/template/node/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/classic-watchdog:0.1.4 as watchdog 2 | FROM --platform=${TARGETPLATFORM:-linux/amd64} node:12-alpine as ship 3 | 4 | ARG TARGETPLATFORM 5 | ARG BUILDPLATFORM 6 | 7 | COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog 8 | RUN chmod +x /usr/bin/fwatchdog 9 | 10 | RUN addgroup -S app && adduser app -S -G app 11 | 12 | WORKDIR /root/ 13 | 14 | # Turn down the verbosity to default level. 15 | ENV NPM_CONFIG_LOGLEVEL warn 16 | 17 | RUN mkdir -p /home/app 18 | 19 | # Wrapper/boot-strapper 20 | WORKDIR /home/app 21 | COPY package.json ./ 22 | 23 | # This ordering means the npm installation is cached for the outer function handler. 24 | RUN npm i --production 25 | 26 | # Copy outer function handler 27 | COPY index.js ./ 28 | 29 | # COPY function node packages and install, adding this as a separate 30 | # entry allows caching of npm install runtime dependencies 31 | WORKDIR /home/app/function 32 | COPY function/*.json ./ 33 | RUN npm i --production || : 34 | 35 | # Copy in additional function files and folders 36 | COPY --chown=app:app function/ . 37 | 38 | WORKDIR /home/app/ 39 | 40 | # chmod for tmp is for a buildkit issue (@alexellis) 41 | RUN chmod +rx -R ./function \ 42 | && chown app:app -R /home/app \ 43 | && chmod 777 /tmp 44 | 45 | USER app 46 | 47 | ENV cgi_headers="true" 48 | ENV fprocess="node index.js" 49 | EXPOSE 8080 50 | 51 | HEALTHCHECK --interval=3s CMD [ -e /tmp/.lock ] || exit 1 52 | 53 | CMD ["fwatchdog"] 54 | -------------------------------------------------------------------------------- /template/python-waitress/template/node/function/handler.js: -------------------------------------------------------------------------------- 1 | "use strict" 2 | 3 | module.exports = async (context, callback) => { 4 | return {status: "done"} 5 | } 6 | -------------------------------------------------------------------------------- /template/python-waitress/template/node/function/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "function", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "handler.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC" 12 | } 13 | -------------------------------------------------------------------------------- /template/python-waitress/template/node/index.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) Alex Ellis 2017. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | "use strict" 5 | 6 | const getStdin = require('get-stdin'); 7 | 8 | const handler = require('./function/handler'); 9 | 10 | getStdin().then(val => { 11 | const cb = (err, res) => { 12 | if (err) { 13 | return console.error(err); 14 | } 15 | if (!res) { 16 | return; 17 | } 18 | if(Array.isArray(res) || isObject(res)) { 19 | console.log(JSON.stringify(res)); 20 | } else { 21 | process.stdout.write(res); 22 | } 23 | } // cb ... 24 | 25 | const result = handler(val, cb); 26 | if (result instanceof Promise) { 27 | result 28 | .then(data => cb(undefined, data)) 29 | .catch(err => cb(err, undefined)) 30 | ; 31 | } 32 | }).catch(e => { 33 | console.error(e.stack); 34 | }); 35 | 36 | const isObject = (a) => { 37 | return (!!a) && (a.constructor === Object); 38 | }; -------------------------------------------------------------------------------- /template/python-waitress/template/node/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "NodejsBase", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "faas_index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "get-stdin": "^5.0.1" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /template/python-waitress/template/node/template.yml: -------------------------------------------------------------------------------- 1 | language: node 2 | fprocess: node index.js 3 | welcome_message: | 4 | You have created a new function which uses Node.js 12.13.0 and the OpenFaaS 5 | Classic Watchdog. 6 | 7 | npm i --save can be used to add third-party packages like request or cheerio 8 | npm documentation: https://docs.npmjs.com/ 9 | 10 | For high-throughput services, we recommend you use the node12 template which 11 | uses a different version of the OpenFaaS watchdog. 12 | -------------------------------------------------------------------------------- /template/python-waitress/template/node12/.dockerignore: -------------------------------------------------------------------------------- 1 | */node_modules 2 | -------------------------------------------------------------------------------- /template/python-waitress/template/node12/function/handler.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = async (event, context) => { 4 | const result = { 5 | 'status': 'Received input: ' + JSON.stringify(event.body) 6 | } 7 | 8 | return context 9 | .status(200) 10 | .succeed(result) 11 | } 12 | 13 | -------------------------------------------------------------------------------- /template/python-waitress/template/node12/function/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "openfaas-function", 3 | "version": "1.0.0", 4 | "description": "OpenFaaS Function", 5 | "main": "handler.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 0" 8 | }, 9 | "keywords": [], 10 | "author": "OpenFaaS Ltd", 11 | "license": "MIT" 12 | } 13 | -------------------------------------------------------------------------------- /template/python-waitress/template/node12/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "openfaas-node12", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no tests specified\" && exit 0" 8 | }, 9 | "keywords": [], 10 | "author": "OpenFaaS Ltd", 11 | "license": "MIT", 12 | "dependencies": { 13 | "body-parser": "^1.18.2", 14 | "express": "^4.16.2" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /template/python-waitress/template/node12/template.yml: -------------------------------------------------------------------------------- 1 | language: node12 2 | fprocess: node index.js 3 | welcome_message: | 4 | You have created a new function which uses Node.js 12 (TLS) and the OpenFaaS 5 | of-watchdog which gives greater control over HTTP responses. 6 | 7 | npm i --save can be used to add third-party packages like request or cheerio 8 | npm documentation: https://docs.npmjs.com/ 9 | 10 | Unit tests are run at build time via "npm run", edit package.json to specify 11 | how you want to execute them. 12 | 13 | -------------------------------------------------------------------------------- /template/python-waitress/template/php7/function/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "openfaas/function-php7.2", 3 | "description": "Template for function in PHP 7.2", 4 | "type": "project", 5 | "license": "proprietary", 6 | "config": { 7 | "classmap-authoritative": true 8 | }, 9 | "autoload": { 10 | "psr-4": { 11 | "App\\": "src/" 12 | } 13 | }, 14 | "require": { 15 | "php": "^7.2" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /template/python-waitress/template/php7/function/php-extension.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Installing PHP extensions" 4 | 5 | # Add your extensions in here, an example is below 6 | # docker-php-ext-install mysqli 7 | # 8 | # See the template documentation for instructions on installing extensions; 9 | # - https://github.com/openfaas/templates/tree/master/template/php7 10 | # 11 | # You can also install any apk packages here 12 | -------------------------------------------------------------------------------- /template/python-waitress/template/php7/function/src/Handler.php: -------------------------------------------------------------------------------- 1 | handle($stdin); 10 | echo $response; 11 | -------------------------------------------------------------------------------- /template/python-waitress/template/php7/php-extension.sh-example: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Installing PHP extensions" 4 | docker-php-ext-install pdo_mysql 5 | 6 | # Install Phalcon 7 | PHALCON_VERSION=3.4.0 8 | PHALCON_EXT_PATH=php7/64bits 9 | 10 | set -xe && \ 11 | # Compile Phalcon 12 | curl -LO https://github.com/phalcon/cphalcon/archive/v${PHALCON_VERSION}.tar.gz && \ 13 | tar xzf ${PWD}/v${PHALCON_VERSION}.tar.gz && \ 14 | docker-php-ext-install -j $(getconf _NPROCESSORS_ONLN) ${PWD}/cphalcon-${PHALCON_VERSION}/build/${PHALCON_EXT_PATH} && \ 15 | # Remove all temp files 16 | rm -r \ 17 | ${PWD}/v${PHALCON_VERSION}.tar.gz \ 18 | ${PWD}/cphalcon-${PHALCON_VERSION} -------------------------------------------------------------------------------- /template/python-waitress/template/php7/template.yml: -------------------------------------------------------------------------------- 1 | language: php7 2 | fprocess: php index.php 3 | welcome_message: | 4 | You have created a new function which uses PHP 7.2. 5 | Dependencies and extensions can be added using the composer.json 6 | and php-extension.sh files. 7 | See https://github.com/openfaas/templates/blob/master/template/php7. 8 | -------------------------------------------------------------------------------- /template/python-waitress/template/python/function/handler.py: -------------------------------------------------------------------------------- 1 | def handle(req): 2 | """handle a request to the function 3 | Args: 4 | req (str): request body 5 | """ 6 | 7 | return req 8 | -------------------------------------------------------------------------------- /template/python-waitress/template/python/function/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/template/python/function/requirements.txt -------------------------------------------------------------------------------- /template/python-waitress/template/python/index.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Alex Ellis 2017. All rights reserved. 2 | # Copyright (c) OpenFaaS Author(s) 2018. All rights reserved. 3 | # Licensed under the MIT license. See LICENSE file in the project root for full license information. 4 | 5 | import sys 6 | from function import handler 7 | 8 | def get_stdin(): 9 | buf = "" 10 | for line in sys.stdin: 11 | buf = buf + line 12 | return buf 13 | 14 | if __name__ == "__main__": 15 | st = get_stdin() 16 | ret = handler.handle(st) 17 | if ret != None: 18 | print(ret) 19 | -------------------------------------------------------------------------------- /template/python-waitress/template/python/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/template/python/requirements.txt -------------------------------------------------------------------------------- /template/python-waitress/template/python/template.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | fprocess: python index.py 3 | build_options: 4 | - name: dev 5 | packages: 6 | - make 7 | - automake 8 | - gcc 9 | - g++ 10 | - subversion 11 | - python3-dev 12 | - musl-dev 13 | - libffi-dev 14 | - git 15 | - name: mysql 16 | packages: 17 | - mysql-client 18 | - mysql-dev 19 | - name: pillow 20 | packages: 21 | - jpeg-dev 22 | - zlib-dev 23 | - freetype-dev 24 | - lcms2-dev 25 | - openjpeg-dev 26 | - tiff-dev 27 | - tk-dev 28 | - tcl-dev 29 | - harfbuzz-dev 30 | - fribidi-dev 31 | -------------------------------------------------------------------------------- /template/python-waitress/template/python3-debian/function/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/template/python3-debian/function/__init__.py -------------------------------------------------------------------------------- /template/python-waitress/template/python3-debian/function/handler.py: -------------------------------------------------------------------------------- 1 | def handle(req): 2 | """handle a request to the function 3 | Args: 4 | req (str): request body 5 | """ 6 | 7 | return req 8 | -------------------------------------------------------------------------------- /template/python-waitress/template/python3-debian/function/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/template/python3-debian/function/requirements.txt -------------------------------------------------------------------------------- /template/python-waitress/template/python3-debian/index.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Alex Ellis 2017. All rights reserved. 2 | # Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | import sys 5 | from function import handler 6 | 7 | def get_stdin(): 8 | buf = "" 9 | while(True): 10 | line = sys.stdin.readline() 11 | buf += line 12 | if line=="": 13 | break 14 | return buf 15 | 16 | if(__name__ == "__main__"): 17 | st = get_stdin() 18 | ret = handler.handle(st) 19 | if ret != None: 20 | print(ret) 21 | -------------------------------------------------------------------------------- /template/python-waitress/template/python3-debian/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/template/python3-debian/requirements.txt -------------------------------------------------------------------------------- /template/python-waitress/template/python3-debian/template.yml: -------------------------------------------------------------------------------- 1 | language: python3-debian 2 | fprocess: python3 index.py 3 | -------------------------------------------------------------------------------- /template/python-waitress/template/python3/function/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/template/python3/function/__init__.py -------------------------------------------------------------------------------- /template/python-waitress/template/python3/function/handler.py: -------------------------------------------------------------------------------- 1 | def handle(req): 2 | """handle a request to the function 3 | Args: 4 | req (str): request body 5 | """ 6 | 7 | return req 8 | -------------------------------------------------------------------------------- /template/python-waitress/template/python3/function/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/template/python3/function/requirements.txt -------------------------------------------------------------------------------- /template/python-waitress/template/python3/index.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Alex Ellis 2017. All rights reserved. 2 | # Copyright (c) OpenFaaS Author(s) 2018. All rights reserved. 3 | # Licensed under the MIT license. See LICENSE file in the project root for full license information. 4 | 5 | import sys 6 | from function import handler 7 | 8 | def get_stdin(): 9 | buf = "" 10 | while(True): 11 | line = sys.stdin.readline() 12 | buf += line 13 | if line == "": 14 | break 15 | return buf 16 | 17 | if __name__ == "__main__": 18 | st = get_stdin() 19 | ret = handler.handle(st) 20 | if ret != None: 21 | print(ret) 22 | -------------------------------------------------------------------------------- /template/python-waitress/template/python3/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/template/python3/requirements.txt -------------------------------------------------------------------------------- /template/python-waitress/template/python3/template.yml: -------------------------------------------------------------------------------- 1 | language: python3 2 | fprocess: python3 index.py 3 | build_options: 4 | - name: dev 5 | packages: 6 | - make 7 | - automake 8 | - gcc 9 | - g++ 10 | - subversion 11 | - python3-dev 12 | - musl-dev 13 | - libffi-dev 14 | - git 15 | - name: mysql 16 | packages: 17 | - mysql-client 18 | - mysql-dev 19 | - name: pillow 20 | packages: 21 | - jpeg-dev 22 | - zlib-dev 23 | - freetype-dev 24 | - lcms2-dev 25 | - openjpeg-dev 26 | - tiff-dev 27 | - tk-dev 28 | - tcl-dev 29 | - harfbuzz-dev 30 | - fribidi-dev 31 | welcome_message: | 32 | You have created a Python3 function using the Classic Watchdog. 33 | 34 | To include third-party dependencies create a requirements.txt file. 35 | 36 | For high-throughput applications, we recommend using the python3-flask 37 | or python3-http templates. 38 | -------------------------------------------------------------------------------- /template/python-waitress/template/ruby/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/classic-watchdog:0.1.4 as watchdog 2 | FROM --platform=${TARGETPLATFORM:-linux/amd64} ruby:alpine 3 | 4 | ARG TARGETPLATFORM 5 | ARG BUILDPLATFORM 6 | 7 | COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog 8 | RUN chmod +x /usr/bin/fwatchdog 9 | 10 | ARG ADDITIONAL_PACKAGE 11 | 12 | # Alternatively use ADD https:// (which will not be cached by Docker builder) 13 | RUN apk --no-cache add ${ADDITIONAL_PACKAGE} 14 | 15 | WORKDIR /home/app 16 | 17 | COPY Gemfile . 18 | COPY index.rb . 19 | COPY function function 20 | 21 | RUN bundle install \ 22 | && mkdir -p /home/app/function 23 | 24 | WORKDIR /home/app/function 25 | 26 | RUN bundle install 27 | 28 | RUN addgroup -S app \ 29 | && adduser app -S -G app 30 | 31 | RUN chown app:app -R /home/app 32 | 33 | USER app 34 | 35 | WORKDIR /home/app 36 | 37 | ENV fprocess="ruby index.rb" 38 | EXPOSE 8080 39 | 40 | HEALTHCHECK --interval=2s CMD [ -e /tmp/.lock ] || exit 1 41 | 42 | CMD ["fwatchdog"] 43 | -------------------------------------------------------------------------------- /template/python-waitress/template/ruby/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | -------------------------------------------------------------------------------- /template/python-waitress/template/ruby/function/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | -------------------------------------------------------------------------------- /template/python-waitress/template/ruby/function/handler.rb: -------------------------------------------------------------------------------- 1 | class Handler 2 | def run(req) 3 | return "Hello world from the Ruby template" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /template/python-waitress/template/ruby/index.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) Alex Ellis 2017. All rights reserved. 2 | # Copyright (c) OpenFaaS Author(s) 2018. All rights reserved. 3 | # Licensed under the MIT license. See LICENSE file in the project root for full license information. 4 | 5 | require_relative 'function/handler' 6 | 7 | req = ARGF.read 8 | 9 | handler = Handler.new 10 | res = handler.run req 11 | 12 | puts res 13 | -------------------------------------------------------------------------------- /template/python-waitress/template/ruby/template.yml: -------------------------------------------------------------------------------- 1 | language: ruby 2 | fprocess: ruby index.rb 3 | build_options: 4 | - name: dev 5 | packages: 6 | - make 7 | - automake 8 | - gcc 9 | - g++ 10 | - subversion 11 | - python3-dev 12 | - musl-dev 13 | - libffi-dev 14 | - libssh 15 | - libssh-dev 16 | welcome_message: | 17 | You have created a Ruby function using the Classic Watchdog. 18 | 19 | To include third-party dependencies create a Gemfile. You can also 20 | include developer-dependencies using the "dev" build_option. 21 | 22 | For high-throughput applications, we recommend using the ruby-http 23 | template. 24 | -------------------------------------------------------------------------------- /template/python-waitress/venv/bin/activate.csh: -------------------------------------------------------------------------------- 1 | # This file must be used with "source bin/activate.csh" *from csh*. 2 | # You cannot run it directly. 3 | # Created by Davide Di Blasi . 4 | # Ported to Python 3.3 venv by Andrew Svetlov 5 | 6 | alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate' 7 | 8 | # Unset irrelevant variables. 9 | deactivate nondestructive 10 | 11 | setenv VIRTUAL_ENV "/media/dev18/Data/Projects/Python/template/python-waitress/venv" 12 | 13 | set _OLD_VIRTUAL_PATH="$PATH" 14 | setenv PATH "$VIRTUAL_ENV/bin:$PATH" 15 | 16 | 17 | set _OLD_VIRTUAL_PROMPT="$prompt" 18 | 19 | if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then 20 | if ("venv" != "") then 21 | set env_name = "venv" 22 | else 23 | if (`basename "VIRTUAL_ENV"` == "__") then 24 | # special case for Aspen magic directories 25 | # see http://www.zetadev.com/software/aspen/ 26 | set env_name = `basename \`dirname "$VIRTUAL_ENV"\`` 27 | else 28 | set env_name = `basename "$VIRTUAL_ENV"` 29 | endif 30 | endif 31 | set prompt = "[$env_name] $prompt" 32 | unset env_name 33 | endif 34 | 35 | alias pydoc python -m pydoc 36 | 37 | rehash 38 | -------------------------------------------------------------------------------- /template/python-waitress/venv/bin/pip: -------------------------------------------------------------------------------- 1 | #!/media/dev18/Data/Projects/Python/template/python-waitress/venv/bin/python 2 | # -*- coding: utf-8 -*- 3 | import re 4 | import sys 5 | from pip._internal.cli.main import main 6 | if __name__ == '__main__': 7 | sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) 8 | sys.exit(main()) 9 | -------------------------------------------------------------------------------- /template/python-waitress/venv/bin/pip3: -------------------------------------------------------------------------------- 1 | #!/media/dev18/Data/Projects/Python/template/python-waitress/venv/bin/python 2 | # -*- coding: utf-8 -*- 3 | import re 4 | import sys 5 | from pip._internal.cli.main import main 6 | if __name__ == '__main__': 7 | sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) 8 | sys.exit(main()) 9 | -------------------------------------------------------------------------------- /template/python-waitress/venv/bin/pip3.6: -------------------------------------------------------------------------------- 1 | #!/media/dev18/Data/Projects/Python/template/python-waitress/venv/bin/python 2 | # -*- coding: utf-8 -*- 3 | import re 4 | import sys 5 | from pip._internal.cli.main import main 6 | if __name__ == '__main__': 7 | sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) 8 | sys.exit(main()) 9 | -------------------------------------------------------------------------------- /template/python-waitress/venv/bin/python: -------------------------------------------------------------------------------- 1 | python3.6 -------------------------------------------------------------------------------- /template/python-waitress/venv/bin/python3: -------------------------------------------------------------------------------- 1 | python3.6 -------------------------------------------------------------------------------- /template/python-waitress/venv/bin/python3.6: -------------------------------------------------------------------------------- 1 | /usr/bin/python3.6 -------------------------------------------------------------------------------- /template/python-waitress/venv/bin/waitress-serve: -------------------------------------------------------------------------------- 1 | #!/media/dev18/Data/Projects/Python/template/python-waitress/venv/bin/python 2 | # -*- coding: utf-8 -*- 3 | import re 4 | import sys 5 | from waitress.runner import run 6 | if __name__ == '__main__': 7 | sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) 8 | sys.exit(run()) 9 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/_distutils_hack/override.py: -------------------------------------------------------------------------------- 1 | __import__('_distutils_hack').do_override() 2 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/distutils-precedence.pth: -------------------------------------------------------------------------------- 1 | import os; var = 'SETUPTOOLS_USE_DISTUTILS'; enabled = os.environ.get(var, 'stdlib') == 'local'; enabled and __import__('_distutils_hack').add_shim(); 2 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip-21.0.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pip 2 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip-21.0.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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip-21.0.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.34.2) 3 | Root-Is-Purelib: true 4 | Tag: py3-none-any 5 | 6 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip-21.0.dist-info/entry_points.txt: -------------------------------------------------------------------------------- 1 | [console_scripts] 2 | pip = pip._internal.cli.main:main 3 | pip3 = pip._internal.cli.main:main 4 | pip3.8 = pip._internal.cli.main:main 5 | 6 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip-21.0.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | pip 2 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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__ = "21.0" 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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/__main__.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | # Remove '' and current working directory from the first entry 5 | # of sys.path, if present to avoid using current directory 6 | # in pip commands check, freeze, install, list and show, 7 | # when invoked as python -m pip 8 | if sys.path[0] in ('', os.getcwd()): 9 | sys.path.pop(0) 10 | 11 | # If we are running from a wheel, add the wheel to sys.path 12 | # This allows the usage python pip-*.whl/pip install pip-*.whl 13 | if __package__ == '': 14 | # __file__ is pip-*.whl/pip/__main__.py 15 | # first dirname call strips of '/__main__.py', second strips off '/pip' 16 | # Resulting path is the name of the wheel itself 17 | # Add that to sys.path so we can import pip 18 | path = os.path.dirname(os.path.dirname(__file__)) 19 | sys.path.insert(0, path) 20 | 21 | from pip._internal.cli.main import main as _main 22 | 23 | if __name__ == '__main__': 24 | sys.exit(_main()) 25 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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: 14 | def __init__(self): 15 | # type: () -> None 16 | super().__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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/cli/status_codes.py: -------------------------------------------------------------------------------- 1 | SUCCESS = 0 2 | ERROR = 1 3 | UNKNOWN_ERROR = 2 4 | VIRTUALENV_NOT_FOUND = 3 5 | PREVIOUS_BUILD_DIR_ERROR = 4 6 | NO_MATCHES_FOUND = 23 7 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/commands/help.py: -------------------------------------------------------------------------------- 1 | from pip._internal.cli.base_command import Command 2 | from pip._internal.cli.status_codes import SUCCESS 3 | from pip._internal.exceptions import CommandError 4 | from pip._internal.utils.typing import MYPY_CHECK_RUNNING 5 | 6 | if MYPY_CHECK_RUNNING: 7 | from optparse import Values 8 | from typing import List 9 | 10 | 11 | class HelpCommand(Command): 12 | """Show help for commands""" 13 | 14 | usage = """ 15 | %prog """ 16 | ignore_require_venv = True 17 | 18 | def run(self, options, args): 19 | # type: (Values, List[str]) -> int 20 | from pip._internal.commands import ( 21 | commands_dict, 22 | create_command, 23 | get_similar_commands, 24 | ) 25 | 26 | try: 27 | # 'pip help' with no args is handled by pip.__init__.parseopt() 28 | cmd_name = args[0] # the command we need help for 29 | except IndexError: 30 | return SUCCESS 31 | 32 | if cmd_name not in commands_dict: 33 | guess = get_similar_commands(cmd_name) 34 | 35 | msg = [f'unknown command "{cmd_name}"'] 36 | if guess: 37 | msg.append(f'maybe you meant "{guess}"') 38 | 39 | raise CommandError(' - '.join(msg)) 40 | 41 | command = create_command(cmd_name) 42 | command.parser.print_help() 43 | 44 | return SUCCESS 45 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/distributions/wheel.py: -------------------------------------------------------------------------------- 1 | from zipfile import ZipFile 2 | 3 | from pip._internal.distributions.base import AbstractDistribution 4 | from pip._internal.utils.typing import MYPY_CHECK_RUNNING 5 | from pip._internal.utils.wheel import pkg_resources_distribution_for_wheel 6 | 7 | if MYPY_CHECK_RUNNING: 8 | from pip._vendor.pkg_resources import Distribution 9 | 10 | from pip._internal.index.package_finder import PackageFinder 11 | 12 | 13 | class WheelDistribution(AbstractDistribution): 14 | """Represents a wheel distribution. 15 | 16 | This does not need any preparation as wheels can be directly unpacked. 17 | """ 18 | 19 | def get_pkg_resources_distribution(self): 20 | # type: () -> Distribution 21 | """Loads the metadata from the wheel file into memory and returns a 22 | Distribution that uses it, not relying on the wheel file or 23 | requirement. 24 | """ 25 | # Set as part of preparation during download. 26 | assert self.req.local_file_path 27 | # Wheels are never unnamed. 28 | assert self.req.name 29 | 30 | with ZipFile(self.req.local_file_path, allowZip64=True) as z: 31 | return pkg_resources_distribution_for_wheel( 32 | z, self.req.name, self.req.local_file_path 33 | ) 34 | 35 | def prepare_distribution_metadata(self, finder, build_isolation): 36 | # type: (PackageFinder, bool) -> None 37 | pass 38 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/index/__init__.py: -------------------------------------------------------------------------------- 1 | """Index interaction code 2 | """ 3 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/models/__init__.py: -------------------------------------------------------------------------------- 1 | """A package that contains models that represent entities. 2 | """ 3 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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().__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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/models/index.py: -------------------------------------------------------------------------------- 1 | import urllib.parse 2 | 3 | 4 | class PackageIndex: 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().__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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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: 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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/network/__init__.py: -------------------------------------------------------------------------------- 1 | """Contains purely network-related utilities. 2 | """ 3 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/operations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/operations/__init__.py -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/operations/install/__init__.py: -------------------------------------------------------------------------------- 1 | """For modules related to installing packages. 2 | """ 3 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/resolution/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/resolution/__init__.py -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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: 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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/resolution/legacy/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/resolution/legacy/__init__.py -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/__init__.py -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/utils/__init__.py -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/utils/datetime.py: -------------------------------------------------------------------------------- 1 | """For when pip wants to check the date or time. 2 | """ 3 | 4 | import datetime 5 | 6 | 7 | def today_is_later_than(year, month, day): 8 | # type: (int, int, int) -> bool 9 | today = datetime.date.today() 10 | given = datetime.date(year, month, day) 11 | 12 | return today > given 13 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/utils/models.py: -------------------------------------------------------------------------------- 1 | """Utilities for defining models 2 | """ 3 | # The following comment should be removed at some point in the future. 4 | # mypy: disallow-untyped-defs=False 5 | 6 | import operator 7 | 8 | 9 | class KeyBasedCompareMixin: 10 | """Provides comparison capabilities that is based on a key 11 | """ 12 | 13 | __slots__ = ['_compare_key', '_defining_class'] 14 | 15 | def __init__(self, key, defining_class): 16 | self._compare_key = key 17 | self._defining_class = defining_class 18 | 19 | def __hash__(self): 20 | return hash(self._compare_key) 21 | 22 | def __lt__(self, other): 23 | return self._compare(other, operator.__lt__) 24 | 25 | def __le__(self, other): 26 | return self._compare(other, operator.__le__) 27 | 28 | def __gt__(self, other): 29 | return self._compare(other, operator.__gt__) 30 | 31 | def __ge__(self, other): 32 | return self._compare(other, operator.__ge__) 33 | 34 | def __eq__(self, other): 35 | return self._compare(other, operator.__eq__) 36 | 37 | def _compare(self, other, method): 38 | if not isinstance(other, self._defining_class): 39 | return NotImplemented 40 | 41 | return method(self._compare_key, other._compare_key) 42 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/utils/pkg_resources.py: -------------------------------------------------------------------------------- 1 | from pip._vendor.pkg_resources import yield_lines 2 | from pip._vendor.six import ensure_str 3 | 4 | from pip._internal.utils.typing import MYPY_CHECK_RUNNING 5 | 6 | if MYPY_CHECK_RUNNING: 7 | from typing import Dict, Iterable, List 8 | 9 | 10 | class DictMetadata: 11 | """IMetadataProvider that reads metadata files from a dictionary. 12 | """ 13 | def __init__(self, metadata): 14 | # type: (Dict[str, bytes]) -> None 15 | self._metadata = metadata 16 | 17 | def has_metadata(self, name): 18 | # type: (str) -> bool 19 | return name in self._metadata 20 | 21 | def get_metadata(self, name): 22 | # type: (str) -> str 23 | try: 24 | return ensure_str(self._metadata[name]) 25 | except UnicodeDecodeError as e: 26 | # Mirrors handling done in pkg_resources.NullProvider. 27 | e.reason += f" in {name} file" 28 | raise 29 | 30 | def get_metadata_lines(self, name): 31 | # type: (str) -> Iterable[str] 32 | return yield_lines(self.get_metadata(name)) 33 | 34 | def metadata_isdir(self, name): 35 | # type: (str) -> bool 36 | return False 37 | 38 | def metadata_listdir(self, name): 39 | # type: (str) -> List[str] 40 | return [] 41 | 42 | def run_script(self, script_name, namespace): 43 | # type: (str, str) -> None 44 | pass 45 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/cachecontrol/caches/__init__.py: -------------------------------------------------------------------------------- 1 | from .file_cache import FileCache # noqa 2 | from .redis_cache import RedisCache # noqa 3 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/certifi/__init__.py: -------------------------------------------------------------------------------- 1 | from .core import contents, where 2 | 3 | __version__ = "2020.12.05" 4 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/chardet/cli/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | string_types = (str, unicode) 29 | text_type = unicode 30 | iteritems = dict.iteritems 31 | else: 32 | PY2 = False 33 | PY3 = True 34 | string_types = (bytes, str) 35 | text_type = str 36 | iteritems = dict.items 37 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/chardet/metadata/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/chardet/metadata/__init__.py -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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__ = "4.0.0" 9 | VERSION = __version__.split('.') 10 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/distlib/t32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/distlib/t32.exe -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/distlib/t64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/distlib/t64.exe -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/distlib/w32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/distlib/w32.exe -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/distlib/w64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/distlib/w64.exe -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/html5lib/filters/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/html5lib/filters/__init__.py -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/html5lib/filters/whitespace.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | import re 4 | 5 | from . import base 6 | from ..constants import rcdataElements, spaceCharacters 7 | spaceCharacters = "".join(spaceCharacters) 8 | 9 | SPACES_REGEX = re.compile("[%s]+" % spaceCharacters) 10 | 11 | 12 | class Filter(base.Filter): 13 | """Collapses whitespace except in pre, textarea, and script elements""" 14 | spacePreserveElements = frozenset(["pre", "textarea"] + list(rcdataElements)) 15 | 16 | def __iter__(self): 17 | preserve = 0 18 | for token in base.Filter.__iter__(self): 19 | type = token["type"] 20 | if type == "StartTag" \ 21 | and (preserve or token["name"] in self.spacePreserveElements): 22 | preserve += 1 23 | 24 | elif type == "EndTag" and preserve: 25 | preserve -= 1 26 | 27 | elif not preserve and type == "SpaceCharacters" and token["data"]: 28 | # Test on token["data"] above to not introduce spaces where there were not 29 | token["data"] = " " 30 | 31 | elif not preserve and type == "Characters": 32 | token["data"] = collapse_spaces(token["data"]) 33 | 34 | yield token 35 | 36 | 37 | def collapse_spaces(text): 38 | return SPACES_REGEX.sub(' ', text) 39 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/idna/__init__.py: -------------------------------------------------------------------------------- 1 | from .package_data import __version__ 2 | from .core import * 3 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/idna/package_data.py: -------------------------------------------------------------------------------- 1 | __version__ = '2.10' 2 | 3 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/msgpack/_version.py: -------------------------------------------------------------------------------- 1 | version = (1, 0, 2) 2 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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.8" 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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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.1' 9 | __build__ = 0x022501 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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/resolvelib/compat/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/resolvelib/compat/__init__.py -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/urllib3/_version.py: -------------------------------------------------------------------------------- 1 | # This file is protected via CODEOWNERS 2 | __version__ = "1.26.2" 3 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/urllib3/contrib/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/urllib3/contrib/__init__.py -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__init__.py -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/urllib3/packages/backports/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/urllib3/packages/backports/__init__.py -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | msgpack==1.0.2 9 | packaging==20.8 10 | pep517==0.9.1 11 | progress==1.5 12 | pyparsing==2.4.7 13 | requests==2.25.1 14 | certifi==2020.12.05 15 | chardet==4.0.0 16 | idna==2.10 17 | urllib3==1.26.2 18 | resolvelib==0.5.4 19 | retrying==1.3.3 20 | setuptools==44.0.0 21 | six==1.15.0 22 | toml==0.10.2 23 | webencodings==0.5.1 24 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pkg_resources/_vendor/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/venv/lib/python3.6/site-packages/pkg_resources/_vendor/__init__.py -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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__", 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.4" 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__ = "Copyright 2014-2019 %s" % __author__ 28 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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__, 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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | 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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/pkg_resources/tests/data/my-test-package-source/setup.py: -------------------------------------------------------------------------------- 1 | import setuptools 2 | setuptools.setup( 3 | name="my-test-package", 4 | version="1.0", 5 | zip_safe=True, 6 | ) 7 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/setuptools-52.0.0.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pip 2 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/setuptools-52.0.0.dist-info/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright Jason R. Coombs 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to 5 | deal in the Software without restriction, including without limitation the 6 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | sell copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all 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 18 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | IN THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/setuptools-52.0.0.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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/setuptools-52.0.0.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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/setuptools-52.0.0.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | _distutils_hack 2 | dist 3 | pkg_resources 4 | setuptools 5 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/setuptools/_distutils/__init__.py: -------------------------------------------------------------------------------- 1 | """distutils 2 | 3 | The main package for the Python Module Distribution Utilities. Normally 4 | used from a setup script as 5 | 6 | from distutils.core import setup 7 | 8 | setup (...) 9 | """ 10 | 11 | import sys 12 | 13 | __version__ = sys.version[:sys.version.index(' ')] 14 | 15 | local = True 16 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/setuptools/_distutils/command/__init__.py: -------------------------------------------------------------------------------- 1 | """distutils.command 2 | 3 | Package containing implementation of all the standard Distutils 4 | commands.""" 5 | 6 | __all__ = ['build', 7 | 'build_py', 8 | 'build_ext', 9 | 'build_clib', 10 | 'build_scripts', 11 | 'clean', 12 | 'install', 13 | 'install_lib', 14 | 'install_headers', 15 | 'install_scripts', 16 | 'install_data', 17 | 'sdist', 18 | 'register', 19 | 'bdist', 20 | 'bdist_dumb', 21 | 'bdist_rpm', 22 | 'bdist_wininst', 23 | 'check', 24 | 'upload', 25 | # These two are reserved for future use: 26 | #'bdist_sdux', 27 | #'bdist_pkgtool', 28 | # Note: 29 | # bdist_packager is not included because it only provides 30 | # an abstract base class 31 | ] 32 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/setuptools/_distutils/command/py37compat.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | 4 | def _pythonlib_compat(): 5 | """ 6 | On Python 3.7 and earlier, distutils would include the Python 7 | library. See pypa/distutils#9. 8 | """ 9 | from distutils import sysconfig 10 | if not sysconfig.get_config_var('Py_ENABLED_SHARED'): 11 | return 12 | 13 | yield 'python{}.{}{}'.format( 14 | sys.hexversion >> 24, 15 | (sys.hexversion >> 16) & 0xff, 16 | sysconfig.get_config_var('ABIFLAGS'), 17 | ) 18 | 19 | 20 | def compose(f1, f2): 21 | return lambda *args, **kwargs: f1(f2(*args, **kwargs)) 22 | 23 | 24 | pythonlib = ( 25 | compose(list, _pythonlib_compat) 26 | if sys.version_info < (3, 8) 27 | and sys.platform != 'darwin' 28 | and sys.platform[:3] != 'aix' 29 | else list 30 | ) 31 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/setuptools/_distutils/debug.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | # If DISTUTILS_DEBUG is anything other than the empty string, we run in 4 | # debug mode. 5 | DEBUG = os.environ.get('DISTUTILS_DEBUG') 6 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/setuptools/_distutils/py35compat.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import subprocess 3 | 4 | 5 | def __optim_args_from_interpreter_flags(): 6 | """Return a list of command-line arguments reproducing the current 7 | optimization settings in sys.flags.""" 8 | args = [] 9 | value = sys.flags.optimize 10 | if value > 0: 11 | args.append("-" + "O" * value) 12 | return args 13 | 14 | 15 | _optim_args_from_interpreter_flags = getattr( 16 | subprocess, 17 | "_optim_args_from_interpreter_flags", 18 | __optim_args_from_interpreter_flags, 19 | ) 20 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/setuptools/_distutils/py38compat.py: -------------------------------------------------------------------------------- 1 | def aix_platform(osname, version, release): 2 | try: 3 | import _aix_support 4 | return _aix_support.aix_platform() 5 | except ImportError: 6 | pass 7 | return "%s-%s.%s" % (osname, version, release) 8 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/setuptools/_vendor/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/venv/lib/python3.6/site-packages/setuptools/_vendor/__init__.py -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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__ = "20.4" 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__ = "Copyright 2014-2019 %s" % __author__ 28 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | 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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/setuptools/cli-32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/venv/lib/python3.6/site-packages/setuptools/cli-32.exe -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/setuptools/cli-64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/venv/lib/python3.6/site-packages/setuptools/cli-64.exe -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/setuptools/cli.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/venv/lib/python3.6/site-packages/setuptools/cli.exe -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | from setuptools.command import install_scripts 12 | 13 | if 'egg' not in bdist.format_commands: 14 | bdist.format_command['egg'] = ('bdist_egg', "Python .egg file") 15 | bdist.format_commands.append('egg') 16 | 17 | del bdist, sys 18 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/setuptools/command/bdist_rpm.py: -------------------------------------------------------------------------------- 1 | import distutils.command.bdist_rpm as orig 2 | 3 | 4 | class bdist_rpm(orig.bdist_rpm): 5 | """ 6 | Override the default bdist_rpm behavior to do the following: 7 | 8 | 1. Run egg_info to ensure the name and version are properly calculated. 9 | 2. Always run 'install' using --single-version-externally-managed to 10 | disable eggs in RPM distributions. 11 | """ 12 | 13 | def run(self): 14 | # ensure distro name is up-to-date 15 | self.run_command('egg_info') 16 | 17 | orig.bdist_rpm.run(self) 18 | 19 | def _make_spec_file(self): 20 | spec = orig.bdist_rpm._make_spec_file(self) 21 | spec = [ 22 | line.replace( 23 | "setup.py install ", 24 | "setup.py install --single-version-externally-managed " 25 | ).replace( 26 | "%setup", 27 | "%setup -n %{name}-%{unmangled_version}" 28 | ) 29 | for line in spec 30 | ] 31 | return spec 32 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/setuptools/command/bdist_wininst.py: -------------------------------------------------------------------------------- 1 | import distutils.command.bdist_wininst as orig 2 | import warnings 3 | 4 | from setuptools import SetuptoolsDeprecationWarning 5 | 6 | 7 | class bdist_wininst(orig.bdist_wininst): 8 | def reinitialize_command(self, command, reinit_subcommands=0): 9 | """ 10 | Supplement reinitialize_command to work around 11 | http://bugs.python.org/issue20819 12 | """ 13 | cmd = self.distribution.reinitialize_command( 14 | command, reinit_subcommands) 15 | if command in ('install', 'install_lib'): 16 | cmd.install_lib = None 17 | return cmd 18 | 19 | def run(self): 20 | warnings.warn( 21 | "bdist_wininst is deprecated and will be removed in a future " 22 | "version. Use bdist_wheel (wheel packages) instead.", 23 | SetuptoolsDeprecationWarning 24 | ) 25 | 26 | self._is_running = True 27 | try: 28 | orig.bdist_wininst.run(self) 29 | finally: 30 | self._is_running = False 31 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/setuptools/command/launcher manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/setuptools/command/register.py: -------------------------------------------------------------------------------- 1 | from distutils import log 2 | import distutils.command.register as orig 3 | 4 | from setuptools.errors import RemovedCommandError 5 | 6 | 7 | class register(orig.register): 8 | """Formerly used to register packages on PyPI.""" 9 | 10 | def run(self): 11 | msg = ( 12 | "The register command has been removed, use twine to upload " 13 | + "instead (https://pypi.org/p/twine)" 14 | ) 15 | 16 | self.announce("ERROR: " + msg, log.ERROR) 17 | 18 | raise RemovedCommandError(msg) 19 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/setuptools/command/saveopts.py: -------------------------------------------------------------------------------- 1 | from setuptools.command.setopt import edit_config, option_base 2 | 3 | 4 | class saveopts(option_base): 5 | """Save command-line options to a file""" 6 | 7 | description = "save supplied options to setup.cfg or other config file" 8 | 9 | def run(self): 10 | dist = self.distribution 11 | settings = {} 12 | 13 | for cmd in dist.command_options: 14 | 15 | if cmd == 'saveopts': 16 | continue # don't save our own options! 17 | 18 | for opt, (src, val) in dist.get_option_dict(cmd).items(): 19 | if src == "command line": 20 | settings.setdefault(cmd, {})[opt] = val 21 | 22 | edit_config(self.filename, settings, self.dry_run) 23 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/setuptools/command/upload.py: -------------------------------------------------------------------------------- 1 | from distutils import log 2 | from distutils.command import upload as orig 3 | 4 | from setuptools.errors import RemovedCommandError 5 | 6 | 7 | class upload(orig.upload): 8 | """Formerly used to upload packages to PyPI.""" 9 | 10 | def run(self): 11 | msg = ( 12 | "The upload command has been removed, use twine to upload " 13 | + "instead (https://pypi.org/p/twine)" 14 | ) 15 | 16 | self.announce("ERROR: " + msg, log.ERROR) 17 | raise RemovedCommandError(msg) 18 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/setuptools/dep_util.py: -------------------------------------------------------------------------------- 1 | from distutils.dep_util import newer_group 2 | 3 | 4 | # yes, this is was almost entirely copy-pasted from 5 | # 'newer_pairwise()', this is just another convenience 6 | # function. 7 | def newer_pairwise_group(sources_groups, targets): 8 | """Walk both arguments in parallel, testing if each source group is newer 9 | than its corresponding target. Returns a pair of lists (sources_groups, 10 | targets) where sources is newer than target, according to the semantics 11 | of 'newer_group()'. 12 | """ 13 | if len(sources_groups) != len(targets): 14 | raise ValueError( 15 | "'sources_group' and 'targets' must be the same length") 16 | 17 | # build a pair of lists (sources_groups, targets) where source is newer 18 | n_sources = [] 19 | n_targets = [] 20 | for i in range(len(sources_groups)): 21 | if newer_group(sources_groups[i], targets[i]): 22 | n_sources.append(sources_groups[i]) 23 | n_targets.append(targets[i]) 24 | 25 | return n_sources, n_targets 26 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/setuptools/gui-32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/venv/lib/python3.6/site-packages/setuptools/gui-32.exe -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/setuptools/gui-64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/venv/lib/python3.6/site-packages/setuptools/gui-64.exe -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/setuptools/gui.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/venv/lib/python3.6/site-packages/setuptools/gui.exe -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | with open_(script_name) as fid: 29 | script = fid.read() 30 | norm_script = script.replace('\\r\\n', '\\n') 31 | code = compile(norm_script, script_name, 'exec') 32 | exec(code, namespace) 33 | 34 | 35 | if __name__ == '__main__': 36 | run() 37 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/setuptools/unicode_utils.py: -------------------------------------------------------------------------------- 1 | import unicodedata 2 | import sys 3 | 4 | 5 | # HFS Plus uses decomposed UTF-8 6 | def decompose(path): 7 | if isinstance(path, str): 8 | return unicodedata.normalize('NFD', path) 9 | try: 10 | path = path.decode('utf-8') 11 | path = unicodedata.normalize('NFD', path) 12 | path = path.encode('utf-8') 13 | except UnicodeError: 14 | pass # Not UTF-8 15 | return path 16 | 17 | 18 | def filesys_decode(path): 19 | """ 20 | Ensure that the given path is decoded, 21 | NONE when no expected encoding works 22 | """ 23 | 24 | if isinstance(path, str): 25 | return path 26 | 27 | fs_enc = sys.getfilesystemencoding() or 'utf-8' 28 | candidates = fs_enc, 'utf-8' 29 | 30 | for enc in candidates: 31 | try: 32 | return path.decode(enc) 33 | except UnicodeDecodeError: 34 | continue 35 | 36 | 37 | def try_encode(string, enc): 38 | "turn unicode encoding into a functional routine" 39 | try: 40 | return string.encode(enc) 41 | except UnicodeEncodeError: 42 | return None 43 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/setuptools/version.py: -------------------------------------------------------------------------------- 1 | import pkg_resources 2 | 3 | try: 4 | __version__ = pkg_resources.get_distribution('setuptools').version 5 | except Exception: 6 | __version__ = 'unknown' 7 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/waitress-1.4.4.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pip 2 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/waitress-1.4.4.dist-info/REQUESTED: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/python-waitress/venv/lib/python3.6/site-packages/waitress-1.4.4.dist-info/REQUESTED -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/waitress-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 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/waitress-1.4.4.dist-info/entry_points.txt: -------------------------------------------------------------------------------- 1 | [console_scripts] 2 | waitress-serve = waitress.runner:run 3 | 4 | [paste.server_runner] 5 | main = waitress:serve_paste 6 | 7 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/waitress-1.4.4.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | waitress 2 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib/python3.6/site-packages/waitress/__main__.py: -------------------------------------------------------------------------------- 1 | from waitress.runner import run # pragma nocover 2 | 3 | run() # pragma nocover 4 | -------------------------------------------------------------------------------- /template/python-waitress/venv/lib64: -------------------------------------------------------------------------------- 1 | lib -------------------------------------------------------------------------------- /template/python-waitress/venv/pyvenv.cfg: -------------------------------------------------------------------------------- 1 | home = /usr/bin 2 | include-system-site-packages = false 3 | version = 3.6.9 4 | -------------------------------------------------------------------------------- /template/template/csharp/.dockerignore: -------------------------------------------------------------------------------- 1 | bin 2 | obj 3 | -------------------------------------------------------------------------------- /template/template/csharp/.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | -------------------------------------------------------------------------------- /template/template/csharp/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ghcr.io/openfaas/classic-watchdog:0.1.4 as watchdog 2 | 3 | FROM mcr.microsoft.com/dotnet/core/sdk:3.1 as builder 4 | 5 | # Supress collection of data. 6 | ENV DOTNET_CLI_TELEMETRY_OPTOUT 1 7 | 8 | # Optimize for Docker builder caching by adding projects first. 9 | 10 | RUN mkdir -p /home/app/src/function 11 | WORKDIR /home/app/src/function 12 | COPY ./function/Function.csproj . 13 | 14 | WORKDIR /home/app/src/ 15 | COPY ./root.csproj . 16 | RUN dotnet restore ./root.csproj 17 | 18 | COPY . . 19 | 20 | RUN dotnet publish -c release -o published 21 | 22 | FROM mcr.microsoft.com/dotnet/core/runtime:3.1 23 | 24 | COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog 25 | RUN chmod +x /usr/bin/fwatchdog 26 | 27 | # Create a non-root user 28 | RUN addgroup --system app \ 29 | && adduser --system --ingroup app app 30 | 31 | WORKDIR /home/app/ 32 | COPY --from=builder /home/app/src/published . 33 | RUN chown app:app -R /home/app 34 | 35 | USER app 36 | 37 | ENV fprocess="dotnet ./root.dll" 38 | EXPOSE 8080 39 | 40 | HEALTHCHECK --interval=3s CMD [ -e /tmp/.lock ] || exit 1 41 | 42 | CMD ["fwatchdog"] 43 | -------------------------------------------------------------------------------- /template/template/csharp/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Alex Ellis 2017. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | using System.Text; 6 | using Function; 7 | 8 | namespace root 9 | { 10 | class Program 11 | { 12 | static void Main(string[] args) 13 | { 14 | string buffer = Console.In.ReadToEnd(); 15 | FunctionHandler f = new FunctionHandler(); 16 | 17 | string responseValue = f.Handle(buffer); 18 | 19 | if(responseValue != null) { 20 | Console.Write(responseValue); 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /template/template/csharp/function/.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | obj/ 3 | .nuget/ 4 | .dotnet/ 5 | .templateengine/ 6 | -------------------------------------------------------------------------------- /template/template/csharp/function/Function.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | false 8 | 9 | 10 | -------------------------------------------------------------------------------- /template/template/csharp/function/FunctionHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | 4 | namespace Function 5 | { 6 | public class FunctionHandler 7 | { 8 | public string Handle(string input) { 9 | return $"Hi there - your input was: {input}\n"; 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /template/template/csharp/root.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | false 8 | 9 | 10 | 11 | 12 | 13 | 14 | Exe 15 | netcoreapp3.1 16 | 17 | 18 | false 19 | 20 | 21 | -------------------------------------------------------------------------------- /template/template/csharp/template.yml: -------------------------------------------------------------------------------- 1 | language: csharp 2 | fprocess: dotnet ./root.dll 3 | welcome_message: | 4 | You have created a C# function using the Classic OpenFaaS Template. 5 | 6 | To include third-party dependencies edit your .csproj file or install 7 | Nuget packages with VSCode. 8 | 9 | For high-throughput applications, we recommend using the csharp-kestrel 10 | or csharp-httprequest templates available in the OpenFaaS template 11 | store. -------------------------------------------------------------------------------- /template/template/dockerfile/function/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ghcr.io/openfaas/classic-watchdog:0.1.4 as watchdog 2 | 3 | FROM alpine:3.12 4 | 5 | RUN mkdir -p /home/app 6 | 7 | COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog 8 | RUN chmod +x /usr/bin/fwatchdog 9 | 10 | # Add non root user 11 | RUN addgroup -S app && adduser app -S -G app 12 | RUN chown app /home/app 13 | 14 | WORKDIR /home/app 15 | 16 | USER app 17 | 18 | # Populate example here - i.e. "cat", "sha512sum" or "node index.js" 19 | ENV fprocess="cat" 20 | # Set to true to see request in function logs 21 | ENV write_debug="false" 22 | 23 | EXPOSE 8080 24 | 25 | HEALTHCHECK --interval=3s CMD [ -e /tmp/.lock ] || exit 1 26 | 27 | CMD ["fwatchdog"] 28 | -------------------------------------------------------------------------------- /template/template/dockerfile/template.yml: -------------------------------------------------------------------------------- 1 | language: dockerfile 2 | -------------------------------------------------------------------------------- /template/template/go/function/handler.go: -------------------------------------------------------------------------------- 1 | package function 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | // Handle a serverless request 8 | func Handle(req []byte) string { 9 | return fmt.Sprintf("Hello, Go. You said: %s", string(req)) 10 | } 11 | -------------------------------------------------------------------------------- /template/template/go/go.mod: -------------------------------------------------------------------------------- 1 | module handler 2 | 3 | go 1.13 4 | 5 | replace handler/function => ./function 6 | -------------------------------------------------------------------------------- /template/template/go/main.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) Alex Ellis 2017. All rights reserved. 2 | // Copyright (c) OpenFaaS Author(s) 2018. All rights reserved. 3 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 4 | 5 | package main 6 | 7 | import ( 8 | "fmt" 9 | "io/ioutil" 10 | "log" 11 | "os" 12 | 13 | "handler/function" 14 | ) 15 | 16 | func main() { 17 | input, err := ioutil.ReadAll(os.Stdin) 18 | if err != nil { 19 | log.Fatalf("Unable to read standard input: %s", err.Error()) 20 | } 21 | 22 | fmt.Println(function.Handle(input)) 23 | } 24 | -------------------------------------------------------------------------------- /template/template/go/template.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | fprocess: ./handler 3 | build_options: 4 | - name: dev 5 | packages: 6 | - make 7 | - automake 8 | - gcc 9 | - g++ 10 | - subversion 11 | - python3-dev 12 | - musl-dev 13 | - libffi-dev 14 | - git 15 | - name: mysql 16 | packages: 17 | - mysql-client 18 | - mysql-dev 19 | welcome_message: | 20 | You have created a new function which uses Golang 1.13 and the Classic 21 | OpenFaaS template. 22 | 23 | To include third-party dependencies, use Go modules and use 24 | "--build-arg GO111MODULE=on" with faas-cli build or configure this 25 | via your stack.yml file. 26 | 27 | See more: https://docs.openfaas.com/cli/templates/ 28 | 29 | For high-throughput applications, we recommend using the golang-http 30 | or golang-middleware templates instead available via the store. 31 | -------------------------------------------------------------------------------- /template/template/java11-vert-x/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by the Gradle 'init' task. 3 | * 4 | * This is a general purpose Gradle build. 5 | * Learn how to create Gradle builds at https://guides.gradle.org/creating-new-gradle-builds/ 6 | */ 7 | 8 | allprojects { 9 | repositories { 10 | jcenter() 11 | } 12 | } 13 | 14 | subprojects { 15 | // apply plugin: 'java' 16 | 17 | version = '1.0' 18 | 19 | // jar { 20 | // manifest.attributes provider: 'gradle' 21 | // } 22 | } 23 | -------------------------------------------------------------------------------- /template/template/java11-vert-x/entrypoint/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by the Gradle 'init' task. 3 | * 4 | * This generated file contains a sample Java project to get you started. 5 | * For more details take a look at the Java Quickstart chapter in the Gradle 6 | * user guide available at https://docs.gradle.org/4.8.1/userguide/tutorial_java_projects.html 7 | */ 8 | 9 | plugins { 10 | // Apply the java plugin to add support for Java 11 | id 'java' 12 | 13 | // Apply the application plugin to add support for building an application 14 | id 'application' 15 | 16 | } 17 | 18 | // Define the main class for the application 19 | mainClassName = 'App' 20 | 21 | dependencies { 22 | // Vert.x project 23 | compile 'io.vertx:vertx-web:3.5.4' 24 | 25 | // Use JUnit test framework 26 | testCompile 'junit:junit:4.12' 27 | 28 | compile project(':function') 29 | } 30 | 31 | jar { 32 | manifest { 33 | attributes 'Implementation-Title': 'OpenFaaS Function', 34 | 'Implementation-Version': version 35 | } 36 | } 37 | 38 | // In this section you declare where to find the dependencies of your project 39 | repositories { 40 | // Use jcenter for resolving your dependencies. 41 | // You can declare any Maven/Ivy/file repository here. 42 | jcenter() 43 | } 44 | 45 | uploadArchives { 46 | repositories { 47 | flatDir { 48 | dirs 'repos' 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /template/template/java11-vert-x/entrypoint/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by the Gradle 'init' task. 3 | * 4 | * The settings file is used to specify which projects to include in your build. 5 | * 6 | * Detailed information about configuring a multi-project build in Gradle can be found 7 | * in the user guide at https://docs.gradle.org/4.8.1/userguide/multi_project_builds.html 8 | */ 9 | 10 | rootProject.name = 'entrypoint' 11 | -------------------------------------------------------------------------------- /template/template/java11-vert-x/entrypoint/src/test/java/AppTest.java: -------------------------------------------------------------------------------- 1 | public class AppTest { 2 | 3 | } -------------------------------------------------------------------------------- /template/template/java11-vert-x/function/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by the Gradle 'init' task. 3 | * 4 | * This generated file contains a sample Java Library project to get you started. 5 | * For more details take a look at the Java Libraries chapter in the Gradle 6 | * user guide available at https://docs.gradle.org/4.8.1/userguide/java_library_plugin.html 7 | */ 8 | 9 | plugins { 10 | // Apply the java-library plugin to add support for Java Library 11 | id 'java-library' 12 | } 13 | 14 | dependencies { 15 | // Vert.x project 16 | compile 'io.vertx:vertx-web:3.5.4' 17 | 18 | // Use JUnit test framework 19 | testImplementation 'junit:junit:4.12' 20 | } 21 | 22 | // In this section you declare where to find the dependencies of your project 23 | repositories { 24 | // Use jcenter for resolving your dependencies. 25 | // You can declare any Maven/Ivy/file repository here. 26 | jcenter() 27 | } 28 | -------------------------------------------------------------------------------- /template/template/java11-vert-x/function/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by the Gradle 'init' task. 3 | * 4 | * The settings file is used to specify which projects to include in your build. 5 | * 6 | * Detailed information about configuring a multi-project build in Gradle can be found 7 | * in the user guide at https://docs.gradle.org/4.8.1/userguide/multi_project_builds.html 8 | */ 9 | 10 | rootProject.name = 'function' 11 | -------------------------------------------------------------------------------- /template/template/java11-vert-x/function/src/main/java/com/openfaas/function/Handler.java: -------------------------------------------------------------------------------- 1 | package com.openfaas.function; 2 | 3 | import io.vertx.ext.web.RoutingContext; 4 | import io.vertx.core.json.JsonObject; 5 | 6 | public class Handler implements io.vertx.core.Handler { 7 | 8 | public void handle(RoutingContext routingContext) { 9 | routingContext.response() 10 | .putHeader("content-type", "application/json;charset=UTF-8") 11 | .end( 12 | new JsonObject() 13 | .put("status", "ok") 14 | .encodePrettily() 15 | ); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /template/template/java11-vert-x/function/src/main/resources/webroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | WebApp with Vert.x and Java 7 | 8 | 9 | 10 | 42 | 43 | 44 |
45 |
46 |

47 | WebApp with Vert.x and Java 48 |

49 |

50 | Hosted with ❤️ on OpenFaaS 51 |

52 |
53 |
54 | 55 | -------------------------------------------------------------------------------- /template/template/java11-vert-x/function/src/test/java/HandlerTest.java: -------------------------------------------------------------------------------- 1 | import org.junit.Test; 2 | import static org.junit.Assert.*; 3 | 4 | import com.openfaas.function.Handler; 5 | 6 | public class HandlerTest { 7 | @Test public void handlerIsNotNull() { 8 | Handler handler = new Handler(); 9 | assertTrue("Expected handler not to be null", handler != null); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /template/template/java11-vert-x/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by the Gradle 'init' task. 3 | * 4 | * The settings file is used to specify which projects to include in your build. 5 | * 6 | * Detailed information about configuring a multi-project build in Gradle can be found 7 | * in the user guide at https://docs.gradle.org/4.8.1/userguide/multi_project_builds.html 8 | */ 9 | 10 | rootProject.name = 'java8-vert-x' 11 | 12 | include 'function', 'entrypoint' 13 | -------------------------------------------------------------------------------- /template/template/java11-vert-x/template.yml: -------------------------------------------------------------------------------- 1 | language: java8-vert-x 2 | -------------------------------------------------------------------------------- /template/template/java11/README.md: -------------------------------------------------------------------------------- 1 | ## Template: java11 2 | 3 | The Java11 template uses gradle as a build system. 4 | 5 | Gradle version: 5.5.1 6 | 7 | ### Structure 8 | 9 | There are three projects which make up a single gradle build: 10 | 11 | - model - (Library) classes for parsing request/response 12 | - function - (Library) your function code as a developer, you will only ever see this folder 13 | - entrypoint - (App) HTTP server for re-using the JVM between requests 14 | 15 | ### Handler 16 | 17 | The handler is written in the `./src/main/Handler.java` folder 18 | 19 | Tests are supported with junit via files in `./src/test` 20 | 21 | ### External dependencies 22 | 23 | External dependencies can be specified in ./build.gradle in the normal way using jcenter, a local JAR or some other remote repository. 24 | 25 | -------------------------------------------------------------------------------- /template/template/java11/build.gradle: -------------------------------------------------------------------------------- 1 | allprojects { 2 | repositories { 3 | jcenter() 4 | } 5 | } 6 | 7 | subprojects { 8 | version = '1.0' 9 | } 10 | 11 | repositories { 12 | jcenter() 13 | 14 | flatDir { 15 | dirs 'libs' 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /template/template/java11/function/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/template/java11/function/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /template/template/java11/function/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /template/template/java11/function/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'function' 2 | -------------------------------------------------------------------------------- /template/template/java11/function/src/main/java/com/openfaas/function/Handler.java: -------------------------------------------------------------------------------- 1 | package com.openfaas.function; 2 | 3 | import com.openfaas.model.IHandler; 4 | import com.openfaas.model.IResponse; 5 | import com.openfaas.model.IRequest; 6 | import com.openfaas.model.Response; 7 | 8 | public class Handler extends com.openfaas.model.AbstractHandler { 9 | 10 | public IResponse Handle(IRequest req) { 11 | Response res = new Response(); 12 | res.setBody("Hello, world!"); 13 | 14 | return res; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /template/template/java11/function/src/test/java/HandlerTest.java: -------------------------------------------------------------------------------- 1 | import org.junit.Test; 2 | import static org.junit.Assert.*; 3 | 4 | import com.openfaas.function.Handler; 5 | import com.openfaas.model.IHandler; 6 | 7 | public class HandlerTest { 8 | @Test public void handlerIsNotNull() { 9 | IHandler handler = new Handler(); 10 | assertTrue("Expected handler not to be null", handler != null); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /template/template/java11/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/template/java11/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /template/template/java11/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /template/template/java11/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'java11' 2 | 3 | include 'model', 'function', 'entrypoint' 4 | -------------------------------------------------------------------------------- /template/template/java11/template.yml: -------------------------------------------------------------------------------- 1 | language: java11 2 | welcome_message: | 3 | You have created a function using the java11 template which uses an LTS 4 | version of the OpenJDK. 5 | -------------------------------------------------------------------------------- /template/template/node/.dockerignore: -------------------------------------------------------------------------------- 1 | */node_modules 2 | -------------------------------------------------------------------------------- /template/template/node/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/classic-watchdog:0.1.4 as watchdog 2 | FROM --platform=${TARGETPLATFORM:-linux/amd64} node:12-alpine as ship 3 | 4 | ARG TARGETPLATFORM 5 | ARG BUILDPLATFORM 6 | 7 | COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog 8 | RUN chmod +x /usr/bin/fwatchdog 9 | 10 | RUN addgroup -S app && adduser app -S -G app 11 | 12 | WORKDIR /root/ 13 | 14 | # Turn down the verbosity to default level. 15 | ENV NPM_CONFIG_LOGLEVEL warn 16 | 17 | RUN mkdir -p /home/app 18 | 19 | # Wrapper/boot-strapper 20 | WORKDIR /home/app 21 | COPY package.json ./ 22 | 23 | # This ordering means the npm installation is cached for the outer function handler. 24 | RUN npm i --production 25 | 26 | # Copy outer function handler 27 | COPY index.js ./ 28 | 29 | # COPY function node packages and install, adding this as a separate 30 | # entry allows caching of npm install runtime dependencies 31 | WORKDIR /home/app/function 32 | COPY function/*.json ./ 33 | RUN npm i --production || : 34 | 35 | # Copy in additional function files and folders 36 | COPY --chown=app:app function/ . 37 | 38 | WORKDIR /home/app/ 39 | 40 | # chmod for tmp is for a buildkit issue (@alexellis) 41 | RUN chmod +rx -R ./function \ 42 | && chown app:app -R /home/app \ 43 | && chmod 777 /tmp 44 | 45 | USER app 46 | 47 | ENV cgi_headers="true" 48 | ENV fprocess="node index.js" 49 | EXPOSE 8080 50 | 51 | HEALTHCHECK --interval=3s CMD [ -e /tmp/.lock ] || exit 1 52 | 53 | CMD ["fwatchdog"] 54 | -------------------------------------------------------------------------------- /template/template/node/function/handler.js: -------------------------------------------------------------------------------- 1 | "use strict" 2 | 3 | module.exports = async (context, callback) => { 4 | return {status: "done"} 5 | } 6 | -------------------------------------------------------------------------------- /template/template/node/function/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "function", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "handler.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC" 12 | } 13 | -------------------------------------------------------------------------------- /template/template/node/index.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) Alex Ellis 2017. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | "use strict" 5 | 6 | const getStdin = require('get-stdin'); 7 | 8 | const handler = require('./function/handler'); 9 | 10 | getStdin().then(val => { 11 | const cb = (err, res) => { 12 | if (err) { 13 | return console.error(err); 14 | } 15 | if (!res) { 16 | return; 17 | } 18 | if(Array.isArray(res) || isObject(res)) { 19 | console.log(JSON.stringify(res)); 20 | } else { 21 | process.stdout.write(res); 22 | } 23 | } // cb ... 24 | 25 | const result = handler(val, cb); 26 | if (result instanceof Promise) { 27 | result 28 | .then(data => cb(undefined, data)) 29 | .catch(err => cb(err, undefined)) 30 | ; 31 | } 32 | }).catch(e => { 33 | console.error(e.stack); 34 | }); 35 | 36 | const isObject = (a) => { 37 | return (!!a) && (a.constructor === Object); 38 | }; -------------------------------------------------------------------------------- /template/template/node/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "NodejsBase", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "faas_index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "get-stdin": "^5.0.1" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /template/template/node/template.yml: -------------------------------------------------------------------------------- 1 | language: node 2 | fprocess: node index.js 3 | welcome_message: | 4 | You have created a new function which uses Node.js 12.13.0 and the OpenFaaS 5 | Classic Watchdog. 6 | 7 | npm i --save can be used to add third-party packages like request or cheerio 8 | npm documentation: https://docs.npmjs.com/ 9 | 10 | For high-throughput services, we recommend you use the node12 template which 11 | uses a different version of the OpenFaaS watchdog. 12 | -------------------------------------------------------------------------------- /template/template/node12/.dockerignore: -------------------------------------------------------------------------------- 1 | */node_modules 2 | -------------------------------------------------------------------------------- /template/template/node12/function/handler.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = async (event, context) => { 4 | const result = { 5 | 'status': 'Received input: ' + JSON.stringify(event.body) 6 | } 7 | 8 | return context 9 | .status(200) 10 | .succeed(result) 11 | } 12 | 13 | -------------------------------------------------------------------------------- /template/template/node12/function/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "openfaas-function", 3 | "version": "1.0.0", 4 | "description": "OpenFaaS Function", 5 | "main": "handler.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 0" 8 | }, 9 | "keywords": [], 10 | "author": "OpenFaaS Ltd", 11 | "license": "MIT" 12 | } 13 | -------------------------------------------------------------------------------- /template/template/node12/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "openfaas-node12", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no tests specified\" && exit 0" 8 | }, 9 | "keywords": [], 10 | "author": "OpenFaaS Ltd", 11 | "license": "MIT", 12 | "dependencies": { 13 | "body-parser": "^1.18.2", 14 | "express": "^4.16.2" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /template/template/node12/template.yml: -------------------------------------------------------------------------------- 1 | language: node12 2 | fprocess: node index.js 3 | welcome_message: | 4 | You have created a new function which uses Node.js 12 (TLS) and the OpenFaaS 5 | of-watchdog which gives greater control over HTTP responses. 6 | 7 | npm i --save can be used to add third-party packages like request or cheerio 8 | npm documentation: https://docs.npmjs.com/ 9 | 10 | Unit tests are run at build time via "npm run", edit package.json to specify 11 | how you want to execute them. 12 | 13 | -------------------------------------------------------------------------------- /template/template/php7/function/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "openfaas/function-php7.2", 3 | "description": "Template for function in PHP 7.2", 4 | "type": "project", 5 | "license": "proprietary", 6 | "config": { 7 | "classmap-authoritative": true 8 | }, 9 | "autoload": { 10 | "psr-4": { 11 | "App\\": "src/" 12 | } 13 | }, 14 | "require": { 15 | "php": "^7.2" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /template/template/php7/function/php-extension.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Installing PHP extensions" 4 | 5 | # Add your extensions in here, an example is below 6 | # docker-php-ext-install mysqli 7 | # 8 | # See the template documentation for instructions on installing extensions; 9 | # - https://github.com/openfaas/templates/tree/master/template/php7 10 | # 11 | # You can also install any apk packages here 12 | -------------------------------------------------------------------------------- /template/template/php7/function/src/Handler.php: -------------------------------------------------------------------------------- 1 | handle($stdin); 10 | echo $response; 11 | -------------------------------------------------------------------------------- /template/template/php7/php-extension.sh-example: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Installing PHP extensions" 4 | docker-php-ext-install pdo_mysql 5 | 6 | # Install Phalcon 7 | PHALCON_VERSION=3.4.0 8 | PHALCON_EXT_PATH=php7/64bits 9 | 10 | set -xe && \ 11 | # Compile Phalcon 12 | curl -LO https://github.com/phalcon/cphalcon/archive/v${PHALCON_VERSION}.tar.gz && \ 13 | tar xzf ${PWD}/v${PHALCON_VERSION}.tar.gz && \ 14 | docker-php-ext-install -j $(getconf _NPROCESSORS_ONLN) ${PWD}/cphalcon-${PHALCON_VERSION}/build/${PHALCON_EXT_PATH} && \ 15 | # Remove all temp files 16 | rm -r \ 17 | ${PWD}/v${PHALCON_VERSION}.tar.gz \ 18 | ${PWD}/cphalcon-${PHALCON_VERSION} -------------------------------------------------------------------------------- /template/template/php7/template.yml: -------------------------------------------------------------------------------- 1 | language: php7 2 | fprocess: php index.php 3 | welcome_message: | 4 | You have created a new function which uses PHP 7.2. 5 | Dependencies and extensions can be added using the composer.json 6 | and php-extension.sh files. 7 | See https://github.com/openfaas/templates/blob/master/template/php7. 8 | -------------------------------------------------------------------------------- /template/template/python/function/handler.py: -------------------------------------------------------------------------------- 1 | def handle(req): 2 | """handle a request to the function 3 | Args: 4 | req (str): request body 5 | """ 6 | 7 | return req 8 | -------------------------------------------------------------------------------- /template/template/python/function/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/template/python/function/requirements.txt -------------------------------------------------------------------------------- /template/template/python/index.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Alex Ellis 2017. All rights reserved. 2 | # Copyright (c) OpenFaaS Author(s) 2018. All rights reserved. 3 | # Licensed under the MIT license. See LICENSE file in the project root for full license information. 4 | 5 | import sys 6 | from function import handler 7 | 8 | def get_stdin(): 9 | buf = "" 10 | for line in sys.stdin: 11 | buf = buf + line 12 | return buf 13 | 14 | if __name__ == "__main__": 15 | st = get_stdin() 16 | ret = handler.handle(st) 17 | if ret != None: 18 | print(ret) 19 | -------------------------------------------------------------------------------- /template/template/python/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/template/python/requirements.txt -------------------------------------------------------------------------------- /template/template/python/template.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | fprocess: python index.py 3 | build_options: 4 | - name: dev 5 | packages: 6 | - make 7 | - automake 8 | - gcc 9 | - g++ 10 | - subversion 11 | - python3-dev 12 | - musl-dev 13 | - libffi-dev 14 | - git 15 | - name: mysql 16 | packages: 17 | - mysql-client 18 | - mysql-dev 19 | - name: pillow 20 | packages: 21 | - jpeg-dev 22 | - zlib-dev 23 | - freetype-dev 24 | - lcms2-dev 25 | - openjpeg-dev 26 | - tiff-dev 27 | - tk-dev 28 | - tcl-dev 29 | - harfbuzz-dev 30 | - fribidi-dev 31 | -------------------------------------------------------------------------------- /template/template/python3-debian/function/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/template/python3-debian/function/__init__.py -------------------------------------------------------------------------------- /template/template/python3-debian/function/handler.py: -------------------------------------------------------------------------------- 1 | def handle(req): 2 | """handle a request to the function 3 | Args: 4 | req (str): request body 5 | """ 6 | 7 | return req 8 | -------------------------------------------------------------------------------- /template/template/python3-debian/function/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/template/python3-debian/function/requirements.txt -------------------------------------------------------------------------------- /template/template/python3-debian/index.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Alex Ellis 2017. All rights reserved. 2 | # Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | import sys 5 | from function import handler 6 | 7 | def get_stdin(): 8 | buf = "" 9 | while(True): 10 | line = sys.stdin.readline() 11 | buf += line 12 | if line=="": 13 | break 14 | return buf 15 | 16 | if(__name__ == "__main__"): 17 | st = get_stdin() 18 | ret = handler.handle(st) 19 | if ret != None: 20 | print(ret) 21 | -------------------------------------------------------------------------------- /template/template/python3-debian/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/template/python3-debian/requirements.txt -------------------------------------------------------------------------------- /template/template/python3-debian/template.yml: -------------------------------------------------------------------------------- 1 | language: python3-debian 2 | fprocess: python3 index.py 3 | -------------------------------------------------------------------------------- /template/template/python3/function/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/template/python3/function/__init__.py -------------------------------------------------------------------------------- /template/template/python3/function/handler.py: -------------------------------------------------------------------------------- 1 | def handle(req): 2 | """handle a request to the function 3 | Args: 4 | req (str): request body 5 | """ 6 | 7 | return req 8 | -------------------------------------------------------------------------------- /template/template/python3/function/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/template/python3/function/requirements.txt -------------------------------------------------------------------------------- /template/template/python3/index.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Alex Ellis 2017. All rights reserved. 2 | # Copyright (c) OpenFaaS Author(s) 2018. All rights reserved. 3 | # Licensed under the MIT license. See LICENSE file in the project root for full license information. 4 | 5 | import sys 6 | from function import handler 7 | 8 | def get_stdin(): 9 | buf = "" 10 | while(True): 11 | line = sys.stdin.readline() 12 | buf += line 13 | if line == "": 14 | break 15 | return buf 16 | 17 | if __name__ == "__main__": 18 | st = get_stdin() 19 | ret = handler.handle(st) 20 | if ret != None: 21 | print(ret) 22 | -------------------------------------------------------------------------------- /template/template/python3/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/container-registry/container-vending-machine/ca9c86373d1d97e75cedf4bf3e185661019fb640/template/template/python3/requirements.txt -------------------------------------------------------------------------------- /template/template/python3/template.yml: -------------------------------------------------------------------------------- 1 | language: python3 2 | fprocess: python3 index.py 3 | build_options: 4 | - name: dev 5 | packages: 6 | - make 7 | - automake 8 | - gcc 9 | - g++ 10 | - subversion 11 | - python3-dev 12 | - musl-dev 13 | - libffi-dev 14 | - git 15 | - name: mysql 16 | packages: 17 | - mysql-client 18 | - mysql-dev 19 | - name: pillow 20 | packages: 21 | - jpeg-dev 22 | - zlib-dev 23 | - freetype-dev 24 | - lcms2-dev 25 | - openjpeg-dev 26 | - tiff-dev 27 | - tk-dev 28 | - tcl-dev 29 | - harfbuzz-dev 30 | - fribidi-dev 31 | welcome_message: | 32 | You have created a Python3 function using the Classic Watchdog. 33 | 34 | To include third-party dependencies create a requirements.txt file. 35 | 36 | For high-throughput applications, we recommend using the python3-flask 37 | or python3-http templates. 38 | -------------------------------------------------------------------------------- /template/template/ruby/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/classic-watchdog:0.1.4 as watchdog 2 | FROM --platform=${TARGETPLATFORM:-linux/amd64} ruby:alpine 3 | 4 | ARG TARGETPLATFORM 5 | ARG BUILDPLATFORM 6 | 7 | COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog 8 | RUN chmod +x /usr/bin/fwatchdog 9 | 10 | ARG ADDITIONAL_PACKAGE 11 | 12 | # Alternatively use ADD https:// (which will not be cached by Docker builder) 13 | RUN apk --no-cache add ${ADDITIONAL_PACKAGE} 14 | 15 | WORKDIR /home/app 16 | 17 | COPY Gemfile . 18 | COPY index.rb . 19 | COPY function function 20 | 21 | RUN bundle install \ 22 | && mkdir -p /home/app/function 23 | 24 | WORKDIR /home/app/function 25 | 26 | RUN bundle install 27 | 28 | RUN addgroup -S app \ 29 | && adduser app -S -G app 30 | 31 | RUN chown app:app -R /home/app 32 | 33 | USER app 34 | 35 | WORKDIR /home/app 36 | 37 | ENV fprocess="ruby index.rb" 38 | EXPOSE 8080 39 | 40 | HEALTHCHECK --interval=2s CMD [ -e /tmp/.lock ] || exit 1 41 | 42 | CMD ["fwatchdog"] 43 | -------------------------------------------------------------------------------- /template/template/ruby/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | -------------------------------------------------------------------------------- /template/template/ruby/function/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | -------------------------------------------------------------------------------- /template/template/ruby/function/handler.rb: -------------------------------------------------------------------------------- 1 | class Handler 2 | def run(req) 3 | return "Hello world from the Ruby template" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /template/template/ruby/index.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) Alex Ellis 2017. All rights reserved. 2 | # Copyright (c) OpenFaaS Author(s) 2018. All rights reserved. 3 | # Licensed under the MIT license. See LICENSE file in the project root for full license information. 4 | 5 | require_relative 'function/handler' 6 | 7 | req = ARGF.read 8 | 9 | handler = Handler.new 10 | res = handler.run req 11 | 12 | puts res 13 | -------------------------------------------------------------------------------- /template/template/ruby/template.yml: -------------------------------------------------------------------------------- 1 | language: ruby 2 | fprocess: ruby index.rb 3 | build_options: 4 | - name: dev 5 | packages: 6 | - make 7 | - automake 8 | - gcc 9 | - g++ 10 | - subversion 11 | - python3-dev 12 | - musl-dev 13 | - libffi-dev 14 | - libssh 15 | - libssh-dev 16 | welcome_message: | 17 | You have created a Ruby function using the Classic Watchdog. 18 | 19 | To include third-party dependencies create a Gemfile. You can also 20 | include developer-dependencies using the "dev" build_option. 21 | 22 | For high-throughput applications, we recommend using the ruby-http 23 | template. 24 | --------------------------------------------------------------------------------