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 3.0 issues #132

Closed
MaistrenkoAnton opened this issue Dec 3, 2019 · 19 comments
Closed

Django 3.0 issues #132

MaistrenkoAnton opened this issue Dec 3, 2019 · 19 comments

Comments

@MaistrenkoAnton
Copy link

After installing Django 3rd versions the package has errors:

app_1  |     from .base_invitation import AbstractBaseInvitation
app_1  |   File "/app/invitations/base_invitation.py", line 3, in <module>
app_1  |     from django.utils.encoding import python_2_unicode_compatible
app_1  | ImportError: cannot import name 'python_2_unicode_compatible' from 'django.utils.encoding'

and

File "/app/invitations/models.py", line 15, in <module>
app_1  |     from .adapters import get_invitations_adapter
app_1  |   File "/app/invitations/adapters.py", line 9, in <module>
app_1  |     from .utils import import_attribute
app_1  |   File "/app/invitations/utils.py", line 3, in <module>
app_1  |     from django.utils import six
app_1  | ImportError: cannot import name 'six' from 'django.utils' (/usr/local/lib/python3.7/site-packages/django/utils/__init__.py)
@ElephantBombay
Copy link

I'm getting the same error "ImportError: cannot import name 'python_2_unicode_compatible'". Have you found any solution?

@paulchubatyy
Copy link

That might be related to Django 3 not supporting python 2.x any more.

@fsecada01
Copy link
Contributor

Just added a pull request to resolve the issue.

#136

@adamf
Copy link

adamf commented Jan 8, 2020

Bump on getting this merged - we have vendor in this package and patch since we moved to Django 3. Anything we can do to help?

@qiqizone
Copy link

For second issue, maybe you can copy the six.py from C:\Program Files\JetBrains\PyCharm 2018.3.5\helper(this is my folder) to D:\Anaconda3.5\Lib\site-packages\django\utils(this is my folder).

For first issue, use the code below:
try
from django.utils.six import python_2_unicode_compatible
instead of
from django.utils.encoding import python_2_unicode_compatible

@epicserve
Copy link

The build on the PR is failing FWIW.

cc: @fsecada01

@fsecada01
Copy link
Contributor

The build on the PR is failing FWIW.

cc: @fsecada01

Will go through and see what the culprit is. In the interim, if anyone wants to suggest changes to the pull request, feel free.

@fsecada01
Copy link
Contributor

So the testing with Travis is failing for all versions of Python except 3.8, and the culprit is the django111-backendAllauth set of tests. I haven't made any material changes to the invitations code outside of substituting six for django.utils.six, so if anyone can help me figure this out so the builds can pass, that would be great.

@erikvlm
Copy link

erikvlm commented Feb 3, 2020

Any updates on this?

@fsecada01
Copy link
Contributor

fsecada01 commented Feb 4, 2020

Not really. I cannot pinpoint where the testing failures are taking place in the Travis builds. I've tried to experiment with Jenkins and local builds of Travis so I can do iterative testing but those efforts have not been successful. At this stage, I will be trying pyenv to do some granular checking, but failing that, I have no real idea of how to proceed.

Really, @Siecje's pull seems to be the best step moving forward, since his pull request passes through Travis. The issue, however, is that it removes Py2 functionality and each subsequent of django_invitations will not be python2 compatible.

#134

@fsecada01
Copy link
Contributor

So I'm using Tox and nothing works at all. I'm abandoning my efforts to get this working because I can't even be bothered, anymore. I might as well just uninstall this module and build invitation features myself.

@Siecje
Copy link

Siecje commented Feb 4, 2020

If you are using Django3 you are not using Python2. You can just remove the six imports and it will work.

@fsecada01
Copy link
Contributor

Moreso, django-allauth now requires at least django==2.0 so it stands to reason that django-invitations should just remove six and move onto being Python3 only.

@fsecada01
Copy link
Contributor

fsecada01 commented Feb 5, 2020

I just updated the tox.ini setting to test against v. 0.40.0 for django-allauth and all the tests are now passing. I just made the pull request. Let's see what happens!

@bee-keeper
Copy link
Member

Thanks everyone and apologies for not sorting this out sooner.

I definitely do not care about supporting Python 2 since it's EOL. @fsecada01 can we go with your PR, remove all the six stuff and I think tests should be passing? If all good I can cut a new release today/tomorrow.

@fsecada01
Copy link
Contributor

Tests have passed since pinning django-allauth to v.0.40.0 in `tox.ini.' I can amend future tests, depending on my availability.

@erikvlm
Copy link

erikvlm commented Feb 7, 2020

So, until the PR has been merged - how can I access the package myself and remove the six modules? (Did a pipenv install django-invitations)

@fsecada01
Copy link
Contributor

So, until the PR has been merged - how can I access the package myself and remove the six modules? (Did a pipenv install django-invitations)

You can install my fork for the interim. Just list the git link in your requirements. https://github.com/fsecada01/django-invitations/archive/master.zip

However, the PR has been merged with the developer branch, so I imagine that @bee-keeper is doing their internal testing before merging into the main branch. Shouldn't be too long now!

@bee-keeper
Copy link
Member

Fixed in #140

I'll release a new version over the weekend. Thanks everyone for contributions.

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

10 participants