diff options
| author | Dylan Baker <dylan@pnwbakers.com> | 2021-07-27 15:26:02 -0700 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2021-09-24 10:36:05 -0700 |
| commit | d661a0cd96e2453e8e4629c867589657b81239d1 (patch) | |
| tree | dfe6acbb7a20b0f2a43e334470a311aa8f754122 /mesonbuild/modules/pkgconfig.py | |
| parent | 6c5bfd4c241e94f5e0f4dea9ba7fb5d5090a4802 (diff) | |
| download | meson-d661a0cd96e2453e8e4629c867589657b81239d1.tar.gz | |
build: use an object rather than a dict for the dep_manifest
This really is more of a struct than a dict, as the types are disjoint
and they are internally handled, (ie, not from user input). This cleans
some things up, in addition I spotted a bug in the ModuleState where the
dict with the version and license is passed to a field that expects just
the version string.
Diffstat (limited to 'mesonbuild/modules/pkgconfig.py')
| -rw-r--r-- | mesonbuild/modules/pkgconfig.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py index f73e16882..7be479667 100644 --- a/mesonbuild/modules/pkgconfig.py +++ b/mesonbuild/modules/pkgconfig.py @@ -12,18 +12,22 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os from pathlib import PurePath +import os +import typing as T +from . import ExtensionModule +from . import ModuleReturnValue from .. import build from .. import dependencies -from ..dependencies import ThreadDependency from .. import mesonlib from .. import mlog -from . import ModuleReturnValue -from . import ExtensionModule +from ..dependencies import ThreadDependency from ..interpreterbase import permittedKwargs, FeatureNew, FeatureNewKwargs +if T.TYPE_CHECKING: + from . import ModuleState + already_warned_objs = set() class DependenciesHelper: @@ -451,8 +455,8 @@ class PkgConfigModule(ExtensionModule): 'install_dir', 'extra_cflags', 'variables', 'url', 'd_module_versions', 'dataonly', 'conflicts', 'uninstalled_variables', 'unescaped_variables', 'unescaped_uninstalled_variables'}) - def generate(self, state, args, kwargs): - default_version = state.project_version['version'] + def generate(self, state: 'ModuleState', args, kwargs): + default_version = state.project_version default_install_dir = None default_description = None default_name = None |
