Skip to content

Commit

Permalink
Move .bumpversion.cfg into github template
Browse files Browse the repository at this point in the history
  • Loading branch information
mdellweg committed Nov 18, 2024
1 parent c863cf4 commit 17a20b1
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 23 deletions.
20 changes: 0 additions & 20 deletions templates/bootstrap/.bumpversion.cfg.j2

This file was deleted.

2 changes: 1 addition & 1 deletion templates/bootstrap/plugin_name/app/__init__.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ class {{ plugin_name | camel }}PluginAppConfig(PulpPluginAppConfig):

name = "{{ plugin_name | snake }}.app"
label = "{{ plugin_app_label }}"
version = "0.1.0a1.dev"
version = "{{ current_version }}"
python_package_name = "{{ plugin_name }}"
domain_compatible = True
2 changes: 1 addition & 1 deletion templates/bootstrap/setup.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ with open("requirements.txt") as requirements:

setup(
name="{{ plugin_name | dash }}",
version="0.1.0a1.dev",
version="{{ current_version }}",
description="{{ plugin_name | dash }} plugin for the Pulp Project",
long_description="{{ plugin_name | dash }} plugin for the Pulp Project",
long_description_content_type="text/markdown",
Expand Down
28 changes: 28 additions & 0 deletions templates/github/.bumpversion.cfg.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[bumpversion]
current_version = {{ current_version }}
commit = False
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+))?
serialize =
{major}.{minor}.{patch}.{release}
{major}.{minor}.{patch}

[bumpversion:part:release]
optional_value = prod
first_value = dev
values =
dev
prod
{%- for plugin in plugins %}

[bumpversion:file:./{{ plugin.name | snake }}/app/{% if plugin.name == "pulpcore" %}apps{% else %}__init__{% endif %}.py]
{%- endfor %}
{%- if setup_py %}

[bumpversion:file:./setup.py]
{%- else %}

[bumpversion:file:./pyproject.toml]
search = version = "{current_version}"
replace = version = "{new_version}"
{%- endif %}
2 changes: 1 addition & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def current_version(plugin_root_dir):
current_version = line[18:].strip()
break
except Exception:
current_version = "0.1.0a1.dev"
current_version = "0.0.0.dev"
return current_version


Expand Down

0 comments on commit 17a20b1

Please sign in to comment.