Skip to content

Commit f6672c7

Browse files
committed
use real pathlib module
We added the _pathlib module to work around defeciencies in python 3.5's implementation, since we now rely on 3.6 lets drop this
1 parent cef406b commit f6672c7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+42
-92
lines changed

meson.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# limitations under the License.
1616

1717
import sys
18-
from mesonbuild._pathlib import Path
18+
from pathlib import Path
1919

2020
# If we're run uninstalled, add the script directory to sys.path to ensure that
2121
# we always import the correct mesonbuild modules even if PYTHONPATH is mangled

mesonbuild/_pathlib.py

-49
This file was deleted.

mesonbuild/backend/backends.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from collections import OrderedDict
1616
from functools import lru_cache
17-
from .._pathlib import Path
17+
from pathlib import Path
1818
import enum
1919
import json
2020
import os

mesonbuild/backend/ninjabackend.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from collections import OrderedDict
2121
from enum import Enum, unique
2222
import itertools
23-
from .._pathlib import PurePath, Path
23+
from pathlib import PurePath, Path
2424
from functools import lru_cache
2525

2626
from . import backends

mesonbuild/backend/vs2010backend.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import xml.etree.ElementTree as ET
2020
import uuid
2121
import typing as T
22-
from .._pathlib import Path, PurePath
22+
from pathlib import Path, PurePath
2323

2424
from . import backends
2525
from .. import build

mesonbuild/cmake/client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from .. import mlog
2020
from contextlib import contextmanager
2121
from subprocess import Popen, PIPE, TimeoutExpired
22-
from .._pathlib import Path
22+
from pathlib import Path
2323
import typing as T
2424
import json
2525

mesonbuild/cmake/common.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
from ..mesonlib import MesonException
1919
from .. import mlog
20-
from .._pathlib import Path
20+
from pathlib import Path
2121
import typing as T
2222

2323
language_map = {

mesonbuild/cmake/executor.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# or an interpreter-based tool.
1717

1818
import subprocess as S
19-
from .._pathlib import Path
19+
from pathlib import Path
2020
from threading import Thread
2121
import typing as T
2222
import re

mesonbuild/cmake/fileapi.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from .common import CMakeException, CMakeBuildFile, CMakeConfiguration
1616
import typing as T
1717
from .. import mlog
18-
from .._pathlib import Path
18+
from pathlib import Path
1919
import json
2020
import re
2121

mesonbuild/cmake/interpreter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from ..compilers.compilers import lang_suffixes, header_suffixes, obj_suffixes, lib_suffixes, is_header
2828
from enum import Enum
2929
from functools import lru_cache
30-
from .._pathlib import Path
30+
from pathlib import Path
3131
import typing as T
3232
import re
3333
from os import environ

mesonbuild/cmake/toolchain.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from .._pathlib import Path
15+
from pathlib import Path
1616
from ..envconfig import CMakeSkipCompilerTest
1717
from ..mesonlib import MachineChoice
1818
from .common import language_map

mesonbuild/cmake/traceparser.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from ..mesonlib import version_compare
2222

2323
import typing as T
24-
from .._pathlib import Path
24+
from pathlib import Path
2525
import re
2626
import json
2727
import textwrap

mesonbuild/compilers/fortran.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from .._pathlib import Path
15+
from pathlib import Path
1616
import typing as T
1717
import subprocess, os
1818

mesonbuild/compilers/mixins/clike.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import re
2929
import subprocess
3030
import typing as T
31-
from ..._pathlib import Path
31+
from pathlib import Path
3232

3333
from ... import arglist
3434
from ... import mesonlib

mesonbuild/compilers/mixins/pgi.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import typing as T
1818
import os
19-
from ..._pathlib import Path
19+
from pathlib import Path
2020

2121
from ..compilers import clike_debug_args, clike_optimization_args
2222

mesonbuild/coredata.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import pickle, os, uuid
1717
import sys
1818
from itertools import chain
19-
from ._pathlib import PurePath
19+
from pathlib import PurePath
2020
from collections import OrderedDict, defaultdict
2121
from .mesonlib import (
2222
MesonException, EnvironmentException, MachineChoice, PerMachine,

mesonbuild/dependencies/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import platform
2828
import typing as T
2929
from enum import Enum
30-
from .._pathlib import Path, PurePath
30+
from pathlib import Path, PurePath
3131

3232
from .. import mlog
3333
from .. import mesonlib

mesonbuild/dependencies/boost.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import re
1717
import functools
1818
import typing as T
19-
from .._pathlib import Path
19+
from pathlib import Path
2020

2121
from .. import mlog
2222
from .. import mesonlib

mesonbuild/dependencies/cuda.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import re
1717
import os
1818
import typing as T
19-
from .._pathlib import Path
19+
from pathlib import Path
2020

2121
from .. import mlog
2222
from .. import mesonlib

mesonbuild/dependencies/hdf5.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import re
2020
import shutil
2121
import subprocess
22-
from .._pathlib import Path
22+
from pathlib import Path
2323

2424
from ..mesonlib import OrderedSet, join_args
2525
from .base import (

mesonbuild/dependencies/misc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
# This file contains the detection logic for miscellaneous external dependencies.
1616

17-
from .._pathlib import Path
17+
from pathlib import Path
1818
import functools
1919
import re
2020
import sysconfig

mesonbuild/dependencies/scalapack.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from .._pathlib import Path
15+
from pathlib import Path
1616
import functools
1717
import os
1818
import typing as T

mesonbuild/envconfig.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from . import mesonlib
2020
from .mesonlib import EnvironmentException, MachineChoice, PerMachine, split_args
2121
from . import mlog
22-
from ._pathlib import Path
22+
from pathlib import Path
2323

2424
_T = T.TypeVar('_T')
2525

mesonbuild/interpreter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
from .cmake import CMakeInterpreter
3737
from .backend.backends import TestProtocol, Backend
3838

39-
from ._pathlib import Path, PurePath
39+
from pathlib import Path, PurePath
4040
import os
4141
import shutil
4242
import uuid

mesonbuild/mcompile.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import shutil
2222
import typing as T
2323
from collections import defaultdict
24-
from ._pathlib import Path
24+
from pathlib import Path
2525

2626
from . import mlog
2727
from . import mesonlib

mesonbuild/mdist.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import hashlib
2222
import json
2323
from glob import glob
24-
from ._pathlib import Path
24+
from pathlib import Path
2525
from mesonbuild.environment import detect_ninja
2626
from mesonbuild.mesonlib import windows_proof_rmtree, MesonException
2727
from mesonbuild.wrap import wrap

mesonbuild/mesondata.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121

2222
# TODO: Remember to remove this also from tools/gen_data.py
23-
from ._pathlib import Path
23+
from pathlib import Path
2424
import typing as T
2525

2626
if T.TYPE_CHECKING:

mesonbuild/mesonlib.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
"""A library of random helper functionality."""
16-
from ._pathlib import Path
16+
from pathlib import Path
1717
import sys
1818
import stat
1919
import time

mesonbuild/minit.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
"""Code that creates simple startup projects."""
1616

17-
from ._pathlib import Path
17+
from pathlib import Path
1818
from enum import Enum
1919
import subprocess
2020
import shutil

mesonbuild/mintro.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from .backend import backends
2929
from .mparser import BaseNode, FunctionNode, ArrayNode, ArgumentNode, StringNode
3030
from .interpreter import Interpreter
31-
from ._pathlib import Path, PurePath
31+
from pathlib import Path, PurePath
3232
import typing as T
3333
import os
3434
import argparse

mesonbuild/mlog.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import platform
2020
import typing as T
2121
from contextlib import contextmanager
22-
from ._pathlib import Path
22+
from pathlib import Path
2323

2424
"""This is (mostly) a standalone module used to write logging
2525
information about Meson runs. Some output goes to screen,

mesonbuild/modules/fs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import typing as T
1616
import hashlib
17-
from .._pathlib import Path, PurePath, PureWindowsPath
17+
from pathlib import Path, PurePath, PureWindowsPath
1818

1919
from .. import mlog
2020
from . import ExtensionModule

mesonbuild/modules/pkgconfig.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
import os, types
16-
from .._pathlib import PurePath
16+
from pathlib import PurePath
1717

1818
from .. import build
1919
from .. import dependencies

mesonbuild/modules/python.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import shutil
1818
import typing as T
1919

20-
from .._pathlib import Path
20+
from pathlib import Path
2121
from .. import mesonlib
2222
from ..mesonlib import MachineChoice, MesonException
2323
from . import ExtensionModule

mesonbuild/modules/unstable_external_project.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
import os, subprocess, shlex
16-
from .._pathlib import Path
16+
from pathlib import Path
1717
import typing as T
1818

1919
from . import ExtensionModule, ModuleReturnValue

mesonbuild/msubprojects.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os, subprocess
22
import argparse
3-
from ._pathlib import Path
3+
from pathlib import Path
44

55
from . import mlog
66
from .mesonlib import quiet_git, verbose_git, GitException, Popen_safe, MesonException, windows_proof_rmtree

mesonbuild/mtest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
# A tool to run tests in many different ways.
1616

17-
from ._pathlib import Path
17+
from pathlib import Path
1818
from collections import deque, namedtuple
1919
from copy import deepcopy
2020
import argparse

mesonbuild/wrap/wrap.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import typing as T
2929
import textwrap
3030

31-
from .._pathlib import Path
31+
from pathlib import Path
3232
from . import WrapMode
3333
from .. import coredata
3434
from ..mesonlib import quiet_git, GIT, ProgressBar, MesonException

run_meson_command_tests.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import unittest
2020
import subprocess
2121
import zipapp
22-
from mesonbuild._pathlib import Path
22+
from pathlib import Path
2323

2424
from mesonbuild.mesonlib import windows_proof_rmtree, python_command, is_windows
2525
from mesonbuild.coredata import version as meson_version

run_mypy.py

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
'mesonbuild/wrap',
1616

1717
# specific files
18-
'mesonbuild/_pathlib.py',
1918
'mesonbuild/arglist.py',
2019
# 'mesonbuild/coredata.py',
2120
'mesonbuild/dependencies/boost.py',

0 commit comments

Comments
 (0)