diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2022-11-19 23:06:29 -0500 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2022-11-20 23:08:44 +0200 |
commit | e0240515a629e2f8085a1a64470edeb3d9a668b4 (patch) | |
tree | 6ece8439f453c2c7e4486042b9588d46d371c8be /mesonbuild/modules/hotdoc.py | |
parent | c642a7693edbcf1043f820941ce2da05406cc442 (diff) | |
download | meson-e0240515a629e2f8085a1a64470edeb3d9a668b4.zip meson-e0240515a629e2f8085a1a64470edeb3d9a668b4.tar.gz meson-e0240515a629e2f8085a1a64470edeb3d9a668b4.tar.bz2 |
hotdoc module: remove homebrew function-proxied OrderedSet
We are just using this dictionary to get keys, and we could also just
set it ourselves but with None values. But we have a code abstraction
for this already; use it.
Diffstat (limited to 'mesonbuild/modules/hotdoc.py')
-rw-r--r-- | mesonbuild/modules/hotdoc.py | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/mesonbuild/modules/hotdoc.py b/mesonbuild/modules/hotdoc.py index 6a0c48b..c0eb127 100644 --- a/mesonbuild/modules/hotdoc.py +++ b/mesonbuild/modules/hotdoc.py @@ -16,7 +16,6 @@ import os import subprocess -from collections import OrderedDict from mesonbuild import mesonlib from mesonbuild import mlog, build @@ -53,7 +52,7 @@ class HotdocTargetBuilder: self.name = name self.state = state self.interpreter = interpreter - self.include_paths = OrderedDict() + self.include_paths = mesonlib.OrderedSet() self.builddir = state.environment.get_build_dir() self.sourcedir = state.environment.get_source_dir() @@ -197,7 +196,7 @@ class HotdocTargetBuilder: self.process_dependencies(dep.get_target_dependencies()) self._subprojects.extend(dep.subprojects) self.process_dependencies(dep.subprojects) - self.add_include_path(os.path.join(self.builddir, dep.hotdoc_conf.subdir)) + self.include_paths.add(os.path.join(self.builddir, dep.hotdoc_conf.subdir)) self.cmd += ['--extra-assets=' + p for p in dep.extra_assets] self.add_extension_paths(dep.extra_extension_paths) elif isinstance(dep, (build.CustomTarget, build.BuildTarget)): @@ -278,9 +277,6 @@ class HotdocTargetBuilder: if arg in self.kwargs: raise InvalidArguments(f'Argument "{arg}" is forbidden.') - def add_include_path(self, path): - self.include_paths[path] = path - def make_targets(self): self.check_forbidden_args() self.process_known_arg("--index", value_processor=self.ensure_file) @@ -288,7 +284,7 @@ class HotdocTargetBuilder: self.process_known_arg("--sitemap", value_processor=self.ensure_file) self.process_known_arg("--html-extra-theme", value_processor=self.ensure_dir) self.process_known_arg(None, "include_paths", - value_processor=lambda x: [self.add_include_path(self.ensure_dir(v)) for v in x]) + value_processor=lambda x: [self.include_paths.add(self.ensure_dir(v)) for v in x]) self.process_known_arg('--c-include-directories', argname="dependencies", value_processor=self.process_dependencies) self.process_gi_c_source_roots() self.process_extra_assets() @@ -307,13 +303,13 @@ class HotdocTargetBuilder: f.write('{}') self.cmd += ['--conf-file', hotdoc_config_path] - self.add_include_path(os.path.join(self.builddir, self.subdir)) - self.add_include_path(os.path.join(self.sourcedir, self.subdir)) + self.include_paths.add(os.path.join(self.builddir, self.subdir)) + self.include_paths.add(os.path.join(self.sourcedir, self.subdir)) depfile = os.path.join(self.builddir, self.subdir, self.name + '.deps') self.cmd += ['--deps-file-dest', depfile] - for path in self.include_paths.keys(): + for path in self.include_paths: self.cmd.extend(['--include-path', path]) if self.state.environment.coredata.get_option(mesonlib.OptionKey('werror', subproject=self.state.subproject)): |