[tor-bugs] #6810 [Flashproxy]: Reduce code duplication across client programs

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Apr 27 09:16:44 UTC 2013


#6810: Reduce code duplication across client programs
-------------------------+--------------------------------------------------
 Reporter:  dcf          |          Owner:  dcf
     Type:  enhancement  |         Status:  new
 Priority:  minor        |      Milestone:     
Component:  Flashproxy   |        Version:     
 Keywords:               |         Parent:     
   Points:               |   Actualpoints:     
-------------------------+--------------------------------------------------
Changes (by dcf):

  * status:  needs_review => new


Comment:

 Replying to [comment:1 aallai]:
 > I have a branch for this at https://github.com/aallai/flashproxy.git
 code_dup.
 >
 > It factors out parse_addr_spec and format_addr into a .py file and adds
 a setup.py to install the client programs. I think it pretty much replaces
 the install make target.
 >
 > Some odds and ends:
 >
 > - The setup.py is copied into the zip for the windows distribution,
 where it is useless.
 >
 > - The version is hard coded in the setup.py script. So it will need to
 be changed both in the makefile and the setup.py. Maybe the dist target
 could modify the setup script to include the correct version. I notice
 George uses something called versioneer to manage his version numbers,
 I'll look into that.

 Thanks for doing this. I made some changes and started a branch at
 https://gitweb.torproject.org/user/dcf/flashproxy.git/shortlog/refs/heads/code_dup.

 So far, I found problems that make the setuptools solution appear worse
 than code duplication, at least for now.

  * Version number in two places, which you noted.
  * Everything should be driven from `Makefile`. `make install` should call
 `setup.py` if that's what it takes to install. This is pretty easy to fix.
  * `dist` directory name conflicts with our existing use of that name.
 That is probably fixable.
  * `setup.py` doesn't install the man pages, and it seems setuptools
 doesn't even know about man pages. Man pages and other documentation need
 to appear in dist packages and with `make install`.
  * `python setup.py dist` puts a dumb `PKG-INFO` file in the dist.
  * If you do `python setup.py build` and then `python setup.py dist`, then
 remove a file, then do `python setup.py dist` again, the removed file will
 remain in the dist because setuptools doesn't clean the existing build
 first. This is infuriating and makes me question what ends up in the dist
 every time.

 Packaging in Python seems really terrible. If we're only using setuptools
 to help install the package/module, it might be better to just roll that
 step ourselves in the makefile.

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/6810#comment:2>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list