Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PERF: remove isdir() check in copy_file(), about 10% of the run time was checking if the file to copy is a directory. #258

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
7a6f42b
👹 Feed the hobgoblins (delint).
jaraco Apr 14, 2024
a996148
Move compatibility modules into compat package.
jaraco Apr 14, 2024
b164d66
Move compatibility module into compat package.
jaraco Apr 14, 2024
89522f9
Fix return type to match implementation.
jaraco Apr 14, 2024
c6b23d0
🧎‍♀️ Genuflect to the types.
jaraco Apr 14, 2024
e5268b5
Oops. Meant 2025.
jaraco Apr 14, 2024
6c1cb08
Migrated config to pyproject.toml using jaraco.develop.migrate-config…
jaraco Apr 18, 2024
851e71a
Merge https://github.com/jaraco/skeleton
jaraco Apr 21, 2024
7dcde5e
Extract _make_executable for TestSpawn.
jaraco Apr 20, 2024
041c42e
Move and reword comment for brevity and clarity.
jaraco Apr 20, 2024
b07b4ed
Remove C901 exclusion; code is now compliant.
jaraco Apr 21, 2024
ef8f235
Remove apparently unnecessary cast to list.
jaraco Apr 21, 2024
03f1d85
Use proper boolean literals.
jaraco Apr 21, 2024
e85efee
Replace Popen with check_call.
jaraco Apr 21, 2024
976e935
Extract function for _debug wrapper.
jaraco Apr 21, 2024
d6652a4
Extract function to inject macos version.
jaraco Apr 21, 2024
806b1ca
👹 Feed the hobgoblins (delint).
jaraco Apr 21, 2024
e5b06e1
Merge https://github.com/jaraco/skeleton
jaraco Apr 24, 2024
4549de1
Use mkstemp unconditionally. mktemp has been deprecated since Python …
jaraco May 29, 2024
294b206
Merge https://github.com/jaraco/skeleton
jaraco Jun 19, 2024
a37185d
Pin to pytest<8.1.
jaraco Jun 19, 2024
745640e
PERF: remove isdir() check in copy_file(), about 10% of the run time …
rmmancom May 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move compatibility modules into compat package.
  • Loading branch information
jaraco committed Apr 14, 2024
commit a996148852f113b0a78cb222b8a2cd4dea54594b
2 changes: 1 addition & 1 deletion distutils/_modified.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from ._functools import splat
from .errors import DistutilsFileError
from .py39compat import zip_strict
from .compat.py39 import zip_strict


def _newer(source, target):
Expand Down
10 changes: 10 additions & 0 deletions distutils/compat/py38.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,13 @@ def removesuffix(self, suffix):

def removeprefix(self, prefix):
return self.removeprefix(prefix)


def aix_platform(osname, version, release):
try:
import _aix_support

return _aix_support.aix_platform()
except ImportError:
pass
return f"{osname}-{version}.{release}"
File renamed without changes.
8 changes: 0 additions & 8 deletions distutils/py38compat.py

This file was deleted.

4 changes: 2 additions & 2 deletions distutils/sysconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import sys
import sysconfig

from . import py39compat
from .compat import py39
from ._functools import pass_none
from .errors import DistutilsPlatformError

Expand Down Expand Up @@ -538,7 +538,7 @@ def get_config_vars(*args):
global _config_vars
if _config_vars is None:
_config_vars = sysconfig.get_config_vars().copy()
py39compat.add_ext_suffix(_config_vars)
py39.add_ext_suffix(_config_vars)

return [_config_vars.get(name) for name in args] if args else _config_vars

Expand Down
2 changes: 1 addition & 1 deletion distutils/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def get_host_platform():
if os.name == "posix" and hasattr(os, 'uname'):
osname, host, release, version, machine = os.uname()
if osname[:3] == "aix":
from .py38compat import aix_platform
from .compat.py38 import aix_platform

return aix_platform(osname, version, release)

Expand Down