summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2023-06-26 14:24:11 +0200
committerFlorian Bruhin <me@the-compiler.org>2023-06-26 14:39:54 +0200
commit93c7fdd60c0f1f0d26415525914fdca997b06c42 (patch)
treec102bdb52a4b079084ee6a9925e20de73a96d5ba /scripts
parentb9855b910448b504ab34ef11e91caab62c39c8e6 (diff)
downloadqutebrowser-93c7fdd60c0f1f0d26415525914fdca997b06c42.tar.gz
qutebrowser-93c7fdd60c0f1f0d26415525914fdca997b06c42.zip
Initial Python 3.7 drop
Diffstat (limited to 'scripts')
-rw-r--r--scripts/dev/changelog_urls.json2
-rw-r--r--scripts/dev/recompile_requirements.py25
2 files changed, 5 insertions, 22 deletions
diff --git a/scripts/dev/changelog_urls.json b/scripts/dev/changelog_urls.json
index 4141a2ebc..1c9528f22 100644
--- a/scripts/dev/changelog_urls.json
+++ b/scripts/dev/changelog_urls.json
@@ -23,7 +23,6 @@
"Flask": "https://flask.palletsprojects.com/en/latest/changes/",
"Mako": "https://docs.makotemplates.org/en/latest/changelog.html",
"hypothesis": "https://hypothesis.readthedocs.io/en/latest/changes.html",
- "exceptiongroup": "https://github.com/agronholm/exceptiongroup/blob/main/CHANGES.rst",
"mypy": "https://mypy-lang.blogspot.com/",
"types-PyYAML": "https://github.com/python/typeshed/commits/main/stubs/PyYAML",
"pytest": "https://docs.pytest.org/en/latest/changelog.html",
@@ -84,7 +83,6 @@
"pyinstaller": "https://pyinstaller.readthedocs.io/en/stable/CHANGES.html",
"pyinstaller-hooks-contrib": "https://github.com/pyinstaller/pyinstaller-hooks-contrib/blob/master/CHANGELOG.rst",
"pytest-benchmark": "https://pytest-benchmark.readthedocs.io/en/stable/changelog.html",
- "typed-ast": "https://github.com/python/typed_ast/commits/master",
"docutils": "https://docutils.sourceforge.io/RELEASE-NOTES.html",
"bump2version": "https://github.com/c4urself/bump2version/blob/master/CHANGELOG.md",
"six": "https://github.com/benjaminp/six/blob/master/CHANGES",
diff --git a/scripts/dev/recompile_requirements.py b/scripts/dev/recompile_requirements.py
index 365f9a51e..8459031e2 100644
--- a/scripts/dev/recompile_requirements.py
+++ b/scripts/dev/recompile_requirements.py
@@ -144,11 +144,11 @@ def run_pip(venv_dir, *args, quiet=False, **kwargs):
return subprocess.run([venv_python, '-m', 'pip'] + args, check=True, **kwargs)
-def init_venv(host_python, venv_dir, requirements, pre=False, pip_args=None):
+def init_venv(venv_dir, requirements, pre=False, pip_args=None):
"""Initialize a new virtualenv and install the given packages."""
with utils.gha_group('Creating virtualenv'):
utils.print_col('$ python3 -m venv {}'.format(venv_dir), 'blue')
- subprocess.run([host_python, '-m', 'venv', venv_dir], check=True)
+ subprocess.run([sys.executable, '-m', 'venv', venv_dir], check=True)
run_pip(venv_dir, 'install', '-U', 'pip', quiet=not utils.ON_CI)
run_pip(venv_dir, 'install', '-U', 'setuptools', 'wheel', quiet=not utils.ON_CI)
@@ -347,17 +347,6 @@ def print_changed_files():
print('::set-output name=diff::' + diff_table)
-def get_host_python(name):
- """Get the Python to use for a given requirement name.
-
- pylint installs typed_ast on < 3.8 only
- """
- if name == 'pylint':
- return 'python3.7'
- else:
- return sys.executable
-
-
def get_venv_python(venv_dir):
"""Get the path to Python inside a virtualenv."""
subdir = 'Scripts' if os.name == 'nt' else 'bin'
@@ -375,14 +364,12 @@ def build_requirements(name):
"""Build a requirements file."""
utils.print_subtitle("Building")
filename = os.path.join(REQ_DIR, 'requirements-{}.txt-raw'.format(name))
- host_python = get_host_python(name)
with open(filename, 'r', encoding='utf-8') as f:
comments = read_comments(f)
with tempfile.TemporaryDirectory() as tmpdir:
- init_venv(host_python=host_python,
- venv_dir=tmpdir,
+ init_venv(venv_dir=tmpdir,
requirements=filename,
pre=comments['pre'],
pip_args=comments['pip_args'])
@@ -411,14 +398,13 @@ def build_requirements(name):
def test_tox():
"""Test requirements via tox."""
- host_python = get_host_python('tox')
req_path = os.path.join(REQ_DIR, 'requirements-tox.txt')
with tempfile.TemporaryDirectory() as tmpdir:
venv_dir = os.path.join(tmpdir, 'venv')
tox_workdir = os.path.join(tmpdir, 'tox-workdir')
venv_python = get_venv_python(venv_dir)
- init_venv(host_python, venv_dir, req_path)
+ init_venv(venv_dir, req_path)
list_proc = subprocess.run([venv_python, '-m', 'tox', '--listenvs'],
check=True,
stdout=subprocess.PIPE,
@@ -448,9 +434,8 @@ def test_requirements(name, outfile, *, force=False):
with open(in_file, 'r', encoding='utf-8') as f:
comments = read_comments(f)
- host_python = get_host_python(name)
with tempfile.TemporaryDirectory() as tmpdir:
- init_venv(host_python, tmpdir, outfile, pip_args=comments['pip_args'])
+ init_venv(tmpdir, outfile, pip_args=comments['pip_args'])
def cleanup_pylint_build():