fix style errors in fs.relative_to implementation

In commit f52bcaa27f a few issues were
added:
- doc typo
- imports for utils.universal are not intended to be directly used, it's
  an internal wrapper that exists solely to make mesonlib work well as
  it always did while simultaneously allowing `meson --internal`
  codepaths to avoid importing anything other than an extremely stripped
  down core
- type annotation specific import was imported at runtime scope
pull/12134/head
Eli Schwartz 2 years ago
parent 7a2b673d40
commit e313f78465
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 2
      docs/markdown/Fs-module.md
  2. 10
      mesonbuild/modules/fs.py

@ -228,7 +228,7 @@ fs.stem('foo/bar/baz.dll.a') # baz.dll
*Since 1.3.0*
Return a relative filepath. In event a relative path could not be found, the
Return a relative filepath. In the event a relative path could not be found, the
absolute path of `to` is returned. Relative path arguments will be assumed to be
relative to `meson.current_source_dir()`.

@ -23,19 +23,13 @@ from .. import mlog
from ..build import BuildTarget, CustomTarget, CustomTargetIndex, InvalidArguments
from ..interpreter.type_checking import INSTALL_KW, INSTALL_MODE_KW, INSTALL_TAG_KW, NoneType
from ..interpreterbase import FeatureNew, KwargInfo, typed_kwargs, typed_pos_args, noKwargs
from ..interpreterbase.baseobjects import TYPE_kwargs
from ..mesonlib import (
File,
MesonException,
has_path_sep,
path_is_in_root,
)
from ..utils.universal import relpath
from ..mesonlib import File, MesonException, has_path_sep, path_is_in_root, relpath
if T.TYPE_CHECKING:
from . import ModuleState
from ..build import BuildTargetTypes
from ..interpreter import Interpreter
from ..interpreterbase import TYPE_kwargs
from ..mesonlib import FileOrString, FileMode
from typing_extensions import TypedDict

Loading…
Cancel
Save