Skip to content

Commit

Permalink
chore: fix gitignore entry (#5266)
Browse files Browse the repository at this point in the history
  • Loading branch information
bepri authored Feb 19, 2025
1 parent 3e9d22f commit ec36b24
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 45 deletions.
9 changes: 4 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
Expand Down Expand Up @@ -96,10 +95,10 @@ env.bak/
dmypy.json

# Lifecycle
build/
parts/
prime/
stage/
/build/
/prime/
/stage/
/parts/

# Python virtual environment
venv/
Expand Down
1 change: 1 addition & 0 deletions snapcraft/parts/extract_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""Utilities to extract project metadata from lifecycle directories."""

from __future__ import annotations

import pathlib
Expand Down
4 changes: 1 addition & 3 deletions snapcraft/parts/grammar.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ def self_check(value: Any) -> bool:
processor = GrammarProcessor(arch=arch, target_arch=target_arch, checker=self_check)

for part in parts_yaml_data.values():
part = process_part(
part_yaml_data=part, processor=processor
)
process_part(part_yaml_data=part, processor=processor)

return parts_yaml_data
1 change: 0 additions & 1 deletion snapcraft/parts/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

"""Snapcraft specific plugins."""


from .register import get_plugins, register

from .colcon_plugin import ColconPlugin
Expand Down
1 change: 1 addition & 0 deletions snapcraft/parts/plugins/matter_sdk_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""The matter SDK plugin."""

import os
from typing import Literal, cast

Expand Down
1 change: 0 additions & 1 deletion snapcraft/parts/update_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ def _update_project_links(

# only update the project if the project has not defined the field
if not project_field:

# values for a field from all metadata files
metadata_values: list[str] = list()

Expand Down
5 changes: 2 additions & 3 deletions tests/unit/parts/plugins/test_colcon.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ def test_property_unexpected(self):

with pytest.raises(ValidationError):
colcon.ColconPlugin.properties_class( # noqa F841
source=".", foo="bar" # type: ignore
source=".",
foo="bar", # type: ignore
)

def test_property_all(self):
Expand Down Expand Up @@ -323,7 +324,6 @@ def test_get_build_commands_core24(
def test_get_build_commands_with_all_properties_core22(
self, setup_method_fixture, new_dir, monkeypatch
):

plugin = setup_method_fixture(
"core22",
new_dir,
Expand Down Expand Up @@ -604,7 +604,6 @@ def test_get_build_commands_with_all_properties_core24(
def test_get_build_commands_with_cmake_debug(
self, setup_method_fixture, new_dir, monkeypatch
):

plugin = setup_method_fixture(
"core22",
new_dir,
Expand Down
1 change: 0 additions & 1 deletion tests/unit/parts/plugins/test_python_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def test_get_build_environment(plugin, new_dir):


def test_get_build_commands(plugin, new_dir):

assert plugin.get_build_commands() == [
f'"${{PARTS_PYTHON_INTERPRETER}}" -m venv ${{PARTS_PYTHON_VENV_ARGS}} "{new_dir}/parts/my-part/install"',
f'PARTS_PYTHON_VENV_INTERP_PATH="{new_dir}/parts/my-part/install/bin/${{PARTS_PYTHON_INTERPRETER}}"',
Expand Down
9 changes: 3 additions & 6 deletions tests/unit/parts/test_desktop_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,14 @@ def test_generate_desktop_file(self, new_dir, icon, icon_path, expected_icon):
expected_desktop_file = new_dir / f"{app_name}.desktop"
assert expected_desktop_file.exists()
with expected_desktop_file.open() as desktop_file:
assert (
desktop_file.read()
== dedent(
"""\
assert desktop_file.read() == dedent(
"""\
[Desktop Entry]
Exec=foo
Icon={}
"""
).format(expected_icon)
)
).format(expected_icon)

@pytest.mark.parametrize(
"icon,icon_path,expected_icon",
Expand Down
44 changes: 19 additions & 25 deletions tests/unit/parts/test_yaml_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,26 @@


def test_yaml_load():
assert (
yaml_utils.load(
io.StringIO(
dedent(
"""\
assert yaml_utils.load(
io.StringIO(
dedent(
"""\
base: core22
entry:
sub-entry:
- list1
- list2
scalar: scalar-value
"""
)
)
)
== {
"base": "core22",
"entry": {
"sub-entry": ["list1", "list2"],
},
"scalar": "scalar-value",
}
)
) == {
"base": "core22",
"entry": {
"sub-entry": ["list1", "list2"],
},
"scalar": "scalar-value",
}


def test_yaml_load_duplicates_errors():
Expand Down Expand Up @@ -96,22 +93,19 @@ def test_yaml_load_unhashable_errors():


def test_yaml_load_build_base():
assert (
yaml_utils.load(
io.StringIO(
dedent(
"""\
assert yaml_utils.load(
io.StringIO(
dedent(
"""\
base: foo
build-base: core22
"""
)
)
)
== {
"base": "foo",
"build-base": "core22",
}
)
) == {
"base": "foo",
"build-base": "core22",
}


def test_yaml_load_not_core22_base():
Expand Down

0 comments on commit ec36b24

Please sign in to comment.