Installation with setup.py fails on missing yaml package, which should
be installed by "install_requires" but this also does not work because
podman_compose.__version__ also needs yaml.
Put all the Python dependencies into separate files:
- requirements.txt
- test-requirements.txt
This prevents cases in which an `.env` directory exists, for example
in Python projects with a local virtual environment, and then
dotenv gets passed the directory path as input.
Leaving keys with empty values in YAML will result in the value
ending up being None after parsing the configuration file. This
should result in the variable being imported from the external
environment according to the Compose file version 3 reference.
The resulting action for podman should be an added "-e VAR"
(without =), which is working correctly.
However, when overwriting an external variable by setting it to
e.g. "", the result in docker-compose is that the variable is
unset. For podman, this means adding "-e VAR=". This is not the
case, and this patch does a more strict check to make this case
behave correctly.
docker-compose reads the 'env_files' and adds the content as
environment values before adding the 'environment' data. This
means that that 'environment' data overrides 'env_files' data.
Emulate this behaviour by re-ordering -e statements to end up
after --env-file statements.
Relevant function in docker-compose can be viewed here:
https://github.com/docker/compose/blob/1.27.4/compose/config/config.py#L694-L697
Currently, `cap_add` and `cap_drop` are being ignored by podman-compose.
Add the arguments (`--cap-add` and `--cap-drop`, respectively) to
`podman create` when appropriate.
If no services are defined, podman-compose
crashes as services variable is None,
while the expected behavior might be
an error or the same as docker-compose, which will continue the
execution of the compose file (eg. creating networks, etc).
This commit fixes the crash and allows the program to continue, mimicking
docker-compose behavior.