diff --git a/templates/bootstrap/.bumpversion.cfg.j2 b/templates/bootstrap/.bumpversion.cfg.j2 deleted file mode 100644 index 267debd0..00000000 --- a/templates/bootstrap/.bumpversion.cfg.j2 +++ /dev/null @@ -1,20 +0,0 @@ -[bumpversion] -current_version = 0.1.0a1.dev -commit = False -tag = False -parse = (?P\d+)\.(?P\d+)\.(0a)?(?P\d+)(\.(?P[a-z]+))? -serialize = - {major}.{minor}.0a{patch}.{release} - {major}.{minor}.0a{patch} - -[bumpversion:part:release] -optional_value = prod -first_value = dev -values = - dev - prod - -[bumpversion:file:./{{ plugin_name | snake }}/app/__init__.py] - -[bumpversion:file:./setup.py] - diff --git a/templates/bootstrap/plugin_name/app/__init__.py.j2 b/templates/bootstrap/plugin_name/app/__init__.py.j2 index d171e7f0..6083139c 100644 --- a/templates/bootstrap/plugin_name/app/__init__.py.j2 +++ b/templates/bootstrap/plugin_name/app/__init__.py.j2 @@ -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 diff --git a/templates/bootstrap/setup.py.j2 b/templates/bootstrap/setup.py.j2 index 105748d8..673d696d 100755 --- a/templates/bootstrap/setup.py.j2 +++ b/templates/bootstrap/setup.py.j2 @@ -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", diff --git a/templates/github/.bumpversion.cfg.j2 b/templates/github/.bumpversion.cfg.j2 new file mode 100644 index 00000000..77eb7d28 --- /dev/null +++ b/templates/github/.bumpversion.cfg.j2 @@ -0,0 +1,28 @@ +[bumpversion] +current_version = {{ current_version }} +commit = False +tag = False +parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\.(?P[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 %} diff --git a/utils.py b/utils.py index 57429acc..1e870887 100644 --- a/utils.py +++ b/utils.py @@ -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