Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 14 additions & 3 deletions colcon_meson/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os
from pathlib import Path
import shutil
import sys
from typing import List

# colcon
Expand All @@ -15,11 +16,21 @@
from colcon_core.task import run
from colcon_core.task import TaskExtensionPoint
# meson
from mesonbuild import coredata
from mesonbuild.build import OptionKey
from mesonbuild.mesonmain import CommandLineParser


if sys.version_info >= (3, 8):
from importlib.metadata import version
else:
from importlib_metadata import version

if tuple(map(int, version("meson").split(".")[:3])) >= (1, 10, 0):
Comment thread
MatthijsBurgh marked this conversation as resolved.
from mesonbuild import cmdline as meson_cmd
else:
from mesonbuild import coredata as meson_cmd


logger = colcon_logger.getChild(__name__)


Expand Down Expand Up @@ -145,7 +156,7 @@ def meson_parse_cmdline(self, cmdline: List[str]) -> Namespace:
Namespace: parse args
"""
args = self.parser_setup.parse_args(cmdline)
coredata.parse_cmd_line_options(args)
meson_cmd.parse_cmd_line_options(args)
return args

def meson_format_cmdline(self, cmdline: List[str]):
Expand All @@ -169,7 +180,7 @@ def meson_format_cmdline_file(self, builddir: str):
dict: converted key-value pairs
"""
args = self.meson_parse_cmdline([])
coredata.read_cmd_line_file(builddir, args)
meson_cmd.read_cmd_line_file(builddir, args)
return format_args(args)

async def build(self, *, additional_hooks=None, skip_hook_creation=False,
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ python_requires = >=3.6
install_requires =
colcon-core >= 0.10.0
colcon-library-path
importlib-metadata; python_version < "3.8"
meson >= 0.60.0
packages = find:

Expand Down
2 changes: 1 addition & 1 deletion stdeb.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[colcon-meson]
No-Python2:
Depends3: python3-colcon-core (>= 0.10.0), python3-colcon-library-path, meson (>= 0.60.0)
Depends3: python3-colcon-core (>= 0.10.0), python3-colcon-library-path, python3 (>= 3.8) | python3-importlib-metadata, meson (>= 0.60.0)
Suite: jammy noble bookworm trixie
X-Python3-Version: >= 3.6
Upstream-Version-Suffix: +upstream
1 change: 1 addition & 0 deletions test/spell_check.words
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ configfile
coredata
defcfg
holderify
importlib
initialise
interpreterbase
iterdir
Expand Down
1 change: 0 additions & 1 deletion test/test_spell_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

@pytest.fixture(scope='module')
def known_words():
global spell_check_words_path
Comment thread
christianrauch marked this conversation as resolved.
return spell_check_words_path.read_text().splitlines()


Expand Down
Loading