From 11f24569e1d79d6a4dfb5eed81f904faa233eac4 Mon Sep 17 00:00:00 2001 From: Leonardo Cavallucci Date: Tue, 26 Sep 2023 15:33:25 +0200 Subject: [PATCH] Fix filer_version url and migrate to bump-my-version --- 59.bugfix | 1 + CONTRIBUTING.rst | 106 +----------------- changes/59.bugfix | 1 + .../ckeditor/plugins/filerimage/plugin.js | 2 +- .../ckeditor/plugins/filerimage/plugin.js | 2 +- pyproject.toml | 32 ++++++ setup.cfg | 2 +- tasks.py | 9 +- 8 files changed, 44 insertions(+), 111 deletions(-) create mode 100644 59.bugfix create mode 100644 changes/59.bugfix diff --git a/59.bugfix b/59.bugfix new file mode 100644 index 0000000..407f4ce --- /dev/null +++ b/59.bugfix @@ -0,0 +1 @@ +Fix filer_version url and migrate to bump-my-version diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 2467b9d..e3072c4 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -5,108 +5,4 @@ Contributing Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given. -You can contribute in many ways: - -Types of Contributions ----------------------- - -Report Bugs -~~~~~~~~~~~ - -Report bugs at https://github.com/nephila/django-ckeditor-filebrowser-filer/issues. - -If you are reporting a bug, please include: - -* Your operating system name and version. -* Any details about your local setup that might be helpful in troubleshooting. -* Detailed steps to reproduce the bug. - -Fix Bugs -~~~~~~~~ - -Look through the GitHub issues for bugs. Anything tagged with "bug" -is open to whoever wants to implement it. - -Implement Features -~~~~~~~~~~~~~~~~~~ - -Look through the GitHub issues for features. Anything tagged with "feature" -is open to whoever wants to implement it. - -Write Documentation -~~~~~~~~~~~~~~~~~~~ - -django-ckeditor-filebrowser-filer could always use more documentation, whether as part of the -official django-ckeditor-filebrowser-filer docs, in docstrings, or even on the web in blog posts, -articles, and such. - -Submit Feedback -~~~~~~~~~~~~~~~ - -The best way to send feedback is to file an issue at https://github.com/nephila/django-ckeditor-filebrowser-filer/issues. - -If you are proposing a feature: - -* Explain in detail how it would work. -* Keep the scope as narrow as possible, to make it easier to implement. -* Remember that this is a volunteer-driven project, and that contributions - are welcome :) - -Get Started! ------------- - -Ready to contribute? Here's how to set up `django-ckeditor-filebrowser-filer` for local development. - -1. Fork the `django-ckeditor-filebrowser-filer` repo on GitHub. -2. Clone your fork locally:: - - $ git clone git@github.com:your_name_here/django-ckeditor-filebrowser-filer.git - -3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development:: - - $ mkvirtualenv django-ckeditor-filebrowser-filer - $ cd django-ckeditor-filebrowser-filer/ - $ python setup.py develop - -4. Create a branch for local development:: - - $ git checkout -b name-of-your-bugfix-or-feature - -Now you can make your changes locally. - -5. When you're done making changes, check that your changes pass flake8 and the -tests, including testing other Python versions with tox:: - - $ flake8 ckeditor_filebrowser_filer tests - $ python setup.py test - $ tox - -To get flake8 and tox, just pip install them into your virtualenv. - -6. Commit your changes and push your branch to GitHub:: - - $ git add . - $ git commit -m "Your detailed description of your changes." - $ git push origin name-of-your-bugfix-or-feature - -7. Submit a pull request through the GitHub website. - -Pull Request Guidelines ------------------------ - -Before you submit a pull request, check that it meets these guidelines: - -1. The pull request should include tests. -2. If the pull request adds functionality, the docs should be updated. Put - your new functionality into a function with a docstring, and add the - feature to the list in README.rst. -3. The pull request should work for Python 2.6, 2.7, and 3.3, and for PyPy. Check - https://travis-ci.org/nephila/django-ckeditor-filebrowser-filer/pull_requests - and make sure that the tests pass for all supported Python versions. - -Tips ----- - -To run a subset of tests:: - - $ python -m unittest tests.test_ckeditor_filebrowser_filer +Please read the instructions `here `_ to start contributing to `django-ckeditor-filebrowser-filer`. diff --git a/changes/59.bugfix b/changes/59.bugfix new file mode 100644 index 0000000..407f4ce --- /dev/null +++ b/changes/59.bugfix @@ -0,0 +1 @@ +Fix filer_version url and migrate to bump-my-version diff --git a/ckeditor_filebrowser_filer/static/ckeditor/ckeditor/plugins/filerimage/plugin.js b/ckeditor_filebrowser_filer/static/ckeditor/ckeditor/plugins/filerimage/plugin.js index 3fee423..ed19b3b 100644 --- a/ckeditor_filebrowser_filer/static/ckeditor/ckeditor/plugins/filerimage/plugin.js +++ b/ckeditor_filebrowser_filer/static/ckeditor/ckeditor/plugins/filerimage/plugin.js @@ -40,7 +40,7 @@ editor.base_admin = data.replace(/\/$/, ""); }); - jQuery.get('/filebrowser_filer/filer_version/', { }, function(data) { + jQuery.get('/filebrowser_filer/version/', { }, function(data) { editor.filer_version = data; if(data == '1.1' || data == '1.2') { CKEDITOR.scriptLoader.load( that.path + '../../../../filer/js/addons/popup_handling.js' ); diff --git a/ckeditor_filebrowser_filer/static/djangocms_text_ckeditor/ckeditor/plugins/filerimage/plugin.js b/ckeditor_filebrowser_filer/static/djangocms_text_ckeditor/ckeditor/plugins/filerimage/plugin.js index 3fee423..ed19b3b 100644 --- a/ckeditor_filebrowser_filer/static/djangocms_text_ckeditor/ckeditor/plugins/filerimage/plugin.js +++ b/ckeditor_filebrowser_filer/static/djangocms_text_ckeditor/ckeditor/plugins/filerimage/plugin.js @@ -40,7 +40,7 @@ editor.base_admin = data.replace(/\/$/, ""); }); - jQuery.get('/filebrowser_filer/filer_version/', { }, function(data) { + jQuery.get('/filebrowser_filer/version/', { }, function(data) { editor.filer_version = data; if(data == '1.1' || data == '1.2') { CKEDITOR.scriptLoader.load( that.path + '../../../../filer/js/addons/popup_handling.js' ); diff --git a/pyproject.toml b/pyproject.toml index d4c9b45..9b6af2c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,3 +40,35 @@ target-version = "py310" [tool.ruff.mccabe] max-complexity = 10 + +[tool.bumpversion] +allow_dirty = false +commit = true +message = "Release {new_version}" +commit_args = "--no-verify" +tag = false +current_version = "0.5.0.dev1" +parse = """(?x) + (?P[0-9]+) + \\.(?P[0-9]+) + \\.(?P[0-9]+) + (?: + .(?Pdev) + (?:(?P[0-9]+))? + )? +""" +serialize = [ + "{major}.{minor}.{patch}.{release}{relver}", + "{major}.{minor}.{patch}" +] + +[tool.bumpversion.parts.release] +values = [ + "dev", + "" +] +optional_value = "dev" + +[[tool.bumpversion.files]] +filename = "ckeditor_filebrowser_filer/__init__.py" +search = "{current_version}" diff --git a/setup.cfg b/setup.cfg index 6acaee9..2ac7c57 100644 --- a/setup.cfg +++ b/setup.cfg @@ -27,7 +27,7 @@ classifiers = [options] include_package_data = True install_requires = - django-filer>=1.3 + django-filer>=2.0 setup_requires = setuptools packages = ckeditor_filebrowser_filer diff --git a/tasks.py b/tasks.py index b4d9fcd..d987d76 100644 --- a/tasks.py +++ b/tasks.py @@ -111,15 +111,18 @@ def tag_release(c, level, new_version=""): """Tag release version.""" if new_version: new_version = f" --new-version {new_version}" - c.run(f"bumpversion --list {level} --no-tag{new_version}") + c.run(f"bump-my-version bump {level}{new_version}") @task -def tag_dev(c, level="patch", new_version=""): +def tag_dev(c, level, new_version=""): """Tag development version.""" if new_version: new_version = f" --new-version {new_version}" - c.run(f"bumpversion --list {level} --message='Bump develop version [ci skip]' --no-tag{new_version}") + elif level == "release": + c.run("bump-my-version bump patch --no-commit") + level = "relver" + c.run(f"bump-my-version bump {level} --message='Bump develop version [ci skip]' {new_version} --allow-dirty") @task(pre=[clean])