Skip to content

Commit

Permalink
Simplify ansible-core dep w/ compatible operator (#346)
Browse files Browse the repository at this point in the history
* Simplify ansible-core dep w/ compatible operator

The `~=` opeator is similar to `^` in some ecosystems
(NodeJS/Poetry/Rust). It allows to achieve the request of a compatible
release by only allowing the last version segment to be variable.
For example, `~= 2.13.2` is equivalent to `>= 2.13.2, == 2.13.*`.

Ref: https://www.python.org/dev/peps/pep-0440/#compatible-release

* Keep referencing `collection_deps` on the line as the core dep

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
  • Loading branch information
webknjaz and felixfontein authored Dec 2, 2021
1 parent b3ff183 commit ceddbae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/antsibull/data/ansible-setup_py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ setup(
packages=['ansible_collections'],
include_package_data=True,
install_requires=[
'{{ ansible_core_package_name }}>={{ ansible_base_version }},<{{ ansible_base_version.major }}.{{ ansible_base_version.minor + 1 }}',{{ collection_deps }}
'{{ ansible_core_package_name }} ~= {{ ansible_base_version }}',{{ collection_deps }}
],
classifiers=[
'Development Status :: 5 - Production/Stable',
Expand Down

0 comments on commit ceddbae

Please sign in to comment.