Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django 2.1 #2

Closed
jayvdb opened this issue Apr 18, 2019 · 11 comments
Closed

Django 2.1 #2

jayvdb opened this issue Apr 18, 2019 · 11 comments

Comments

@jayvdb
Copy link
Contributor

jayvdb commented Apr 18, 2019

I am experiencing this failure on Django 2.2, but I believe it first occurs in Django 2.1

  File "/home/abuild/rpmbuild/BUILD/django-compat-patcher-0.4/tests/test_project/urls.py", line 10, in <module>
    url(r'^my_view/', "test_project.views.my_view"),
  File "/usr/lib/python3.7/site-packages/django/conf/urls/__init__.py", line 13, in url
    return re_path(regex, view, kwargs, name)
  File "/usr/lib/python3.7/site-packages/django/urls/conf.py", line 73, in _path
    raise TypeError('view must be a callable or a list/tuple in the case of include().')
TypeError: view must be a callable or a list/tuple in the case of include().

I have built this for openSUSE , but only enabled Python 2/Django 1.11 as the Python 3 builds need both Django 2.1 and 2.2 support.

https://build.opensuse.org/package/show/home:jayvdb:django/python-django-compat-patcher

See also upstream issue at arteria/django-compat#66

@pakal
Copy link
Owner

pakal commented Apr 30, 2019

Thanks for the input, DCP indeed lacks django 2+ support.

I'm kinda stuck for now since my big test project for DCP is python2-only, and hence can't run django2+.

But I'll have a look asap at upgrading DCP support for Django 2+ even only with minimal testing.

@pakal
Copy link
Owner

pakal commented May 7, 2019

I've updated DCP, along with my big test project, to support up to Django2.2.1

See https://pypi.org/project/django-compat-patcher/0.5/

@jayvdb
Copy link
Contributor Author

jayvdb commented May 7, 2019

Works very nicely.
My .spec is much nicer now, and ready to submit to openSUSE django collection.

Note there isnt a CHANGELOG entry for 0.5.

Also setup.py is missing tests_require and test_suite and other niceties. It would be nice if the license=<url> was license=MIT as most tools want that field to contain a SPDX short label. I can submit a PR to tidy this bit up, if you would prefer that.

@pakal
Copy link
Owner

pakal commented May 7, 2019

I'd be quite interested by a PR on setup.py niceties indeed, thanks, I have little experience in python packaging :)
Then I'll release a 5.1 with your PR and my updates to the changelog.

@jayvdb
Copy link
Contributor Author

jayvdb commented May 8, 2019

Sounds like a good plan.

Any chance you can fix #3 ?

If so, I'll add green CI also.

@pakal
Copy link
Owner

pakal commented May 8, 2019

Ok, I'm looking at it asap.

@pakal
Copy link
Owner

pakal commented May 9, 2019

I've fixed tests, updated changelog, normalized fixer names, and made tox go through "setup.py test".

Could you please review the new setup.py, since making it work with pytest was not straighforward at all ?

CI should work with latest 0.6

@jayvdb
Copy link
Contributor Author

jayvdb commented May 9, 2019

0.6 is good enough for my openSUSE packaging, however there are a few minor additions needed for Travis CI and better packaging in the future. PR on the way..

@pakal pakal closed this as completed in 51c02e4 May 16, 2019
@pakal
Copy link
Owner

pakal commented May 16, 2019

Thanks for the PR, I'll have an additional look asap at how the patcher behaves when django-contrib-comments isn't installed, since it's now an "extra". (leaving ticket open as a reminder)

@pakal pakal reopened this May 16, 2019
@jayvdb
Copy link
Contributor Author

jayvdb commented May 16, 2019

A good idea. A way to test this is to have a 'nocomments' factor in tox which doesn't install django-contrib-comments. I expect the tests in the current test project will fail, but fail in a sort-of sensible manner. A second test project which doesnt use comments would be needed to properly test how the patcher behaves without django-contrib-comments installed.

@pakal
Copy link
Owner

pakal commented May 20, 2019

Alright, I've updated tox and fixer tests to check that it well returns a meaningful error when importing a missing "module alias" liek django.contrib.comments ; it works fine.

Thansk a lot for your contributions !

@pakal pakal closed this as completed May 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants