1
0
Fork 0

Merging upstream version 3.3.3.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-09 21:44:17 +01:00
parent 3c3dcb0078
commit 2d4389c2e7
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
8 changed files with 32 additions and 14 deletions

View file

@ -3,7 +3,7 @@ name: languages
on:
push:
branches: [main, test-me-*]
tags:
tags: '*'
pull_request:
concurrency:

View file

@ -3,7 +3,7 @@ name: main
on:
push:
branches: [main, test-me-*]
tags:
tags: '*'
pull_request:
concurrency:

View file

@ -10,7 +10,7 @@ repos:
- id: name-tests-test
- id: requirements-txt-fixer
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.2.0
rev: v2.3.0
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/asottile/reorder-python-imports
@ -20,12 +20,12 @@ repos:
exclude: ^(pre_commit/resources/|testing/resources/python3_hooks_repo/)
args: [--py38-plus, --add-import, 'from __future__ import annotations']
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.4.0
rev: v2.5.1
hooks:
- id: add-trailing-comma
args: [--py36-plus]
- repo: https://github.com/asottile/pyupgrade
rev: v3.4.0
rev: v3.6.0
hooks:
- id: pyupgrade
args: [--py38-plus]

View file

@ -1,3 +1,11 @@
3.3.3 - 2023-06-13
==================
### Fixes
- Work around OS packagers setting `--install-dir` / `--bin-dir` in gem settings.
- #2905 PR by @jaysoffian.
- #2799 issue by @lmilbaum.
3.3.2 - 2023-05-17
==================

View file

@ -114,6 +114,8 @@ def _install_ruby(
def install_environment(
prefix: Prefix, version: str, additional_dependencies: Sequence[str],
) -> None:
envdir = lang_base.environment_dir(prefix, ENVIRONMENT_DIR, version)
if version != 'system': # pragma: win32 no cover
_install_rbenv(prefix, version)
with in_env(prefix, version):
@ -135,6 +137,8 @@ def install_environment(
'gem', 'install',
'--no-document', '--no-format-executable',
'--no-user-install',
'--install-dir', os.path.join(envdir, 'gems'),
'--bindir', os.path.join(envdir, 'gems', 'bin'),
*prefix.star('.gem'), *additional_dependencies,
),
)

View file

@ -1,6 +1,6 @@
[metadata]
name = pre_commit
version = 3.3.2
version = 3.3.3
description = A framework for managing and maintaining multi-language pre-commit hooks.
long_description = file: README.md
long_description_content_type = text/markdown
@ -8,7 +8,7 @@ url = https://github.com/pre-commit/pre-commit
author = Anthony Sottile
author_email = asottile@umich.edu
license = MIT
license_file = LICENSE
license_files = LICENSE
classifiers =
License :: OSI Approved :: MIT License
Programming Language :: Python :: 3

View file

@ -1,4 +1,4 @@
FROM ubuntu:focal
FROM ubuntu:jammy
RUN : \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
@ -11,4 +11,4 @@ RUN : \
ENV LANG=C.UTF-8 PATH=/venv/bin:$PATH
RUN : \
&& python3 -mvenv /venv \
&& pip install --no-cache-dir pip setuptools wheel no-manylinux --upgrade
&& pip install --no-cache-dir pip distlib no-manylinux --upgrade

View file

@ -4,7 +4,6 @@ from __future__ import annotations
import argparse
import base64
import hashlib
import importlib.resources
import io
import os.path
import shutil
@ -42,10 +41,17 @@ def _add_shim(dest: str) -> None:
with zipfile.ZipFile(bio, 'w') as zipf:
zipf.write(shim, arcname='__main__.py')
with open(os.path.join(dest, 'python.exe'), 'wb') as f:
f.write(importlib.resources.read_binary('distlib', 't32.exe'))
f.write(b'#!py.exe -3\n')
f.write(bio.getvalue())
with tempfile.TemporaryDirectory() as tmpdir:
_exit_if_retv(
'podman', 'run', '--rm', '--volume', f'{tmpdir}:/out:rw', IMG,
'cp', '/venv/lib/python3.10/site-packages/distlib/t32.exe', '/out',
)
with open(os.path.join(dest, 'python.exe'), 'wb') as f:
with open(os.path.join(tmpdir, 't32.exe'), 'rb') as t32:
f.write(t32.read())
f.write(b'#!py.exe -3\n')
f.write(bio.getvalue())
def _write_cache_key(version: str, wheeldir: str, dest: str) -> None: