#16671: 5th tutorial on turning Polls into a reusable app
-------------------------------+------------------------------------
     Reporter:  stumbles       |                    Owner:  ben@…
         Type:  New feature    |                   Status:  new
    Component:  Documentation  |                  Version:  master
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Accepted
    Has patch:  1              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+------------------------------------

Comment (by carljm):

 Agreed, this is looking great.

 I don't have clarity on how best to both keep it simple and recommend best
 practices in the morass of confusion that is Python packaging, when it
 comes to recommending distutils vs distribute. You can't really recommend
 distribute without explaining that it's a third-party package, not part of
 the Python standard library, meaning that you're preventing people who
 don't have it from installing your package - but at the same time, in
 practice everybody has it, so that's not really a problem. But that's an
 awful lot of extra potentially-very-confusing information to try to
 squeeze in (not to mention explaining _why_ you'd use distribute rather
 than the stdlib option), all of which argues for just using distutils.

 The main problem I see is in recommending distutils and recommending
 "python setup.py install" in the same tutorial - because that's the one
 path that means no useful metadata is installed along with the package,
 and therefore automated uninstall is not possible (pip is not able to
 uninstall packages installed in this way). When you add in "sudo", it
 means our tutorial is telling people to install a test package as the root
 user, to their system site-packages, in such a way that it can't be
 removed without manually sudoing and using "rm -rf". That's...
 unfortunate. We have three choices (use distutils, demonstrate "python
 setup.py install", default to "sudo" rather than virtualenv) which I think
 are all individually the right choice for simplicity's sake, but the
 combination has a sub-optimal result. If we had to change any of those
 three, I'd probably go for switching from distutils to distribute.

 Regardless, if the tutorial tells them to "sudo python setup.py install",
 I think we need to tell them how they can uninstall it. If we use
 distribute, we can just link to pip and say "pip can uninstall this." If
 we stick with distutils, we have to tell them they'd need to manually
 "sudo rm -rf" the polls directory (which they can find as demonstrated, by
 importing polls and checking `polls.__file__`).

 One other note - in Python 2.7 it is no longer necessary to redundantly
 add files to MANIFEST.in that are listed in `package_data` (in this case,
 the templates). That was a bug in distutils in Python 2.6 and previous
 that was fixed in Python 2.7. I guess as long as we support 2.6 we should
 probably demonstrate a 2.6-compatible technique, but I wonder if it's
 worth a brief aside to note the redundancy, and that you don't need it if
 generating the sdist using Python 2.7. In any case, whenever Django drops
 2.6 support this should be changed.

 And lastly: if we keep the link to Eric's article, his last name is
 spelled "Holscher".

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16671#comment:23>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to