Skip to content

Commit c0a1a1f

Browse files
committed
Migrate to bump-my-version, remove unsupported python/django/djangocms versions from README (#177)
1 parent 01d03fa commit c0a1a1f

7 files changed

+46
-197
lines changed

.bumpversion.cfg

-25
This file was deleted.

CONTRIBUTING.rst

+1-159
Original file line numberDiff line numberDiff line change
@@ -5,162 +5,4 @@ Contributing
55
Contributions are welcome, and they are greatly appreciated! Every
66
little bit helps, and credit will always be given.
77

8-
You can contribute in many ways:
9-
10-
Types of Contributions
11-
**********************
12-
13-
Report Bugs
14-
===========
15-
16-
Report bugs at https://github.com/nephila/djangocms-page-meta/issues.
17-
18-
If you are reporting a bug, please include:
19-
20-
* Your operating system name and version.
21-
* Any details about your local setup that might be helpful in troubleshooting.
22-
* Detailed steps to reproduce the bug.
23-
24-
Fix Bugs
25-
========
26-
27-
Look through the GitHub issues for bugs. Anything tagged with "bug"
28-
is open to whoever wants to implement it.
29-
30-
Implement Features
31-
==================
32-
33-
Look through the GitHub issues for features. Anything tagged with "feature"
34-
is open to whoever wants to implement it.
35-
36-
Write Documentation
37-
===================
38-
39-
djangocms-page-meta could always use more documentation, whether as part of the
40-
official djangocms-page-meta docs, in docstrings, or even on the web in blog posts,
41-
articles, and such.
42-
43-
Submit Feedback
44-
===============
45-
46-
The best way to send feedback is to file an issue at https://github.com/nephila/djangocms-page-meta/issues.
47-
48-
If you are proposing a feature:
49-
50-
* Explain in detail how it would work.
51-
* Keep the scope as narrow as possible, to make it easier to implement.
52-
* Remember that this is a volunteer-driven project, and that contributions
53-
are welcome :)
54-
55-
************
56-
Get Started!
57-
************
58-
59-
Ready to contribute? Here's how to set up ``djangocms-page-meta`` for local development.
60-
61-
1. Fork the ``djangocms-page-meta`` repo on GitHub.
62-
2. Clone your fork locally::
63-
64-
$ git clone git@github.com:your_name_here/djangocms-page-meta.git
65-
66-
3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper
67-
installed, this is how you set up your fork for local development::
68-
69-
$ mkvirtualenv djangocms-page-meta
70-
$ cd djangocms-page-meta/
71-
$ pip install -r requirements-test.txt
72-
$ pip install -e .
73-
74-
4. Create a branch for local development::
75-
76-
$ git checkout -b name-of-your-bugfix-or-feature
77-
78-
Now you can make your changes locally.
79-
80-
5. When you're done making changes, check that your changes pass flake8 and the
81-
tests, including testing other Python versions with tox::
82-
83-
$ tox
84-
85-
To get tox, pip install it into your virtualenv.
86-
87-
6. Commit your changes and push your branch to GitHub::
88-
89-
$ git add .
90-
$ git commit -m "Your detailed description of your changes."
91-
$ git push origin name-of-your-bugfix-or-feature
92-
93-
7. Submit a pull request through the GitHub website.
94-
95-
Development tips
96-
----------------
97-
98-
This project allows you to use `pre-commit <https://pre-commit.com/>`_ to ensure an easy compliance
99-
to the project code styles.
100-
101-
If you want to use it, install it globally (for example with ``pip3 install --user precommit``,
102-
but check `installation instruction <https://pre-commit.com/#install>`_.
103-
When first cloning the project ensure you install the git hooks by running ``pre-commit install``.
104-
105-
From now on every commit will be checked against our code style.
106-
107-
Check also the available tox environments with ``tox -l``: the ones not marked with a python version number are tools
108-
to help you work on the project buy checking / formatting code style, running docs etc.
109-
110-
Testing tips
111-
----------------
112-
You can test your project using any specific combination of python, django and django cms.
113-
114-
For example ``tox -py37-django30-cms37`` runs the tests on python 3.7, Django 3.0 and django CMS 3.7.
115-
116-
117-
Pull Request Guidelines
118-
=======================
119-
120-
Before you submit a pull request, check that it meets these guidelines:
121-
122-
#. Pull request must be named with the following naming scheme:
123-
124-
``<type>/(<optional-task-type>-)<number>-description``
125-
126-
See below for available types.
127-
128-
#. The pull request should include tests.
129-
#. If the pull request adds functionality, the docs should be updated.
130-
Documentation must be added in ``docs`` directory, and must include usage
131-
information for the end user.
132-
In case of public API method, add extended docstrings with full parameters
133-
description and usage example.
134-
#. Add a changes file in ``changes`` directory describing the contribution in
135-
one line. It will be added automatically to the history file upon release.
136-
File must be named as ``<issue-number>.<type>`` with type being:
137-
138-
* ``.feature``: For new features.
139-
* ``.bugfix``: For bug fixes.
140-
* ``.doc``: For documentation improvement.
141-
* ``.removal``: For deprecation or removal of public API.
142-
* ``.misc``: For general issues.
143-
144-
Check `towncrier`_ documentation for more details.
145-
146-
#. The pull request should work for all python / django / django CMS versions
147-
declared in tox.ini.
148-
Check the CI and make sure that the tests pass for all supported versions.
149-
150-
Release a version
151-
=================
152-
153-
#. Update authors file
154-
#. Merge ``develop`` on ``master`` branch
155-
#. Bump release via task: ``inv tag-release (major|minor|patch)``
156-
#. Update changelog via towncrier: ``towncrier --yes``
157-
#. Commit changelog with ``git commit --amend`` to merge with bumpversion commit
158-
#. Create tag ``git tag <version>``
159-
#. Push tag to github
160-
#. Publish the release from the tags page
161-
#. If pipeline succeeds, push ``master``
162-
#. Merge ``master`` back on ``develop``
163-
#. Bump developement version via task: ``inv tag-dev -l (major|minor|patch)``
164-
#. Push ``develop``
165-
166-
.. _towncrier: https://pypi.org/project/towncrier/#news-fragments
8+
Please read the instructions `here <https://nephila.github.io/contributing/contributing>`_ to start contributing to `djangocms-page-meta`.

README.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ djangocms-page-meta
66

77
Meta tag information for django CMS 3 pages
88

9-
Python: 3.7, 3.8, 3.9, 3.10
9+
Python: 3.9, 3.10, 3.11
1010

11-
Django: 2.2, 3.2
11+
Django: 3.2, 4.1, 4.2
1212

13-
django CMS: 3.7 - 3.10
13+
django CMS: 3.9, 3.11
1414

1515

1616
**********

changes/176.feature

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Migrate to bump-my-version, fix python/django/djangocms versions in README

pyproject.toml

+32
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,35 @@ target-version = "py310"
4646

4747
[tool.ruff.mccabe]
4848
max-complexity = 10
49+
50+
[tool.bumpversion]
51+
allow_dirty = false
52+
commit = true
53+
message = "Release {new_version}"
54+
commit_args = "--no-verify"
55+
tag = false
56+
current_version = "1.2.0"
57+
parse = """(?x)
58+
(?P<major>[0-9]+)
59+
\\.(?P<minor>[0-9]+)
60+
\\.(?P<patch>[0-9]+)
61+
(?:
62+
.(?P<release>dev)
63+
(?:(?P<relver>[0-9]+))?
64+
)?
65+
"""
66+
serialize = [
67+
"{major}.{minor}.{patch}.{release}{relver}",
68+
"{major}.{minor}.{patch}"
69+
]
70+
71+
[tool.bumpversion.parts.release]
72+
values = [
73+
"dev",
74+
""
75+
]
76+
optional_value = "dev"
77+
78+
[[tool.bumpversion.files]]
79+
filename = "taiga/__init__.py"
80+
search = "{current_version}"

setup.cfg

+1-3
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ classifiers =
2323
Framework :: Django :: 4.1
2424
Framework :: Django :: 4.2
2525
Programming Language :: Python :: 3
26-
Programming Language :: Python :: 3.7
27-
Programming Language :: Python :: 3.8
2826
Programming Language :: Python :: 3.9
2927
Programming Language :: Python :: 3.10
3028
Programming Language :: Python :: 3.11
@@ -38,7 +36,7 @@ install_requires =
3836
setup_requires =
3937
setuptools
4038
packages = djangocms_page_meta
41-
python_requires = >=3.7
39+
python_requires = >=3.9
4240
test_suite = cms_helper.run
4341
zip_safe = False
4442

tasks.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ def format(c): # NOQA
3939
def towncrier_check(c): # NOQA
4040
"""Check towncrier files."""
4141
output = io.StringIO()
42-
c.run("git branch --contains HEAD", out_stream=output)
43-
skipped_branch_prefix = ["pull/", "develop", "master", "HEAD"]
42+
c.run("git branch -a --contains HEAD", out_stream=output)
43+
skipped_branch_prefix = ["pull/", "release/", "develop", "master", "HEAD"]
4444
# cleanup branch names by removing PR-only names in local, remote and disconnected branches to ensure the current
4545
# (i.e. user defined) branch name is used
4646
branches = list(
@@ -52,10 +52,8 @@ def towncrier_check(c): # NOQA
5252
),
5353
)
5454
)
55-
print("Candidate branches", ", ".join(output.getvalue().split("\n")))
5655
if not branches:
5756
# if no branch name matches, we are in one of the excluded branches above, so we just exit
58-
print("Skip check, branch excluded by configuration")
5957
return
6058
branch = branches[0]
6159
towncrier_file = None
@@ -113,15 +111,18 @@ def tag_release(c, level, new_version=""):
113111
"""Tag release version."""
114112
if new_version:
115113
new_version = f" --new-version {new_version}"
116-
c.run(f"bumpversion --list {level} --no-tag{new_version}")
114+
c.run(f"bump-my-version bump {level}{new_version}")
117115

118116

119117
@task
120-
def tag_dev(c, level="patch", new_version=""):
118+
def tag_dev(c, level, new_version=""):
121119
"""Tag development version."""
122120
if new_version:
123121
new_version = f" --new-version {new_version}"
124-
c.run(f"bumpversion --list {level} --message='Bump develop version [ci skip]' --no-tag{new_version}")
122+
elif level == "release":
123+
c.run("bump-my-version bump patch --no-commit")
124+
level = "relver"
125+
c.run(f"bump-my-version bump {level} --message='Bump develop version [ci skip]' {new_version} --allow-dirty")
125126

126127

127128
@task(pre=[clean])

0 commit comments

Comments
 (0)