django-js-reverse icon indicating copy to clipboard operation
django-js-reverse copied to clipboard

Update to work with Django 4.0 and 4.1

Open BITSOLVER opened this issue 3 years ago • 8 comments

I forked the master from ierror/django-js-reverse and managed to get things working with Django 4.0 and 4.1 that I needed for a current project.

Hopefully this will be helpful to others.

BITSOLVER avatar Sep 02 '22 16:09 BITSOLVER

@BITSOLVER It seems like your PR is introducing a new dependency that is not explicitly listed - at least this is what I get when I try to use your forked release https://github.com/BITSOLVER/django-js-reverse/archive/refs/tags/0.10.1-b0.tar.gz as a dependency in my Django project:

Traceback (most recent call last):
  File "/srv/okmapgo/manage.py", line 21, in <module>
    main()
  File "/srv/okmapgo/manage.py", line 17, in main
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 440, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 279, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 48, in load_command_class
    module = import_module("%s.management.commands.%s" % (app_name, name))
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/local/lib/python3.9/site-packages/django_js_reverse/management/commands/collectstatic_js_reverse.py", line 10, in <module>
    from django_js_reverse.core import generate_js
  File "/usr/local/lib/python3.9/site-packages/django_js_reverse/core.py", line 7, in <module>
    from packaging.version import parse as LooseVersion
ModuleNotFoundError: No module named 'packaging'
Error response from daemon: The command '/bin/sh -c python manage.py collectstatic_js_reverse' returned a non-zero code: 1

Is your replacement of distutils.version.LooseVersion needed or a habit? In the first case, we could just revert the changes in django_js_reverse/core.py, in the latter we would need to add the requirement. (I say we, but I hope you do it so that I do not have to inject myself too much into this project as well - I love your other changes :-D )

philippfreyer avatar Sep 26 '22 10:09 philippfreyer

@philippfreyer As far as I can tell packaging is the preferred way to go in newer versions of python. I'll update the rest of tox.ini targets to include packaging. I'm a bit new at contributing to these apps on github so must of mist this. I'll see if I can update the pull request correctly!

BITSOLVER avatar Sep 26 '22 10:09 BITSOLVER

I am happy to hear a quick response - please check that setup.py also includes the reference then - this is what is evaluated when pulling the dependency through pip as far as I remember - I am not packaging these packages often as well ;-) As soon as you push to your github branch that your PR is based on, your commit should also show up here. If you want to make me super happy, you would also rerelease the changed package on your repository since I am currently pulling the release from there - I could then remove my manual dependency to it already :-D

philippfreyer avatar Sep 26 '22 11:09 philippfreyer

@philippfreyer Ok that makes sense. I'm just investigation if I should make packaging conditional based on the python version and also the install_requires in setup.py conditional.

BITSOLVER avatar Sep 26 '22 11:09 BITSOLVER

@philippfreyer I've committed and pushed changes to my fork and created a prerelease.

BITSOLVER avatar Sep 26 '22 12:09 BITSOLVER

@BITSOLVER Thank you, this fixes the issues I had :-) - I just tried it in my build.

philippfreyer avatar Sep 26 '22 12:09 philippfreyer

@BITSOLVER this repo is not being maintained anymore. The company I work on, Vinta Software, is the new maintainer now and has ability to launch new releases to django-js-reverse package in PyPI. We're going to do the updates on our fork of this repository.

Can I merge your changes here to our repo?

hugobessa avatar Aug 12 '23 14:08 hugobessa

Hi,

Yes feel free to merge my changes.

Kind Regards, Steve

On Sat, 12 Aug 2023 at 15:03, Hugo Bessa @.***> wrote:

@BITSOLVER https://github.com/BITSOLVER this repo is not being maintained anymore. The company I work on, Vinta Software https://vintasoftware.com, is the new maintainer now and has ability to launch new releases to django-js-reverse package in PyPI. We're going to do the updates on our fork of this repository https://github.com/vintasoftware/django-js-reverse/.

Can I merge your changes here to our repo?

— Reply to this email directly, view it on GitHub https://github.com/ierror/django-js-reverse/pull/114#issuecomment-1675929429, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADTEWGJTEXPES4J623M5PV3XU6EKVANCNFSM6AAAAAAQDNAODM . You are receiving this because you were mentioned.Message ID: @.***>

-- BitSolver Limited Registered in England and Wales – Company No: 8036503 - VAT Registration No: 134 6839 94 Registered Office: The Old Bake House, Downs Park East, Westbury Park, Bristol, BS6 7QD

BITSOLVER avatar Aug 13 '23 12:08 BITSOLVER