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

Add Django v1.11, 2.0 support #33

Merged
merged 36 commits into from
Feb 23, 2018
Merged

Add Django v1.11, 2.0 support #33

merged 36 commits into from
Feb 23, 2018

Conversation

grahamu
Copy link
Contributor

@grahamu grahamu commented Feb 14, 2018

  • Drop Django 1.8, 1.9, 1.10, and Python 3.3 support
  • Add URL namespacing
  • Move documentation into README.md and standardize layout
  • Convert CI and coverage to CircleCi and CodeCov
  • Add PyPi-compatible long description
  • Add migration checking in test suite

Reviewer Notes

  • Verify BSD license as seen in setup.py and README.md.
  • Verify on_delete=models.CASCADE or models.SET_NULL. Pretty sure I got this right, but sure would be nice to double check.
  • Verify documentation. Expanded and copied from separate files and converted to Markdown in README.md.
  • tox.ini now contains migration check
  • Updated the version to 1.0.0. Following convention used in Pinax for such a large change to supported Django/Python configurations.
  • Updated the classifier to "Development Status :: 5 - Production/Stable" from "3 - Alpha". I'm not certain that is warranted here and would appreciate your thoughts.

* Drop Django 1.8, 1.9, 1.10, and Python 3.3 support
* Add URL namespacing
* Move documentation into README.md and standardize layout
* Convert CI and coverage to CircleCi and CodeCov
* Add PyPi-compatible long description
update changelog
@codecov
Copy link

codecov bot commented Feb 14, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@d7336ba). Click here to learn what that means.
The diff coverage is 95.94%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #33   +/-   ##
=========================================
  Coverage          ?   82.05%           
=========================================
  Files             ?       15           
  Lines             ?      758           
  Branches          ?      110           
=========================================
  Hits              ?      622           
  Misses            ?      102           
  Partials          ?       34
Flag Coverage Δ
#py27dj111 82.05% <95.94%> (?)
#py34dj111 82.05% <95.94%> (?)
#py34dj20 82.05% <95.94%> (?)
#py35dj111 82.05% <95.94%> (?)
#py35dj20 82.05% <95.94%> (?)
#py36dj111 82.05% <95.94%> (?)
#py36dj20 82.05% <95.94%> (?)
Impacted Files Coverage Δ
formly/fields.py 72.72% <ø> (ø)
formly/forms/widgets.py 70.58% <ø> (ø)
formly/receivers.py 0% <0%> (ø)
formly/callbacks.py 66.66% <100%> (ø)
formly/views/results.py 100% <100%> (ø)
formly/forms/design.py 89.36% <100%> (ø)
formly/models.py 82.01% <100%> (ø)
formly/utils/views.py 90% <100%> (ø)
formly/views/run.py 55.26% <100%> (ø)
formly/forms/run.py 55% <100%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d7336ba...b5ef88d. Read the comment docs.

@grahamu
Copy link
Contributor Author

grahamu commented Feb 14, 2018

Hi @paltman and @jacobwegner! This PR supports MGH desire to use Django 2.0. I've applied many of the lessons learned in Pinax here, but there were a lot of changes so I'd appreciate a review from one or both of you when possible. MGH upgrade is blocked pending this update. Thanks in advance!

@grahamu grahamu mentioned this pull request Feb 14, 2018
Copy link
Contributor

@jacobwegner jacobwegner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@grahamu thanks for your work here; I had started some changes to linting / CI in another branch but hadn't made it as far.

I think the changes to classification / release to 1.0 are long overdue, and it fits in that the URL namespace is also a backward-incompatible change.

I left a few small comments on some of the linting scripts needing to be updated from expecting a pinax directory structure to formly.

I'm curious as to why the tests show as passing when there was clearly an error; perhaps a return code is getting silenced:

https://circleci.com/gh/eldarion/formly/9

Once the linting / coverage changes are made, I think this is good to go.

setup.py Outdated

setup(
author="Patrick Altman",
author_email="paltman@eldarion.com",
description="a dynamic form generator",
description="A forms/survey generator for dynamically constructor multi-page surveys",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps "for dynamically constructed multi-page surveys"?

tox.ini Outdated
skip_glob=**/*/migrations/*

[coverage:run]
source = pinax
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pinax --> formly

tox.ini Outdated
coverage report -m --skip-covered

[testenv:checkqa]
commands =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pinax --> formly

tox.ini Outdated
max-complexity = 10
exclude = formly/migrations/*,docs/*
exclude = **/*/migrations/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this exclusion glob might need to change to pick up formly/migrations

tox.ini Outdated
known_third_party=appconf
sections=FUTURE,STDLIB,DJANGO,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
include_trailing_comma=True
skip_glob=**/*/migrations/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formly/migrations

@grahamu
Copy link
Contributor Author

grahamu commented Feb 14, 2018

Thanks so much @jacobwegner, good catches! Since this code is used in production I'll examine expected test failures in more detail, and bump test coverage as needed.

@grahamu
Copy link
Contributor Author

grahamu commented Feb 14, 2018

@jacobwegner

I'm curious as to why the tests show as passing when there was clearly an error; perhaps a return code is getting silenced

My testing shows flake8 xyz produces no error, even though xyz does not exist. I've fixed the pinax references and the exclusion globs. Now going after better test coverage.

Further disclosure: The documentation has been converted to single README.md file, no longer published to ReadTheDocs. Hopefully that's not a problem.

@jacobwegner
Copy link
Contributor

@grahamu yep; saw the docs change and am +1

@grahamu
Copy link
Contributor Author

grahamu commented Feb 15, 2018

@jacobwegner Since we're updating formly urls with namespacing and legacy projects will need to update all these references anyway, what do you think about simplifying the url names, removing the dt_ and rt_ prefixes? From what I can tell, those prefixes indicate Design and Run, but none of the following urlname strings conflict.

Older version: formly_dt_page_create
Updated version: formly:dt_page_create
Proposed version: formly:page_create

The dt_ and rt_ prefixes don't add anything AFAIK, YMMV. Certainly the proposed version is much more readable.

@grahamu
Copy link
Contributor Author

grahamu commented Feb 15, 2018

@jacobwegner Page.move_up() and Page.move_down() do not work. My guess is they were copied from Field.move_up/down(), but Field doesn't have the same type of unique_together constraint that Page does. The error is

IntegrityError: UNIQUE constraint failed: formly_page.survey_id, formly_page.page_num

My guess is nobody has run into this because nobody has used these Page methods. I can hack together a solution by assigning a temporary unused page_num during the swap, or we can remove these methods entirely from the Page model and then restore correctly if/when needed. Your thoughts much appreciated, thanks.

@jacobwegner
Copy link
Contributor

@grahamu I'm +1 on removing the broken page manipulation methods and to your URL changes (since we're disclosing the backwards incompatible changes as part of the release).

@grahamu
Copy link
Contributor Author

grahamu commented Feb 20, 2018

Thanks @jacobwegner, appreciate your feedback!

@grahamu grahamu merged commit 64e31ed into master Feb 23, 2018
@grahamu grahamu deleted the django-20 branch February 23, 2018 21:54
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.

2 participants