cookiecutter_python.backend.hosting_services package¶
Submodules¶
cookiecutter_python.backend.hosting_services.check_engine module¶
- class cookiecutter_python.backend.hosting_services.check_engine.Engine(config_file: None | str, default_config: None | bool, services_info: Tuple, checker: Checker = NOTHING, handlers: Handlers = NOTHING)[source]¶
Bases:
object
- check(servers: List[str])[source]¶
Request Future per supported server, for web hosting service checks
For each server the dedicated ‘checker’ is called, which tries to return a Future.
Returns None checker’s ‘activation’ boolean flag was off at runtime. Returns None if internal mechanism for determining server URL fails to derive the URL (atm URL is only trie d to be read from User Config yaml)
- Parameters:
servers (List[str]) – [description]
- Returns:
[description]
- Return type:
[type]
- config_file: None | str¶
- static create(config_file: str, default_config: bool)[source]¶
Initialize objects, for Asynchronous http with 3rd-party Services
Objects are designed to Ask PyPI and Read The Docs, if the soon to be generated package name, and readthedocs project slug are available.
These ‘Checker’ objects make asynchronous http requests to PyPI and RTD web servers, for non-blocking IO, and to avoid blocking the main thread.
Checkers are initialized as ‘Activated’ if User Config is given and Default Config is False.
Then each Checker (pypi, rtd) requires: - PyPI requires the ‘pkg_name’ in User’s yaml Config - RTD requires the ‘readthedocs_project_slug’ in User’s yaml Config
to derive the URLs for Future Requests
- Parameters:
config_file (str) – user’s yaml config file
default_config (bool) – default config flag
- default_config: None | bool¶
- services_info: Tuple¶
cookiecutter_python.backend.hosting_services.check_service module¶
- class cookiecutter_python.backend.hosting_services.check_service.ServiceChecker(name_extractor: Callable[[str], str], web_service_checker: WebHostingServiceChecker, activate_flag: bool, config_file_path: str)[source]¶
Bases:
object
- activate_flag: bool¶
- config_file_path: str¶
- name_extractor: Callable[[str], str]¶
- property service_name¶
- web_service_checker: WebHostingServiceChecker¶
cookiecutter_python.backend.hosting_services.check_web_hosting_service module¶
cookiecutter_python.backend.hosting_services.checker module¶
cookiecutter_python.backend.hosting_services.checkers module¶
cookiecutter_python.backend.hosting_services.exceptions module¶
cookiecutter_python.backend.hosting_services.extract_name module¶
cookiecutter_python.backend.hosting_services.handle_hosting_service_check module¶
cookiecutter_python.backend.hosting_services.handler module¶
cookiecutter_python.backend.hosting_services.value_extractor module¶
- class cookiecutter_python.backend.hosting_services.value_extractor.BaseValueExtractor(key_name: str)[source]¶
Bases:
ValueExtractor
- key_name: str¶
cookiecutter_python.backend.hosting_services.web_hosting_service module¶
- class cookiecutter_python.backend.hosting_services.web_hosting_service.HostingServiceInfo[source]¶
Bases:
object
- create(*args, **kwargs)[source]¶
Factory method for creating WebHostingService instances.
- Raises:
NotImplementedError – [description]
- property service¶
- property variable_name: str¶
- class cookiecutter_python.backend.hosting_services.web_hosting_service.HostingServices[source]¶
Bases:
object
- subclasses: Dict[str, type] = {'pypi': <class 'cookiecutter_python.backend.hosting_services.web_hosting_service.PyPIServerFactory'>, 'readthedocs': <class 'cookiecutter_python.backend.hosting_services.web_hosting_service.ReadTheDocsServerFactory'>}¶
- class cookiecutter_python.backend.hosting_services.web_hosting_service.HostingServicesInfo(*args)[source]¶
Bases:
SubclassRegistry
[HostingServiceInfo
]
- class cookiecutter_python.backend.hosting_services.web_hosting_service.PyPIServerFactory[source]¶
Bases:
HostingServiceInfo
- create(*args, **kwargs)[source]¶
Factory method for creating WebHostingService instances.
- Raises:
NotImplementedError – [description]
- property variable_name: str¶
- class cookiecutter_python.backend.hosting_services.web_hosting_service.ReadTheDocsServerFactory[source]¶
Bases:
HostingServiceInfo
- create(*args, **kwargs)[source]¶
Factory method for creating WebHostingService instances.
- Raises:
NotImplementedError – [description]
- property variable_name: str¶
Module contents¶
- class cookiecutter_python.backend.hosting_services.Engine(config_file: None | str, default_config: None | bool, services_info: Tuple, checker: Checker = NOTHING, handlers: Handlers = NOTHING)[source]¶
Bases:
object
- check(servers: List[str])[source]¶
Request Future per supported server, for web hosting service checks
For each server the dedicated ‘checker’ is called, which tries to return a Future.
Returns None checker’s ‘activation’ boolean flag was off at runtime. Returns None if internal mechanism for determining server URL fails to derive the URL (atm URL is only trie d to be read from User Config yaml)
- Parameters:
servers (List[str]) – [description]
- Returns:
[description]
- Return type:
[type]
- config_file: None | str¶
- static create(config_file: str, default_config: bool)[source]¶
Initialize objects, for Asynchronous http with 3rd-party Services
Objects are designed to Ask PyPI and Read The Docs, if the soon to be generated package name, and readthedocs project slug are available.
These ‘Checker’ objects make asynchronous http requests to PyPI and RTD web servers, for non-blocking IO, and to avoid blocking the main thread.
Checkers are initialized as ‘Activated’ if User Config is given and Default Config is False.
Then each Checker (pypi, rtd) requires: - PyPI requires the ‘pkg_name’ in User’s yaml Config - RTD requires the ‘readthedocs_project_slug’ in User’s yaml Config
to derive the URLs for Future Requests
- Parameters:
config_file (str) – user’s yaml config file
default_config (bool) – default config flag
- default_config: None | bool¶
- services_info: Tuple¶