From 25b9096d31579f352415363b562384b586bd003c Mon Sep 17 00:00:00 2001 From: Kyle Benesch <4b796c65+github@gmail.com> Date: Fri, 22 Mar 2024 11:01:17 -0700 Subject: [PATCH 1/2] Update pre-commit hooks --- .pre-commit-config.yaml | 2 +- delocate/cmd/common.py | 1 + delocate/cmd/delocate_addplat.py | 1 + delocate/cmd/delocate_fuse.py | 1 + delocate/cmd/delocate_listdeps.py | 1 + delocate/cmd/delocate_patch.py | 1 + delocate/cmd/delocate_path.py | 1 + delocate/cmd/delocate_wheel.py | 1 + delocate/fuse.py | 1 - delocate/pkginfo.py | 1 + delocate/tests/conftest.py | 1 + delocate/tests/env_tools.py | 1 + delocate/tests/test_scripts.py | 1 + delocate/tests/test_tmpdirs.py | 1 + delocate/tests/test_tools.py | 1 + delocate/tests/test_wheelies.py | 1 + delocate/tmpdirs.py | 1 + delocate/tools.py | 1 + delocate/wheeltools.py | 6 ++---- setup.py | 1 + wheel_makers/fakepkg1/fakepkg1/tests/test_fakepkg.py | 1 + wheel_makers/fakepkg1/setup.py | 1 + wheel_makers/fakepkg2/fakepkg2/tests/test_fakepkg.py | 1 + wheel_makers/fakepkg2/setup.py | 1 + .../namespace/subpkg/tests/test_fakepkg.py | 1 + wheel_makers/fakepkg_namespace/setup.py | 1 + wheel_makers/fakepkg_rpath/fakepkg/tests/test_fakepkg.py | 1 + wheel_makers/fakepkg_rpath/setup.py | 1 + wheel_makers/fakepkg_toplevel/setup.py | 1 + wheel_makers/fakepkg_toplevel/test_fakepkg_toplevel.py | 1 + 30 files changed, 30 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 53ac59e1..32958de7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,7 +18,7 @@ repos: - id: fix-byte-order-marker - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.2.1 + rev: v0.3.4 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] diff --git a/delocate/cmd/common.py b/delocate/cmd/common.py index e87e7bf0..f4533516 100644 --- a/delocate/cmd/common.py +++ b/delocate/cmd/common.py @@ -2,6 +2,7 @@ All functions in this module are private. """ + from __future__ import annotations import glob diff --git a/delocate/cmd/delocate_addplat.py b/delocate/cmd/delocate_addplat.py index 7ef78b4a..1119eee4 100755 --- a/delocate/cmd/delocate_addplat.py +++ b/delocate/cmd/delocate_addplat.py @@ -13,6 +13,7 @@ delocate-addplat -x 10_9 -x 10_10 *.whl """ + # vim: ft=python from __future__ import absolute_import, division, print_function diff --git a/delocate/cmd/delocate_fuse.py b/delocate/cmd/delocate_fuse.py index 953c082e..0ad4e66c 100755 --- a/delocate/cmd/delocate_fuse.py +++ b/delocate/cmd/delocate_fuse.py @@ -3,6 +3,7 @@ Overwrites the first wheel in-place by default. """ + # vim: ft=python from __future__ import absolute_import, division, print_function diff --git a/delocate/cmd/delocate_listdeps.py b/delocate/cmd/delocate_listdeps.py index 1dfd2c2a..d3c19cf7 100755 --- a/delocate/cmd/delocate_listdeps.py +++ b/delocate/cmd/delocate_listdeps.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 """List library dependencies for libraries in path or wheel.""" + # vim: ft=python from __future__ import absolute_import, division, print_function diff --git a/delocate/cmd/delocate_patch.py b/delocate/cmd/delocate_patch.py index c62292e7..92b5d1fe 100755 --- a/delocate/cmd/delocate_patch.py +++ b/delocate/cmd/delocate_patch.py @@ -3,6 +3,7 @@ Overwrites the wheel in-place by default. """ + # vim: ft=python from __future__ import absolute_import, division, print_function diff --git a/delocate/cmd/delocate_path.py b/delocate/cmd/delocate_path.py index 6d3d0e97..014b896c 100755 --- a/delocate/cmd/delocate_path.py +++ b/delocate/cmd/delocate_path.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 """Copy, relink library dependencies for libraries in path.""" + # vim: ft=python from __future__ import absolute_import, division, print_function diff --git a/delocate/cmd/delocate_wheel.py b/delocate/cmd/delocate_wheel.py index e653cd05..26d0d75e 100755 --- a/delocate/cmd/delocate_wheel.py +++ b/delocate/cmd/delocate_wheel.py @@ -3,6 +3,7 @@ Overwrites the wheel in-place by default. """ + # vim: ft=python from __future__ import annotations diff --git a/delocate/fuse.py b/delocate/fuse.py index a7a41dde..75bf3abf 100644 --- a/delocate/fuse.py +++ b/delocate/fuse.py @@ -12,7 +12,6 @@ libraries. """ - import os import shutil from os.path import abspath, exists, relpath, splitext diff --git a/delocate/pkginfo.py b/delocate/pkginfo.py index 6524ed0d..e8b30129 100644 --- a/delocate/pkginfo.py +++ b/delocate/pkginfo.py @@ -2,6 +2,7 @@ This is based on a copy of the old wheel.pkginfo module. """ # noqa: E501 + from email.generator import Generator from email.message import Message from email.parser import Parser diff --git a/delocate/tests/conftest.py b/delocate/tests/conftest.py index c4bb1cfa..a6f7540d 100644 --- a/delocate/tests/conftest.py +++ b/delocate/tests/conftest.py @@ -1,4 +1,5 @@ """Pytest configuration script.""" + import os from pathlib import Path from typing import Iterator diff --git a/delocate/tests/env_tools.py b/delocate/tests/env_tools.py index 145f25e5..092d8438 100644 --- a/delocate/tests/env_tools.py +++ b/delocate/tests/env_tools.py @@ -1,4 +1,5 @@ """Context managers for working with environment variables.""" + import os from contextlib import contextmanager from typing import Iterator diff --git a/delocate/tests/test_scripts.py b/delocate/tests/test_scripts.py index 328dd512..18bb1bd0 100644 --- a/delocate/tests/test_scripts.py +++ b/delocate/tests/test_scripts.py @@ -6,6 +6,7 @@ the top-level folder ``scripts``. Otherwise try and get the scripts from the path. """ + from __future__ import annotations import os diff --git a/delocate/tests/test_tmpdirs.py b/delocate/tests/test_tmpdirs.py index 8d795afe..0118dc6c 100644 --- a/delocate/tests/test_tmpdirs.py +++ b/delocate/tests/test_tmpdirs.py @@ -1,4 +1,5 @@ """Test tmpdirs module.""" + from __future__ import absolute_import, division, print_function from os import getcwd diff --git a/delocate/tests/test_tools.py b/delocate/tests/test_tools.py index 79eeed6f..70ab4c34 100644 --- a/delocate/tests/test_tools.py +++ b/delocate/tests/test_tools.py @@ -1,4 +1,5 @@ """Test tools module.""" + from __future__ import division, print_function import os diff --git a/delocate/tests/test_wheelies.py b/delocate/tests/test_wheelies.py index af0c3232..cd60b068 100644 --- a/delocate/tests/test_wheelies.py +++ b/delocate/tests/test_wheelies.py @@ -1,4 +1,5 @@ """Direct tests of fixes to wheels.""" + from __future__ import annotations import os diff --git a/delocate/tmpdirs.py b/delocate/tmpdirs.py index ee67e838..c828f390 100644 --- a/delocate/tmpdirs.py +++ b/delocate/tmpdirs.py @@ -7,6 +7,7 @@ # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## """Contexts for *with* statement providing temporary directories.""" + from __future__ import absolute_import, division, print_function import os diff --git a/delocate/tools.py b/delocate/tools.py index bbc4424c..409950cb 100644 --- a/delocate/tools.py +++ b/delocate/tools.py @@ -1,4 +1,5 @@ """Tools for getting and setting install names.""" + from __future__ import annotations import logging diff --git a/delocate/wheeltools.py b/delocate/wheeltools.py index 198b4148..e749301a 100644 --- a/delocate/wheeltools.py +++ b/delocate/wheeltools.py @@ -175,8 +175,7 @@ def add_platforms( platforms: Iterable[str], out_path: str, clobber: bool = False, -) -> str: - ... +) -> str: ... @overload @@ -185,8 +184,7 @@ def add_platforms( platforms: Iterable[str], out_path: None = None, clobber: bool = False, -) -> None: - ... +) -> None: ... def add_platforms( diff --git a/setup.py b/setup.py index bb98c5c7..92fbd7f2 100755 --- a/setup.py +++ b/setup.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 """Setup script for delocate package.""" + from os.path import join as pjoin from setuptools import find_packages, setup diff --git a/wheel_makers/fakepkg1/fakepkg1/tests/test_fakepkg.py b/wheel_makers/fakepkg1/fakepkg1/tests/test_fakepkg.py index e42e4538..6f9c2d16 100644 --- a/wheel_makers/fakepkg1/fakepkg1/tests/test_fakepkg.py +++ b/wheel_makers/fakepkg1/fakepkg1/tests/test_fakepkg.py @@ -1,4 +1,5 @@ """Local package tests.""" + from delocate.tests.pytest_tools import assert_equal from ..module1 import func1 diff --git a/wheel_makers/fakepkg1/setup.py b/wheel_makers/fakepkg1/setup.py index 15e1aad0..e4eb26ca 100644 --- a/wheel_makers/fakepkg1/setup.py +++ b/wheel_makers/fakepkg1/setup.py @@ -3,6 +3,7 @@ fakepkg1 is a - fake package - that has extensions and links against an external dynamic lib. We use it to build a wheel, then test we can delocate it. """ + from os.path import abspath, dirname from os.path import join as pjoin from subprocess import check_call diff --git a/wheel_makers/fakepkg2/fakepkg2/tests/test_fakepkg.py b/wheel_makers/fakepkg2/fakepkg2/tests/test_fakepkg.py index e42e4538..6f9c2d16 100644 --- a/wheel_makers/fakepkg2/fakepkg2/tests/test_fakepkg.py +++ b/wheel_makers/fakepkg2/fakepkg2/tests/test_fakepkg.py @@ -1,4 +1,5 @@ """Local package tests.""" + from delocate.tests.pytest_tools import assert_equal from ..module1 import func1 diff --git a/wheel_makers/fakepkg2/setup.py b/wheel_makers/fakepkg2/setup.py index b2d780c3..e3ae959f 100644 --- a/wheel_makers/fakepkg2/setup.py +++ b/wheel_makers/fakepkg2/setup.py @@ -3,6 +3,7 @@ fakepkg2 is a - fake package - with Python only. We use it to build a wheel, then test we can delocate it. """ + from setuptools import setup setup( diff --git a/wheel_makers/fakepkg_namespace/namespace/subpkg/tests/test_fakepkg.py b/wheel_makers/fakepkg_namespace/namespace/subpkg/tests/test_fakepkg.py index d2f5ac38..04903393 100644 --- a/wheel_makers/fakepkg_namespace/namespace/subpkg/tests/test_fakepkg.py +++ b/wheel_makers/fakepkg_namespace/namespace/subpkg/tests/test_fakepkg.py @@ -1,4 +1,5 @@ """Local package tests.""" + from namespace.subpkg.module2 import func2, func3 # type: ignore diff --git a/wheel_makers/fakepkg_namespace/setup.py b/wheel_makers/fakepkg_namespace/setup.py index f8b359c8..454d323b 100644 --- a/wheel_makers/fakepkg_namespace/setup.py +++ b/wheel_makers/fakepkg_namespace/setup.py @@ -1,4 +1,5 @@ """Setup a namespace package with an extension linked to an external library.""" + import subprocess from pathlib import Path diff --git a/wheel_makers/fakepkg_rpath/fakepkg/tests/test_fakepkg.py b/wheel_makers/fakepkg_rpath/fakepkg/tests/test_fakepkg.py index e42e4538..6f9c2d16 100644 --- a/wheel_makers/fakepkg_rpath/fakepkg/tests/test_fakepkg.py +++ b/wheel_makers/fakepkg_rpath/fakepkg/tests/test_fakepkg.py @@ -1,4 +1,5 @@ """Local package tests.""" + from delocate.tests.pytest_tools import assert_equal from ..module1 import func1 diff --git a/wheel_makers/fakepkg_rpath/setup.py b/wheel_makers/fakepkg_rpath/setup.py index 5a1fba44..8a49967d 100644 --- a/wheel_makers/fakepkg_rpath/setup.py +++ b/wheel_makers/fakepkg_rpath/setup.py @@ -3,6 +3,7 @@ This fake package has an extension which links against a library using @rpath in its install name. The library will also be signed with an ad-hoc signature. """ + from os.path import abspath, dirname from os.path import join as pjoin from subprocess import check_call diff --git a/wheel_makers/fakepkg_toplevel/setup.py b/wheel_makers/fakepkg_toplevel/setup.py index 9ffa0784..6d120f1d 100644 --- a/wheel_makers/fakepkg_toplevel/setup.py +++ b/wheel_makers/fakepkg_toplevel/setup.py @@ -1,4 +1,5 @@ """Setup package with an extension linked to an external library.""" + import subprocess from pathlib import Path diff --git a/wheel_makers/fakepkg_toplevel/test_fakepkg_toplevel.py b/wheel_makers/fakepkg_toplevel/test_fakepkg_toplevel.py index 93506327..572971ac 100644 --- a/wheel_makers/fakepkg_toplevel/test_fakepkg_toplevel.py +++ b/wheel_makers/fakepkg_toplevel/test_fakepkg_toplevel.py @@ -1,4 +1,5 @@ """Test fake package.""" + from module2 import func2, func3 # type: ignore From 71ab9d00225dcb788a8e52c9eecccebba255b6be Mon Sep 17 00:00:00 2001 From: Kyle Benesch <4b796c65+github@gmail.com> Date: Fri, 22 Mar 2024 11:02:10 -0700 Subject: [PATCH 2/2] Prepare 0.11.0 release --- AUTHORS | 3 +++ Changelog.md | 2 ++ LICENSE | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index d2cbf694..1bbd7012 100644 --- a/AUTHORS +++ b/AUTHORS @@ -10,3 +10,6 @@ Andrew Murray Tansy Arron Cyrille Rossant Philip Garnero +Grzegorz Bokota +Jeremy Volkman +Matteo Cafasso diff --git a/Changelog.md b/Changelog.md index 9aea39fc..577839b3 100644 --- a/Changelog.md +++ b/Changelog.md @@ -10,6 +10,8 @@ rules on making a good Changelog. ## [Unreleased] +## [0.11.0] - 2024-03-22 + ### Added - Use `--require-target-macos-version` or the `MACOSX_DEPLOYMENT_TARGET` diff --git a/LICENSE b/LICENSE index 5226f8c7..048e1a3a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2014-2023, Matthew Brett and the Delocate contributors. +Copyright (c) 2014-2024, Matthew Brett and the Delocate contributors. All rights reserved. Redistribution and use in source and binary forms, with or without