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

Make compatible with Django 1.8 #90

Closed
wants to merge 1 commit into from

Conversation

csghormley
Copy link

Patch imports and setup to use django-formtools instead of the obsolete contrib package.

This fixes issue #89

Passed all tests in my environment.

@coveralls
Copy link

Coverage Status

Coverage decreased (-2.1%) to 96.17% when pulling d7e3060 on csghormley:django-1.8-compat into bf7dfe9 on Bouke:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-2.1%) to 96.17% when pulling d7e3060 on csghormley:django-1.8-compat into bf7dfe9 on Bouke:master.

@Bouke
Copy link
Collaborator

Bouke commented Apr 3, 2015

Including django_formtools as a dependency will not work for Django versions < 1.7, as django_formtools requires >= 1.7. What would be a portable way to continue support for older Django versions?

@csghormley
Copy link
Author

I can modify the compat.py test:

if django.VERSION[:2] >= (1, 8):
...use formtools.*
elif django.VERSION[:2] >= (1, 6):
...use django.contrib.formtools.*

One thing I don't know how to do is craft install_requires to
conditionally require django_formtools.

On 4/3/2015 13:04, Bouke Haarsma wrote:

Including django_formtools as a dependency will not work for Django
versions =1.7. What would be a portable way to continue support for
older Django versions?


Reply to this email directly or view it on GitHub
#90 (comment).

@troygrosfield
Copy link

@csghormley, look at the Requirements in setup.py portion of this stackoverflow answer:

So maybe something along the lines of:

# setup.py
from setuptools import setup
install_requires = ['somelib1', 'somelib2']

try:
    # try to detect django and django.contrib.formtools?
except ImportError:
    # if django exists, and django.contrib.formtools isn't found
    # add the django_formtools to install_requires
    install_requires.append('django_formtools')

setup(
    ...
    install_requires=install_requires,
    ...
)

However, this would also require django to already be installed and if that's the case, you would just do the same version checking that you mentioned above.

Just a thought...

@troygrosfield
Copy link

Second thought, why not just always include django_formtools in install_requires? It simply wouldn't be used for users on django < 1.8 and would work for django 1.8 users which would still make it backward compatible for older django versions.

@Bouke
Copy link
Collaborator

Bouke commented Apr 6, 2015

Thanks for the suggestions, however;

  • django_formtools depends on Django 1.7 or newer (install_requires=['Django>=1.7'],), so this breaks compatibility
  • Injecting dynamically in install_requires means dropping wheel packaging support. And what to do when no Django is found? Assume we're installing the latest version?

@troygrosfield
Copy link

@timgraham, with the release of django 1.8, formtools was moved to it's own repo. How do you guys setup your setup.py to happily work with django 1.8+ as well as older versions of django that require the formtools app? (see discussion above).

@timgraham
Copy link
Contributor

Not sure a good solution to this. I'd try asking on the django-users mailing list.

@troygrosfield
Copy link

@Bouke, what about leaving django_formtools out of the setup.py for now and add doc for django 1.8+ users that a manual install of django_formtools is needed with a reference to an open ticket (this one?) that explains the situation?

Then update the .travis.yml file to conditionally install django_formtools depending on the django version being tested. By doing that, the django 1.8 users at least have the ability to install a non-branch version of this repo and can move forward with development.

@troygrosfield
Copy link

I posted to the django-users group. I'll post the thread here once the topic has been approved.

@Bouke
Copy link
Collaborator

Bouke commented Apr 7, 2015

Thanks everyone for your work. I've included installation instructions in 32eb41d. In a few months, support for 1.4 is dropped and django-formtools can be included for everyone.

@Bouke Bouke closed this Apr 7, 2015
@Bouke
Copy link
Collaborator

Bouke commented Apr 7, 2015

Please let me know if the latest commit on master works for you on Django 1.8. If all is well, I'll release it as 1.2.

@troygrosfield
Copy link

Just tested the latest master and everything works as expected for me using django 1.8, python 3.4.

Thanks @Bouke! 👍

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

Successfully merging this pull request may close these issues.

None yet

5 participants