diff --git a/RELEASING.md b/RELEASING.md new file mode 100644 index 0000000..76978e2 --- /dev/null +++ b/RELEASING.md @@ -0,0 +1,47 @@ +Creating a release +================== + +This file contains instructions for maintainers on how to release new versions of podman-compose. + +Step 1: Initialize variables for subsequent steps +------------------------------------------------- + +``` +export VERSION=1.2.3 +``` + +Step 2: Release notes PR +------------------------ + +Open a new branch (e.g. `release`) and run the following: + +``` +./scripts/make_release_notes.sh $VERSION +``` + +This collects the release notes using the `towncrier` tool and then commits the result. +This step is done as a PR so that CI can check for spelling errors and similar issues. + +Certain file names are not properly supported by the `towncrier` tool and it ignores them. +Check `newsfragments` directory for any forgotten release notes + +Step 3: Merge the release notes PR +---------------------------------- + +Step 4: Perform actual release +------------------------------ + +Pull the merge commit created on the `main` branch during the step 2. +Then run: + +``` +./scripts/make_release.sh +``` + +This will create release commit, tag and push everything. + +Step 5: Create a release on Github +---------------------------------- + +The release notes must be added manually by drafting a release on the GitHub UI at +https://github.com/containers/podman-compose/releases. diff --git a/docs/Changelog-1.3.0.md b/docs/Changelog-1.3.0.md new file mode 100644 index 0000000..f494765 --- /dev/null +++ b/docs/Changelog-1.3.0.md @@ -0,0 +1,38 @@ +Version 1.3.0 (2025-01-07) +========================== + +Bug fixes +--------- + +- Fixed support for de-facto alternative `Dockerfile` names (e.g. `Containerfile`) +- Fixed a bug that caused attempts to create already existing pods multiple times. +- Fixed compatibility with docker-compose in how symlinks to docker-compose.yml are handled. +- Fixed freeze caused by too long log lines without a newline. +- Fixed support for `network_mode: none`. +- Improved error detection by rejecting service definitions that contain both `network_mode` and + `networks` keys, which is not allowed. + + +Features +-------- + +- Added support for build labels. +- Added support for "platform" property in the build command. +- Added support for "ssh" property in the build command. +- Added support for cache_from and cache_to fields in build section. +- Added support for honoring the condition in the depends_on section of the service, if stated. +- Added `x-podman.no_hosts` setting to pass `--no-hosts` to podman run +- Added support for compatibility with docker compose for default network behavior when no network + defined in service. This is controlled via `default_net_behavior_compat` feature flag. +- Added a way to get compatibility of default network names with docker compose. + This is selected by setting `default_net_name_compat: true` on `x-podman` global dictionary. +- Added support for the `device_cgroup_rules` property in services. +- Added support for removing networks in `podman-compose down`. +- Added support for network scoped service aliases. +- Added support for network level `mac_address` attribute. +- Added ability to substitute variables with the environment of the service. + +Misc +---- + +- Declared compatibility with Python 3.13. diff --git a/newsfragments/978.bugfix b/newsfragments/978.bugfix deleted file mode 100644 index 6b155a3..0000000 --- a/newsfragments/978.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fixed support for de-facto alternative `Dockerfile` names (e.g. `Containerfile`) diff --git a/newsfragments/build-labels.feature b/newsfragments/build-labels.feature deleted file mode 100644 index a0c3afe..0000000 --- a/newsfragments/build-labels.feature +++ /dev/null @@ -1 +0,0 @@ -Added support for build labels. diff --git a/newsfragments/build-platform.feature b/newsfragments/build-platform.feature deleted file mode 100644 index d19de68..0000000 --- a/newsfragments/build-platform.feature +++ /dev/null @@ -1 +0,0 @@ -Added support for "platform" property in the build command. diff --git a/newsfragments/build-ssh.feature b/newsfragments/build-ssh.feature deleted file mode 100644 index d74711f..0000000 --- a/newsfragments/build-ssh.feature +++ /dev/null @@ -1 +0,0 @@ -Added support for "ssh" property in the build command. diff --git a/newsfragments/cache-fields-support.feature b/newsfragments/cache-fields-support.feature deleted file mode 100644 index 34a3c47..0000000 --- a/newsfragments/cache-fields-support.feature +++ /dev/null @@ -1 +0,0 @@ -Added support for cache_from and cache_to fields in build section. diff --git a/newsfragments/check-if-pod-exists.bugfix b/newsfragments/check-if-pod-exists.bugfix deleted file mode 100644 index 8c4a472..0000000 --- a/newsfragments/check-if-pod-exists.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fixed a bug that caused attempts to create already existing pods multiple times. diff --git a/newsfragments/conditional-dependencies.feature b/newsfragments/conditional-dependencies.feature deleted file mode 100644 index 5e0b22a..0000000 --- a/newsfragments/conditional-dependencies.feature +++ /dev/null @@ -1 +0,0 @@ -Added support for honoring the condition in the depends_on section of the service, if stated. diff --git a/newsfragments/container-no-hosts.feature b/newsfragments/container-no-hosts.feature deleted file mode 100644 index 27125fb..0000000 --- a/newsfragments/container-no-hosts.feature +++ /dev/null @@ -1 +0,0 @@ -Add x-podman.no_hosts setting to pass --no-hosts to podman run diff --git a/newsfragments/default_net_behavior_compat.feature b/newsfragments/default_net_behavior_compat.feature deleted file mode 100644 index 133e996..0000000 --- a/newsfragments/default_net_behavior_compat.feature +++ /dev/null @@ -1,2 +0,0 @@ -Support docker-compose like default network behavior when no network defined in service via `default_net_behavior_compat` feature flag. - diff --git a/newsfragments/default_net_name_compat.feature b/newsfragments/default_net_name_compat.feature deleted file mode 100644 index d64d527..0000000 --- a/newsfragments/default_net_name_compat.feature +++ /dev/null @@ -1 +0,0 @@ -Added a way to get compatibility of default network names with docker compose. This is selected by setting `default_net_name_compat: true` on `x-podman` global dictionary. diff --git a/newsfragments/device_cgroup_rules.feature b/newsfragments/device_cgroup_rules.feature deleted file mode 100644 index 66420d4..0000000 --- a/newsfragments/device_cgroup_rules.feature +++ /dev/null @@ -1 +0,0 @@ -Added support for the "device_cgroup_rules" property in services. diff --git a/newsfragments/dont-resolve-links-to-compose-file.bugfix b/newsfragments/dont-resolve-links-to-compose-file.bugfix deleted file mode 100644 index 6f36b83..0000000 --- a/newsfragments/dont-resolve-links-to-compose-file.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix compatibility with docker-compose in how symlinks to docker-compose.yml are handled. diff --git a/newsfragments/down-removes-network.feature b/newsfragments/down-removes-network.feature deleted file mode 100644 index 17ac9f0..0000000 --- a/newsfragments/down-removes-network.feature +++ /dev/null @@ -1 +0,0 @@ -podman-compose down removes networks. diff --git a/newsfragments/long-log-lines.bugfix b/newsfragments/long-log-lines.bugfix deleted file mode 100644 index c5f2c95..0000000 --- a/newsfragments/long-log-lines.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix freeze caused by too long log lines without a newline. diff --git a/newsfragments/network-mode-none.bugfix b/newsfragments/network-mode-none.bugfix deleted file mode 100644 index e1a7266..0000000 --- a/newsfragments/network-mode-none.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix support for `network_mode: none`. diff --git a/newsfragments/network-scoped-aliases.feature b/newsfragments/network-scoped-aliases.feature deleted file mode 100644 index 49058fe..0000000 --- a/newsfragments/network-scoped-aliases.feature +++ /dev/null @@ -1 +0,0 @@ -Support network scoped service aliases. diff --git a/newsfragments/network_level_mac_address.feature b/newsfragments/network_level_mac_address.feature deleted file mode 100644 index 2a4c69c..0000000 --- a/newsfragments/network_level_mac_address.feature +++ /dev/null @@ -1 +0,0 @@ -Support network level mac_address attribute. diff --git a/newsfragments/network_mode_networks.bugfix b/newsfragments/network_mode_networks.bugfix deleted file mode 100644 index 18ca32b..0000000 --- a/newsfragments/network_mode_networks.bugfix +++ /dev/null @@ -1,2 +0,0 @@ -Improved error detection by rejecting service definitions that contain both "network_mode" and -"networks" keys, which is not allowed. diff --git a/newsfragments/python313.misc b/newsfragments/python313.misc deleted file mode 100644 index 452f2b5..0000000 --- a/newsfragments/python313.misc +++ /dev/null @@ -1 +0,0 @@ -Declared compatibility with Python 3.13. diff --git a/newsfragments/substitution-with-service-environment.feature b/newsfragments/substitution-with-service-environment.feature deleted file mode 100644 index 205d3f6..0000000 --- a/newsfragments/substitution-with-service-environment.feature +++ /dev/null @@ -1 +0,0 @@ -Add ability to substitute variables with the environment of the service. diff --git a/pyproject.toml b/pyproject.toml index b6a8360..282edfb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,3 +13,43 @@ force-single-line = true [tool.ruff.format] preview = true # needed for quote-style quote-style = "preserve" + +[tool.towncrier] + package = "podman_compose" + package_dir = "master" + directory = "newsfragments" + filename = "docs/Changelog-new.md" + template = "scripts/Changelog-template.jinja" + title_format = "Version {version} ({project_date})" + [[tool.towncrier.section]] + path = "" + + [[tool.towncrier.type]] + directory = "feature" + name = "Features" + showcontent = true + + [[tool.towncrier.type]] + directory = "change" + name = "Changes" + showcontent = true + + [[tool.towncrier.type]] + directory = "bugfix" + name = "Bug fixes" + showcontent = true + + [[tool.towncrier.type]] + directory = "doc" + name = "Improved Documentation" + showcontent = true + + [[tool.towncrier.type]] + directory = "removal" + name = "Deprecations and Removals" + showcontent = true + + [[tool.towncrier.type]] + directory = "misc" + name = "Misc" + showcontent = true diff --git a/scripts/Changelog-template.jinja b/scripts/Changelog-template.jinja new file mode 100644 index 0000000..531adc6 --- /dev/null +++ b/scripts/Changelog-template.jinja @@ -0,0 +1,33 @@ +{% for section, _ in sections|dictsort(by='key') %} +{% set underline = "-" %} +{% if section %} +{{section}} +{{ underline * section|length }}{% set underline = "~" %} + +{% endif %} +{% if sections[section] %} +{% for category, val in definitions|dictsort if category in sections[section]%} + +{{ definitions[category]['name'] }} +{{ underline * definitions[category]['name']|length }} + +{% for text, values in sections[section][category]|dictsort(by='value') %} +- {{ text }} +{% endfor %} + +{% if sections[section][category]|length == 0 %} + +No significant changes. + + +{% else %} +{% endif %} +{% endfor %} +{% else %} + +No significant changes. + + +{% endif %} +{% endfor %} +(venv) p12@exec-desktop:~/cod diff --git a/scripts/make_release.sh b/scripts/make_release.sh index 507bbee..a6c6cec 100755 --- a/scripts/make_release.sh +++ b/scripts/make_release.sh @@ -1,6 +1,18 @@ -#!/usr/bin/env bash -./scripts/uninstall.sh -./scripts/clean_up.sh -python3 setup.py register -python3 setup.py sdist bdist_wheel -twine upload dist/* +#!/bin/bash + +set -e + +if [ $# -ne 1 ]; then + echo "Usage: make_release.sh VERSION" + exit 1 +fi + +VERSION=$1 + +sed "s/__version__ = .*/__version__ = \"$VERSION\"/g" -i podman_compose.py +git add podman_compose.py +git commit -m "Release $VERSION" + +git tag "v$VERSION" -m "v$VERSION" -s + +git push ssh://github.com/containers/podman-compose main "v$VERSION" diff --git a/scripts/make_release_notes.sh b/scripts/make_release_notes.sh new file mode 100755 index 0000000..302161b --- /dev/null +++ b/scripts/make_release_notes.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -e + +if [ $# -ne 1 ]; then + echo "Usage: make_release_notes.sh VERSION" + exit 1 +fi + +VERSION=$1 +towncrier build --version "$VERSION" --yes +git mv "docs/Changelog-new.md" "docs/Changelog-$VERSION.md" +git add "newsfragments/" +git commit -m "Release notes for $VERSION" diff --git a/scripts/make_release_upload.sh b/scripts/make_release_upload.sh new file mode 100755 index 0000000..507bbee --- /dev/null +++ b/scripts/make_release_upload.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +./scripts/uninstall.sh +./scripts/clean_up.sh +python3 setup.py register +python3 setup.py sdist bdist_wheel +twine upload dist/*