Skip to content

Commit

Permalink
Fix filer_version url and migrate to bump-my-version
Browse files Browse the repository at this point in the history
  • Loading branch information
protoroto committed Sep 26, 2023
1 parent 42f0229 commit 11f2456
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 111 deletions.
1 change: 1 addition & 0 deletions 59.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix filer_version url and migrate to bump-my-version
106 changes: 1 addition & 105 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]: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 <https://nephila.github.io/contributing/contributing>`_ to start contributing to `django-ckeditor-filebrowser-filer`.
1 change: 1 addition & 0 deletions changes/59.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix filer_version url and migrate to bump-my-version
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down
32 changes: 32 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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<major>[0-9]+)
\\.(?P<minor>[0-9]+)
\\.(?P<patch>[0-9]+)
(?:
.(?P<release>dev)
(?:(?P<relver>[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}"
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit 11f2456

Please sign in to comment.