[twill] Small backward compatibility patch to setup.py
William K. Volkman
wkvsf at users.sourceforge.net
Sun Mar 26 03:03:51 PST 2006
On Sat, 2006-03-25 at 17:18 -0800, Titus Brown wrote:
> On Sat, Mar 25, 2006 at 02:09:03PM -0700, William K. Volkman wrote:
> -> I end up making this change each time I get a new version of Twill,
> -> perhaps it slows down others:
> ->
> -> --- setup.py.orig 2006-03-25 02:05:04.000000000 -0700
> -> +++ setup.py 2006-03-25 14:05:10.000000000 -0700
> -> @@ -1,6 +1,9 @@
> -> #!/usr/bin/env python
> ->
> -> -from setuptools import setup
> -> +try:
> -> + from setuptools import setup
> -> +except ImportError:
> -> + from distutils.core import setup
> ->
> -> #### twill info.
>
> Hi, William,
>
> I'm putting this patch in, but I'm afraid you lose some functionality
> along with it. In particular, with twill 0.8.4, I started using the
> 'entry_point' option of setuptools.setup to specify 'twill-sh'. This
> patch to use distutils will fail to upgrade twill-sh in your current
> installation, I think.
>
> I switched to the 'entry_point' method in the hopes that this will work
> better under Windows than the old 'scripts' mechanism did. It may well
> not work out that way -- I already have another e-mail from someone who
> had some problems getting 'twill-sh' to work under 0.8.4 ;). If I get
> enough complaints, I'll switch back to using 'scripts'.
Well, yes you are correct that twill-sh doesn't get installed/upgraded.
After making all the changes necessary:
--- MANIFEST.orig 2006-03-25 14:03:22.000000000 -0700
+++ MANIFEST 2006-03-25 15:58:08.000000000 -0700
@@ -1,5 +1,6 @@
README.txt
setup.py
+twill-sh
twill-fork
twill/__init__.py
twill/_browser.py
--- setup.py.orig 2006-03-25 02:05:04.000000000 -0700
+++ setup.py 2006-03-25 16:00:21.000000000 -0700
@@ -1,6 +1,9 @@
#!/usr/bin/env python
-from setuptools import setup
+try:
+ from setuptools import setup
+except ImportError:
+ from distutils.core import setup
#### twill info.
@@ -22,7 +25,7 @@
# allow both
entry_points = dict(console_scripts=['twill-sh =
twill.shell:main'],),
- scripts = ['twill-fork'],
+ scripts = ['twill-fork','twill-sh'],
maintainer = 'C. Titus Brown',
maintainer_email = 'titus at caltech.edu',
This is with Fedora Core 4 and python-2.4.1-2. I don't know if the
additional
entry_points will cause problems. Note that my target for setup.py is
bdist_rpm.
HTH,
William.
More information about the twill
mailing list