Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

packaging: Move version definition to setup.cfg #493

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions podman_compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
# https://docs.docker.com/compose/django/
# https://docs.docker.com/compose/wordpress/

try:
import importlib.metadata as importlib_metadata
except ImportError:
import importlib_metadata

__version__ = importlib_metadata.version("podman-compose")

import sys
import os
Expand Down Expand Up @@ -35,8 +41,6 @@
import yaml
from dotenv import dotenv_values

__version__ = "1.0.4"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it was fine if both setup.cfg and podman_compose.py duplicated the version.

The dependency problems is a valid justification to do so. The downside is that these versions can get out of sync. However this can be addressed by having CI run a simple regex based test that extracts versions from files and compares them.


script = os.path.realpath(sys.argv[0])

# helper functions
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
universal = 1

[metadata]
version = attr: podman_compose.__version__
version = 1.0.4
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
include_package_data=True,
license="GPL-2.0-only",
install_requires=[
"importlib-metadata",
"pyyaml",
"python-dotenv",
],
Expand Down