diff --git a/certbot-ci/certbot_integration_tests/nginx_tests/context.py b/certbot-ci/certbot_integration_tests/nginx_tests/context.py index 9dd633db2..7c59b2696 100644 --- a/certbot-ci/certbot_integration_tests/nginx_tests/context.py +++ b/certbot-ci/certbot_integration_tests/nginx_tests/context.py @@ -49,7 +49,7 @@ class IntegrationTestsContext(certbot_context.IntegrationTestsContext): command, self.directory_url, self.http_01_port, self.tls_alpn_01_port, self.config_dir, self.workspace, force_renew=True) - def _start_nginx(self, default_server: bool) -> subprocess.Popen: + def _start_nginx(self, default_server: bool) -> subprocess.Popen[bytes]: self.nginx_config = config.construct_nginx_config( self.nginx_root, self.webroot, self.http_01_port, self.tls_alpn_01_port, self.other_port, default_server, wtf_prefix=self.worker_id) diff --git a/certbot-ci/certbot_integration_tests/utils/acme_server.py b/certbot-ci/certbot_integration_tests/utils/acme_server.py index 7413a471a..130c398c7 100755 --- a/certbot-ci/certbot_integration_tests/utils/acme_server.py +++ b/certbot-ci/certbot_integration_tests/utils/acme_server.py @@ -55,7 +55,7 @@ class ACMEServer: self._proxy = http_proxy self._workspace = tempfile.mkdtemp() - self._processes: List[subprocess.Popen] = [] + self._processes: List[subprocess.Popen[bytes]] = [] self._stdout = sys.stdout if stdout else open(os.devnull, 'w') # pylint: disable=consider-using-with self._dns_server = dns_server self._http_01_port = DEFAULT_HTTP_01_PORT @@ -165,7 +165,7 @@ class ACMEServer: def _launch_process(self, command: List[str], cwd: str = os.getcwd(), env: Optional[Mapping[str, str]] = None, - force_stderr: bool = False) -> subprocess.Popen: + force_stderr: bool = False) -> subprocess.Popen[bytes]: """Launch silently a subprocess OS command""" if not env: env = os.environ diff --git a/certbot-ci/certbot_integration_tests/utils/dns_server.py b/certbot-ci/certbot_integration_tests/utils/dns_server.py index 314e215bf..b13f0fd48 100644 --- a/certbot-ci/certbot_integration_tests/utils/dns_server.py +++ b/certbot-ci/certbot_integration_tests/utils/dns_server.py @@ -45,7 +45,7 @@ class DNSServer: self.bind_root = tempfile.mkdtemp() - self.process: Optional[subprocess.Popen] = None + self.process: Optional[subprocess.Popen[bytes]] = None self.dns_xdist = {"address": BIND_BIND_ADDRESS[0], "port": BIND_BIND_ADDRESS[1]} diff --git a/tox.ini b/tox.ini index 82a07f0d6..4d640e84f 100644 --- a/tox.ini +++ b/tox.ini @@ -8,8 +8,8 @@ pytest = python -m pytest {posargs} # Paths are listed on one line because tox seems to have inconsistent # behavior with substitutions that contain line continuations, see # https://github.com/tox-dev/tox/issues/2069 for more info. -mypy_strict_source_paths = certbot-ci/snap_integration_tests certbot-dns-cloudflare/certbot_dns_cloudflare certbot-dns-digitalocean/certbot_dns_digitalocean certbot-dns-dnsimple/certbot_dns_dnsimple certbot-dns-dnsmadeeasy/certbot_dns_dnsmadeeasy certbot-dns-gehirn/certbot_dns_gehirn certbot-dns-google/certbot_dns_google certbot-dns-linode/certbot_dns_linode certbot-dns-luadns/certbot_dns_luadns certbot-dns-nsone/certbot_dns_nsone certbot-dns-ovh/certbot_dns_ovh certbot-dns-rfc2136/certbot_dns_rfc2136 certbot-dns-route53/certbot_dns_route53 certbot-dns-sakuracloud/certbot_dns_sakuracloud -mypy_no_strict_source_paths = acme/acme certbot/certbot certbot-apache/certbot_apache certbot-ci/certbot_integration_tests certbot-compatibility-test/certbot_compatibility_test certbot-nginx/certbot_nginx +mypy_strict_source_paths = certbot-ci/certbot_integration_tests certbot-ci/snap_integration_tests certbot-dns-cloudflare/certbot_dns_cloudflare certbot-dns-digitalocean/certbot_dns_digitalocean certbot-dns-dnsimple/certbot_dns_dnsimple certbot-dns-dnsmadeeasy/certbot_dns_dnsmadeeasy certbot-dns-gehirn/certbot_dns_gehirn certbot-dns-google/certbot_dns_google certbot-dns-linode/certbot_dns_linode certbot-dns-luadns/certbot_dns_luadns certbot-dns-nsone/certbot_dns_nsone certbot-dns-ovh/certbot_dns_ovh certbot-dns-rfc2136/certbot_dns_rfc2136 certbot-dns-route53/certbot_dns_route53 certbot-dns-sakuracloud/certbot_dns_sakuracloud +mypy_no_strict_source_paths = acme/acme certbot/certbot certbot-apache/certbot_apache certbot-compatibility-test/certbot_compatibility_test certbot-nginx/certbot_nginx source_paths = {[base]mypy_strict_source_paths} {[base]mypy_no_strict_source_paths} [testenv]