summaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-04-04 18:42:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-04-04 18:42:30 +0000
commit9d68e4e3da4ce68e28506d926c7de9fd6ffbf6a3 (patch)
treea6d016823a24941dd795d30ba84409db12aa41cb /testing
parentReleasing debian version 2.17.0-1. (diff)
downloadpre-commit-9d68e4e3da4ce68e28506d926c7de9fd6ffbf6a3.tar.xz
pre-commit-9d68e4e3da4ce68e28506d926c7de9fd6ffbf6a3.zip
Merging upstream version 2.18.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing')
-rw-r--r--testing/auto_namedtuple.py2
-rw-r--r--testing/fixtures.py2
-rwxr-xr-xtesting/gen-languages-all2
-rwxr-xr-xtesting/make-archives7
-rw-r--r--testing/resources/python3_hooks_repo/.pre-commit-hooks.yaml1
-rw-r--r--testing/resources/python_hooks_repo/foo.py2
-rw-r--r--testing/resources/python_hooks_repo/setup.py2
-rw-r--r--testing/resources/python_venv_hooks_repo/foo.py2
-rw-r--r--testing/resources/python_venv_hooks_repo/setup.py2
-rw-r--r--testing/util.py2
-rw-r--r--testing/zipapp/Dockerfile4
-rwxr-xr-xtesting/zipapp/entry7
-rwxr-xr-xtesting/zipapp/make2
-rwxr-xr-xtesting/zipapp/python7
14 files changed, 30 insertions, 14 deletions
diff --git a/testing/auto_namedtuple.py b/testing/auto_namedtuple.py
index 0841094..d5a4377 100644
--- a/testing/auto_namedtuple.py
+++ b/testing/auto_namedtuple.py
@@ -1,3 +1,5 @@
+from __future__ import annotations
+
import collections
diff --git a/testing/fixtures.py b/testing/fixtures.py
index f7def08..ef5a041 100644
--- a/testing/fixtures.py
+++ b/testing/fixtures.py
@@ -1,3 +1,5 @@
+from __future__ import annotations
+
import contextlib
import os.path
import shutil
diff --git a/testing/gen-languages-all b/testing/gen-languages-all
index 152cf3c..dfd92c0 100755
--- a/testing/gen-languages-all
+++ b/testing/gen-languages-all
@@ -1,4 +1,6 @@
#!/usr/bin/env python3
+from __future__ import annotations
+
import sys
LANGUAGES = [
diff --git a/testing/make-archives b/testing/make-archives
index ce098ba..1b825fe 100755
--- a/testing/make-archives
+++ b/testing/make-archives
@@ -1,4 +1,6 @@
#!/usr/bin/env python3
+from __future__ import annotations
+
import argparse
import gzip
import os.path
@@ -6,7 +8,6 @@ import shutil
import subprocess
import tarfile
import tempfile
-from typing import Optional
from typing import Sequence
@@ -16,7 +17,7 @@ from typing import Sequence
REPOS = (
('rbenv', 'https://github.com/rbenv/rbenv', '38e1fbb'),
- ('ruby-build', 'https://github.com/rbenv/ruby-build', '8663d2f'),
+ ('ruby-build', 'https://github.com/rbenv/ruby-build', 'a5ca3e4'),
(
'ruby-download',
'https://github.com/garnieretienne/rvm-download',
@@ -69,7 +70,7 @@ def make_archive(name: str, repo: str, ref: str, destdir: str) -> str:
return output_path
-def main(argv: Optional[Sequence[str]] = None) -> int:
+def main(argv: Sequence[str] | None = None) -> int:
parser = argparse.ArgumentParser()
parser.add_argument('--dest', default='pre_commit/resources')
args = parser.parse_args(argv)
diff --git a/testing/resources/python3_hooks_repo/.pre-commit-hooks.yaml b/testing/resources/python3_hooks_repo/.pre-commit-hooks.yaml
index 2c23700..964cf83 100644
--- a/testing/resources/python3_hooks_repo/.pre-commit-hooks.yaml
+++ b/testing/resources/python3_hooks_repo/.pre-commit-hooks.yaml
@@ -2,5 +2,4 @@
name: Python 3 Hook
entry: python3-hook
language: python
- language_version: python3
files: \.py$
diff --git a/testing/resources/python_hooks_repo/foo.py b/testing/resources/python_hooks_repo/foo.py
index 9c4368e..40efde3 100644
--- a/testing/resources/python_hooks_repo/foo.py
+++ b/testing/resources/python_hooks_repo/foo.py
@@ -1,3 +1,5 @@
+from __future__ import annotations
+
import sys
diff --git a/testing/resources/python_hooks_repo/setup.py b/testing/resources/python_hooks_repo/setup.py
index 0559271..cff6cad 100644
--- a/testing/resources/python_hooks_repo/setup.py
+++ b/testing/resources/python_hooks_repo/setup.py
@@ -1,3 +1,5 @@
+from __future__ import annotations
+
from setuptools import setup
setup(
diff --git a/testing/resources/python_venv_hooks_repo/foo.py b/testing/resources/python_venv_hooks_repo/foo.py
index 9c4368e..40efde3 100644
--- a/testing/resources/python_venv_hooks_repo/foo.py
+++ b/testing/resources/python_venv_hooks_repo/foo.py
@@ -1,3 +1,5 @@
+from __future__ import annotations
+
import sys
diff --git a/testing/resources/python_venv_hooks_repo/setup.py b/testing/resources/python_venv_hooks_repo/setup.py
index 0559271..cff6cad 100644
--- a/testing/resources/python_venv_hooks_repo/setup.py
+++ b/testing/resources/python_venv_hooks_repo/setup.py
@@ -1,3 +1,5 @@
+from __future__ import annotations
+
from setuptools import setup
setup(
diff --git a/testing/util.py b/testing/util.py
index 283ed47..0dd1784 100644
--- a/testing/util.py
+++ b/testing/util.py
@@ -1,3 +1,5 @@
+from __future__ import annotations
+
import contextlib
import os.path
import subprocess
diff --git a/testing/zipapp/Dockerfile b/testing/zipapp/Dockerfile
index e21d5fe..7c74c1b 100644
--- a/testing/zipapp/Dockerfile
+++ b/testing/zipapp/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:bionic
+FROM ubuntu:focal
RUN : \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
@@ -10,5 +10,5 @@ RUN : \
ENV LANG=C.UTF-8 PATH=/venv/bin:$PATH
RUN : \
- && python3.6 -mvenv /venv \
+ && python3 -mvenv /venv \
&& pip install --no-cache-dir pip setuptools wheel no-manylinux --upgrade
diff --git a/testing/zipapp/entry b/testing/zipapp/entry
index 87f9291..15758d9 100755
--- a/testing/zipapp/entry
+++ b/testing/zipapp/entry
@@ -1,4 +1,6 @@
#!/usr/bin/env python3
+from __future__ import annotations
+
import os.path
import shutil
import stat
@@ -59,10 +61,7 @@ def main() -> int:
if sys.platform == 'win32': # https://bugs.python.org/issue19124
import subprocess
- if sys.version_info < (3, 7): # https://bugs.python.org/issue25942
- return subprocess.Popen(cmd).wait()
- else:
- return subprocess.call(cmd)
+ return subprocess.call(cmd)
else:
os.execvp(cmd[0], cmd)
diff --git a/testing/zipapp/make b/testing/zipapp/make
index effc812..37b5c35 100755
--- a/testing/zipapp/make
+++ b/testing/zipapp/make
@@ -1,4 +1,6 @@
#!/usr/bin/env python3
+from __future__ import annotations
+
import argparse
import base64
import hashlib
diff --git a/testing/zipapp/python b/testing/zipapp/python
index 7184a1a..67910fc 100755
--- a/testing/zipapp/python
+++ b/testing/zipapp/python
@@ -1,5 +1,7 @@
#!/usr/bin/env python3
"""A shim executable to put dependencies on sys.path"""
+from __future__ import annotations
+
import argparse
import os.path
import runpy
@@ -36,10 +38,7 @@ def main() -> int:
if sys.platform == 'win32': # https://bugs.python.org/issue19124
import subprocess
- if sys.version_info < (3, 7): # https://bugs.python.org/issue25942
- return subprocess.Popen(cmd).wait()
- else:
- return subprocess.call(cmd)
+ return subprocess.call(cmd)
else:
os.execvp(cmd[0], cmd)