Skip to content

Conversation

@jan-matejka
Copy link

No description provided.

@jan-matejka jan-matejka force-pushed the f/extends-enoent branch 2 times, most recently from c54a533 to c613dc2 Compare October 24, 2025 12:15
@p12tic
Copy link
Collaborator

p12tic commented Nov 29, 2025

Thanks for the PR. What are the reproduction steps for the bug this PR is trying to fix?

@jan-matejka
Copy link
Author

% cat compose.yaml 
services:
  foo:
    extends:
      service: bar

% pc build foo
Traceback (most recent call last):
  File "/home/alex/pc2/bin/podman-compose", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/home/alex/pc2/lib/python3.13/site-packages/podman_compose.py", line 4256, in main
    asyncio.run(async_main())
    ~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/asyncio/runners.py", line 195, in run
    return runner.run(main)
           ~~~~~~~~~~^^^^^^
  File "/usr/lib/python3.13/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/lib/python3.13/asyncio/base_events.py", line 725, in run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^
  File "/home/alex/pc2/lib/python3.13/site-packages/podman_compose.py", line 4252, in async_main
    await podman_compose.run()
  File "/home/alex/pc2/lib/python3.13/site-packages/podman_compose.py", line 2070, in run
    self._parse_compose_file()
    ~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/home/alex/pc2/lib/python3.13/site-packages/podman_compose.py", line 2326, in _parse_compose_file
    resolve_extends(services, [name for _, name in service_names], self.environ)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/alex/pc2/lib/python3.13/site-packages/podman_compose.py", line 1945, in resolve_extends
    del from_service["_deps"]
        ~~~~~~~~~~~~^^^^^^^^^
KeyError: '_deps'

with patch:

% pc build foo
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/podman_compose.py", line 1949, in resolve_extends
    del from_service["_deps"]
        ~~~~~~~~~~~~^^^^^^^^^
KeyError: '_deps'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/podman-compose", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/usr/lib/python3/dist-packages/podman_compose.py", line 4264, in main
    asyncio.run(async_main())
    ~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/asyncio/runners.py", line 195, in run
    return runner.run(main)
           ~~~~~~~~~~^^^^^^
  File "/usr/lib/python3.13/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/lib/python3.13/asyncio/base_events.py", line 725, in run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^
  File "/usr/lib/python3/dist-packages/podman_compose.py", line 4260, in async_main
    await podman_compose.run()
  File "/usr/lib/python3/dist-packages/podman_compose.py", line 2078, in run
    self._parse_compose_file()
    ~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3/dist-packages/podman_compose.py", line 2334, in _parse_compose_file
    resolve_extends(services, [name for _, name in service_names], self.environ)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/podman_compose.py", line 1951, in resolve_extends
    raise KeyError(
        f"{from_service_name} not found at services.{name}.extends definition"
    )
KeyError: 'bar not found at services.foo.extends definition'

…not exist

Signed-off-by: Jan Matějka <jan@matejka.ninja>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants