Skip to content

Commit

Permalink
Merge pull request #226 from HexDecimal/python-3.9
Browse files Browse the repository at this point in the history
Require Python 3.9, apply pyupgrade linter
  • Loading branch information
HexDecimal authored Oct 15, 2024
2 parents b0c3781 + 85e4719 commit dfb21c8
Show file tree
Hide file tree
Showing 28 changed files with 254 additions and 309 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,6 @@ jobs:
- os: "macos-13"
xcode: "14.2"
python: "3.x"
- os: "ubuntu-latest"
python: "3.7"
- os: "ubuntu-latest"
python: "3.8"
- os: "ubuntu-latest"
python: "3.9"
- os: "ubuntu-latest"
Expand Down
14 changes: 0 additions & 14 deletions .mypy.ini

This file was deleted.

10 changes: 10 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ rules on making a good Changelog.

## [Unreleased]

### Changed

- `patch_wheel` function raises `FileNotFoundError` instead of `ValueError` on
missing patch files.

### Removed

- Dropped support for Python 3.7 and Python 3.8.
[#226](https://github.com/matthew-brett/delocate/pull/226)

## [0.12.0] - 2024-08-29

### Added
Expand Down
5 changes: 3 additions & 2 deletions delocate/cmd/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
import os
import sys
from argparse import ArgumentParser, Namespace
from collections.abc import Iterable, Iterator
from pathlib import Path
from typing import Callable, Iterable, Iterator, List
from typing import Callable

from typing_extensions import Literal, TypedDict

Expand Down Expand Up @@ -102,7 +103,7 @@ class DelocateArgs(TypedDict):

def delocate_values(args: Namespace) -> DelocateArgs:
"""Return the common kwargs for delocate_path and delocate_wheel."""
exclude_files: List[str] = args.exclude
exclude_files: list[str] = args.exclude

def copy_filter_exclude(name: str) -> bool:
"""Return False if name is excluded, uses normal rules otherwise."""
Expand Down
15 changes: 6 additions & 9 deletions delocate/cmd/delocate_addplat.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"""

# vim: ft=python
from __future__ import absolute_import, division, print_function

import os
from argparse import ArgumentParser
Expand Down Expand Up @@ -107,15 +106,15 @@ def main() -> None: # noqa: D103
if args.osx_ver is not None:
for ver in args.osx_ver:
plat_tags += [
"macosx_{0}_{1}".format(ver, args.dual_arch_type),
"macosx_{0}_x86_64".format(ver),
f"macosx_{ver}_{args.dual_arch_type}",
f"macosx_{ver}_x86_64",
]
if len(plat_tags) == 0:
raise RuntimeError("Need at least one --osx-ver or --plat-tag")
for wheel in wheels:
if multi or args.verbose:
print(
"Setting platform tags {0} for wheel {1}".format(
"Setting platform tags {} for wheel {}".format(
",".join(plat_tags), wheel
)
)
Expand All @@ -125,18 +124,16 @@ def main() -> None: # noqa: D103
)
except WheelToolsError as e:
if args.skip_errors:
print("Cannot modify {0} because {1}".format(wheel, e))
print(f"Cannot modify {wheel} because {e}")
continue
raise
if args.verbose:
if fname is None:
print(
"{0} already has tags {1}".format(
wheel, ", ".join(plat_tags)
)
"{} already has tags {}".format(wheel, ", ".join(plat_tags))
)
else:
print("Wrote {0}".format(fname))
print(f"Wrote {fname}")
if (
args.rm_orig
and fname is not None
Expand Down
1 change: 0 additions & 1 deletion delocate/cmd/delocate_listdeps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"""List library dependencies for libraries in path or wheel."""

# vim: ft=python
from __future__ import absolute_import, division, print_function

from argparse import ArgumentParser
from os import getcwd
Expand Down
2 changes: 1 addition & 1 deletion delocate/cmd/delocate_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
def main() -> None: # noqa: D103
args = parser.parse_args()
verbosity_config(args)
wheel1, wheel2 = [Path(wheel).resolve(strict=True) for wheel in args.wheels]
wheel1, wheel2 = (Path(wheel).resolve(strict=True) for wheel in args.wheels)
out_wheel = Path(
args.wheel_dir if args.wheel_dir is not None else wheel1.parent
).resolve()
Expand Down
5 changes: 2 additions & 3 deletions delocate/cmd/delocate_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"""

# vim: ft=python
from __future__ import absolute_import, division, print_function

import os
from argparse import ArgumentParser
Expand Down Expand Up @@ -41,14 +40,14 @@ def main() -> None: # noqa: D103
else:
wheel_dir = None
if args.verbose:
print("Patching: {0} with {1}".format(args.wheel, args.patch_fname))
print(f"Patching: {args.wheel} with {args.patch_fname}")
if wheel_dir:
out_wheel = pjoin(wheel_dir, basename(args.wheel))
else:
out_wheel = args.wheel
patch_wheel(args.wheel, args.patch_fname, out_wheel)
if args.verbose:
print("Patched wheel {0} to {1}:".format(args.wheel, out_wheel))
print(f"Patched wheel {args.wheel} to {out_wheel}:")


if __name__ == "__main__":
Expand Down
1 change: 0 additions & 1 deletion delocate/cmd/delocate_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"""Copy, relink library dependencies for libraries in path."""

# vim: ft=python
from __future__ import absolute_import, division, print_function

import os
from argparse import ArgumentParser
Expand Down
5 changes: 2 additions & 3 deletions delocate/cmd/delocate_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from argparse import ArgumentParser
from os.path import basename, exists, expanduser
from os.path import join as pjoin
from typing import List, Optional, Text

from packaging.version import Version

Expand Down Expand Up @@ -89,7 +88,7 @@ def main() -> None: # noqa: D103
os.makedirs(wheel_dir)
else:
wheel_dir = None
require_archs: Optional[List[Text]] = None
require_archs: list[str] | None = None
if args.require_archs is None:
require_archs = [] if args.check_archs else None
elif "," in args.require_archs:
Expand Down Expand Up @@ -122,7 +121,7 @@ def main() -> None: # noqa: D103
**delocate_values(args),
)
if args.verbose and len(copied):
print("Copied to package {0} directory:".format(args.lib_sdir))
print(f"Copied to package {args.lib_sdir} directory:")
copy_lines = [" " + name for name in sorted(copied)]
print("\n".join(copy_lines))

Expand Down
Loading

0 comments on commit dfb21c8

Please sign in to comment.