Skip to content

Commit

Permalink
Merge pull request #1 from lengau/aml_qmake
Browse files Browse the repository at this point in the history
linting fixes
  • Loading branch information
ScarlettGatelyMoore authored May 26, 2023
2 parents ed12228 + 80a9db6 commit 3bd056f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions craft_parts/plugins/qmake_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def unmarshal(cls, data: Dict[str, Any]):
return cls(**plugin_data)


class QMakePlugin(Plugin):
class QmakePlugin(Plugin):
"""The qmake plugin is useful for building qmake-based parts.
These are projects that are built using .pro files.
Expand Down Expand Up @@ -97,7 +97,7 @@ def get_build_commands(self) -> List[str]:
] + options.qmake_parameters

if options.qmake_project_file:
qmake_configure_command.append(
qmake_configure_command.extend(
[
f'"{self._part_info.part_src_dir}"',
"/",
Expand Down
26 changes: 13 additions & 13 deletions tests/unit/plugins/test_qmake_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

from craft_parts.infos import PartInfo, ProjectInfo
from craft_parts.parts import Part
from craft_parts.plugins.qmake_plugin import QMakePlugin
from craft_parts.plugins.qmake_plugin import QmakePlugin


@pytest.fixture
Expand All @@ -30,7 +30,7 @@ def _setup_method_fixture(new_dir, properties=None):
if properties is None:
properties = {}
properties["source"] = "."
plugin_properties = QMakePlugin.properties_class.unmarshal(properties)
plugin_properties = QmakePlugin.properties_class.unmarshal(properties)
part = Part("foo", {})

project_info = ProjectInfo(application_name="test", cache_dir=new_dir)
Expand All @@ -39,7 +39,7 @@ def _setup_method_fixture(new_dir, properties=None):
part_info = PartInfo(project_info=project_info, part=part)
part_info._part_install_dir = Path("install/dir")

return QMakePlugin(properties=plugin_properties, part_info=part_info)
return QmakePlugin(properties=plugin_properties, part_info=part_info)

yield _setup_method_fixture

Expand Down Expand Up @@ -70,9 +70,9 @@ def test_get_build_commands_default(self, setup_method_fixture, new_dir):
plugin = setup_method_fixture(new_dir)

assert plugin.get_build_commands() == [
f"qmake QMAKE_CFLAGS+=${CFLAGS:-} QMAKE_CXXFLAGS+=${CXXFLAGS:-} QMAKE_LFLAGS+=${LDFLAGS:-}",
f"env -u CFLAGS -u CXXFLAGS make -j{self._part_info.parallel_build_count}",
f"make install INSTALL_ROOT={self._part_info.part_install_dir}",
"qmake QMAKE_CFLAGS+=${CFLAGS:-} QMAKE_CXXFLAGS+=${CXXFLAGS:-} QMAKE_LFLAGS+=${LDFLAGS:-}",
f"env -u CFLAGS -u CXXFLAGS make -j{plugin._part_info.parallel_build_count}",
f"make install INSTALL_ROOT={plugin._part_info.part_install_dir}",
]

def test_get_build_commands_qmake_project_file(self, setup_method_fixture, new_dir):
Expand All @@ -81,10 +81,10 @@ def test_get_build_commands_qmake_project_file(self, setup_method_fixture, new_d
)

assert plugin.get_build_commands() == [
f"qmake QMAKE_CFLAGS+=${CFLAGS:-} QMAKE_CXXFLAGS+=${CXXFLAGS:-} \
QMAKE_LFLAGS+=${LDFLAGS:-} {self._part_info.part_src_dir}/hello.pro",
f"env -u CFLAGS -u CXXFLAGS make -j{self._part_info.parallel_build_count}",
f"make install INSTALL_ROOT={self._part_info.part_install_dir}",
"qmake QMAKE_CFLAGS+=${CFLAGS:-} QMAKE_CXXFLAGS+=${CXXFLAGS:-} "
f"QMAKE_LFLAGS+=${{LDFLAGS:-}} {plugin._part_info.part_src_dir}/hello.pro",
f"env -u CFLAGS -u CXXFLAGS make -j{plugin._part_info.parallel_build_count}",
f"make install INSTALL_ROOT={plugin._part_info.part_install_dir}",
]

def test_get_build_commands_cmake_parameters(self, setup_method_fixture, new_dir):
Expand All @@ -96,11 +96,11 @@ def test_get_build_commands_cmake_parameters(self, setup_method_fixture, new_dir

assert plugin.get_build_commands() == [
(
f"qmake QMAKE_CFLAGS+=${CFLAGS:-} QMAKE_CXXFLAGS+=${CXXFLAGS:-} QMAKE_LFLAGS+=${LDFLAGS:-}",
"qmake QMAKE_CFLAGS+=${CFLAGS:-} QMAKE_CXXFLAGS+=${CXXFLAGS:-} QMAKE_LFLAGS+=${LDFLAGS:-}",
f'{" ".join(qmake_parameters)}',
),
f"env -u CFLAGS -u CXXFLAGS make -j{self._part_info.parallel_build_count}",
f"make install INSTALL_ROOT={self._part_info.part_install_dir}",
f"env -u CFLAGS -u CXXFLAGS make -j{plugin._part_info.parallel_build_count}",
f"make install INSTALL_ROOT={plugin._part_info.part_install_dir}",
]

def test_get_out_of_source_build(self, setup_method_fixture, new_dir):
Expand Down

0 comments on commit 3bd056f

Please sign in to comment.