Bug 224332 - Patch www/py-flup to support py3k for flavours
Summary: Patch www/py-flup to support py3k for flavours
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Li-Wen Hsu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-14 08:32 UTC by Shane
Modified: 2017-12-26 18:41 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (lwhsu)


Attachments
update py-flup for py3k (60.86 KB, patch)
2017-12-14 08:32 UTC, Shane
no flags Details | Diff
shar for flup6 port (2.90 KB, text/plain)
2017-12-16 07:59 UTC, Shane
no flags Details
shar for flup6 port (2.91 KB, text/plain)
2017-12-19 16:21 UTC, Shane
no flags Details
adjust flup dependants to use flup6 (6.42 KB, patch)
2017-12-20 15:58 UTC, Shane
no flags Details | Diff
extra patch for flup6 (1.15 KB, patch)
2017-12-20 16:00 UTC, Shane
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Shane 2017-12-14 08:32:16 UTC
Created attachment 188818 [details]
update py-flup for py3k

Patch www/py-flup to support py3k
This is needed to support the FASTCGI option for py-django with flavours.
Mostly the patches are from 2to3. Some extra adjustment was done for exceptions.
Add LICENSE=BSD2CLAUSE based on setup.py and file contents. There is also one file under MIT and one from public domain.
Remove references to middleware and publisher as these were removed before 1.0.1
Comment 1 Li-Wen Hsu freebsd_committer 2017-12-14 09:14:54 UTC
Thanks for working on this!  This patch changes lots of things, I am thinking if it is worthy to submit to upstream, or even, fork it if it is not maintained anymore.
Comment 2 Shane 2017-12-15 10:19:44 UTC
Actually it will need more work than this. While it will start and respond with a simple test, it still fails under some conditions.

There is a fork in pypi as flup6 that added support for 3.3 and setup some tests, some of which fail with 3.4+ and some say they pass even if an exception is thrown, so I'm not sure it is an improvement.

I only looked at this as a dependancy for a django option. As newer versions have dropped fcgi support it probably isn't really needed for django anyway. From what I can tell wsgi is the preferred python cgi method so I'm wondering how much need there is to improve this.
Comment 3 Shane 2017-12-16 07:59:40 UTC
Created attachment 188873 [details]
shar for flup6 port

After a little more testing I found flup6 only needs a small update to pass the tests with python 3.4+. This would be a better option than the previous patches.

As the pypi name is different I expect the flup port would be expected to be renamed to match.

I tested using tox with py27, py34, py35, py36, pypy27, pypy33.

Renaming the port would mean also updating the dependant ports (not included).
Comment 4 Li-Wen Hsu freebsd_committer 2017-12-16 11:14:41 UTC
Thanks for checking these.  I think creating another port for flup6 is a good idea.  Two questions here:

1. Do you want to be the maintainer of this port?
2. You have also tested it with Django, right?  I think we can change the  Django's dependency to flup6 and deprecate flup.
Comment 5 Shane 2017-12-16 18:19:42 UTC
I'll take maintanership if you don't want to anymore.

I don't think it needs to be another port, just that it should be renamed to match the pypi name as that is the rule for python ports. It is a fork of the old flup package and was kept as a drop in replacement with an unchanged module name, so it will conflict with the existing flup package. The flup6 port should work as a straight replacement, only needing to change the dependency lines.
Comment 6 Shane 2017-12-19 16:21:16 UTC
Created attachment 188966 [details]
shar for flup6 port

Update shar file with me as maintainer.
Comment 7 Li-Wen Hsu freebsd_committer 2017-12-19 16:49:20 UTC
Thanks for providing a new shar. I think I will `svn mv py-flup py-flup6` and update it to the fork as your shar.  Also, is it possible for you to help me check what are the other ports depend on py-flup and do they work with py-flup6?  If you can also provide me a patch which updates dependency line, that will be wonderful.
Comment 8 Shane 2017-12-20 15:58:19 UTC
Created attachment 188997 [details]
adjust flup dependants to use flup6

devel/py-mwlib and www/seahub depend on www/flup but while seahub still mentions flup in it's LICENSE-thirdparty.txt, there is no use of flup in either ports code. These depends can be removed.

Limited testing of graphics/tilecache and www/py-pastescript doesn't show any problems using flup6.

For django - fastcgi support was removed in 1.9 but the current ports have simply been copied so still have flup as a dependency. django18 and django-devel (getting old) can be updated to use flup6. django110 django111 and django20 can have flup removed.
Comment 9 Shane 2017-12-20 16:00:41 UTC
Created attachment 188998 [details]
extra patch for flup6

Fix a py2 issue with flup6 found during testing with tilecache - the use of stdin.buffer is py3 only.
Comment 10 Li-Wen Hsu freebsd_committer 2017-12-25 16:14:22 UTC
Thanks and I will process these soon.
Comment 11 commit-hook freebsd_committer 2017-12-26 18:33:49 UTC
A commit references this bug:

Author: lwhsu
Date: Tue Dec 26 18:33:19 UTC 2017
New revision: 457300
URL: https://svnweb.freebsd.org/changeset/ports/457300

Log:
  - Change to flup6, a fork supports py3k
  - Pass maintainership to submitter

  PR:		224332
  Submitted by:	Shane <FreeBSD@ShaneWare.Biz>

Changes:
  head/MOVED
  head/www/Makefile
  head/www/py-flup/
  head/www/py-flup6/
  head/www/py-flup6/Makefile
  head/www/py-flup6/distinfo
  head/www/py-flup6/files/
  head/www/py-flup6/files/patch-flup_server_ajp__base.py
  head/www/py-flup6/files/patch-flup_server_fcgi__base.py
  head/www/py-flup6/files/patch-flup_server_scgi__base.py
  head/www/py-flup6/pkg-descr
Comment 12 commit-hook freebsd_committer 2017-12-26 18:38:56 UTC
A commit references this bug:

Author: lwhsu
Date: Tue Dec 26 18:37:53 UTC 2017
New revision: 457302
URL: https://svnweb.freebsd.org/changeset/ports/457302

Log:
  - These ports do not need flup anymore

  PR:		224332
  Submitted by:	Shane <FreeBSD@ShaneWare.Biz>

Changes:
  head/devel/py-mwlib/Makefile
  head/www/seahub/Makefile
Comment 13 commit-hook freebsd_committer 2017-12-26 18:39:59 UTC
A commit references this bug:

Author: lwhsu
Date: Tue Dec 26 18:39:15 UTC 2017
New revision: 457303
URL: https://svnweb.freebsd.org/changeset/ports/457303

Log:
  Django's fastcgi support was removed in 1.9

  PR:		224332
  Submitted by:	Shane <FreeBSD@ShaneWare.Biz>

Changes:
  head/www/py-django110/Makefile
  head/www/py-django111/Makefile
  head/www/py-django20/Makefile
Comment 14 Li-Wen Hsu freebsd_committer 2017-12-26 18:41:05 UTC
All patches committed.  Please check following suggestions:

- When providing partch, please make sure it is against the repository root
- Need to bump PORTREVISION when changing the dependency
- Please upstream your modifications to flup6

Thanks for this work again!