473,545 Members | 2,042 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reinvent no more forever

Howdy all,

On dirtSimple.org[0], PJE wrote:

"Why is Python "blessed" with so much reinvention? Because it's
often cheaper to rewrite than to reuse. Python code is easy to
write, but hard to depend on. You pretty much have to:

1. limit yourself to platforms with a suitable packaging
system,
2. bundle all your dependencies into your distribution, or
3. make your users do all the work themselves

Ouch. No wonder rewriting looks easier."

He then goes on to talk about his own solution: PyPI, setuptools,
EasyInstall, and so on for better dependency control. He concludes:

"But for right now, I plan to start by putting my dependencies
where my mouth is. I will bundle no more forever, for I am tired
of keeping them up-to-date with their upstream maintainers. I
shall rend my monolithic packages into smaller projects, so that
people can make use of cool parts of PEAK without having to
install anything but the part they want. I will find out if this
stuff really works. From where the setuptools now stand, I will
bundle no more forever."

Fine sentiments. What does this mean for PyPI though? How should those
of us who also want to "reinvent no more forever" proceed? How do we
deal with the rampant proliferation of a zillion implementations of
some standard idiom in PyPI?

The case that led me to this quandary is simple: I'm developing an
application that could become simple, and I'm on the lookout for
pieces that might be valuable outside this application. The first one
to catch my eye is an Enum implementation.

I now have a setuptools package of my Enum implementation. Should I
submit it to PyPI?

Advantages:

- I can declare a dependency on that package for all my other
packages that need such functionality, instead of bundling it
every time.

- Others can benefit from my code, instead of yet again including an
Enum implementation (home-grown, or picked from a cookbook) by a
simple dependency declaration.

- The code hopefully gets improved and generalised and all the other
benefits that accrue to software with many users.

Disadvantages:

- Proliferation. What's the protocol when[1] someone else puts an
(incompatible, differently-specified) Enum implementation into
PyPI?

- Naming. How many ways can a package providing an Enum be named?
I'd prefer mine to be named "Enum" or "enum", but why should mine
be the one that claims that name?

- It's just a pretty simple type, with unit tests. Does this really
justify a PyPI package?

This is common to any repository of code. But the "automatic
dependency" problem means that all those packages, and many more
outside that repository, need to know how those problems are resolved.

Operating system distributors have policies (to greater or lesser
degrees of strictness) to ensure this kind of quality control. My
understanding of PyPI is that there's no such policy.

I'd love to follow the mantra PJE espouses, but if it's good for one
person it's probably good for countless others. How do we deal with
that? What actions can we take in advance to prevent problems in
future?
[0] <URL:http://dirtsimple.org/2005/07/reinvent-no-more-forever.html>

[1] Of course, someone already has. I prefer mine to theirs, hence the
question.

--
\ "I planted some bird seed. A bird came up. Now I don't know |
`\ what to feed it." -- Steven Wright |
_o__) |
Ben Finney
Nov 22 '05 #1
16 1351
Ben Finney wrote:
Howdy all,

Hello,
On dirtSimple.org[0], PJE wrote:

"Why is Python "blessed" with so much reinvention? Because it's
often cheaper to rewrite than to reuse. Python code is easy to
write, but hard to depend on. You pretty much have to:

1. limit yourself to platforms with a suitable packaging
system,
2. bundle all your dependencies into your distribution, or

For pure python modules I don't find this to be a big problem.
3. make your users do all the work themselves

Ouch. No wonder rewriting looks easier."
[snip..]
I now have a setuptools package of my Enum implementation. Should I
submit it to PyPI?

Advantages:

- I can declare a dependency on that package for all my other
packages that need such functionality, instead of bundling it
every time.

- Others can benefit from my code, instead of yet again including an
Enum implementation (home-grown, or picked from a cookbook) by a
simple dependency declaration.

- The code hopefully gets improved and generalised and all the other
benefits that accrue to software with many users.

These are all very compelling reasons.
Disadvantages:

- Proliferation. What's the protocol when[1] someone else puts an
(incompatible, differently-specified) Enum implementation into
PyPI?

That shouldn't be any more of a problem than the current situation. In
fact as the setuptools system becomes more established then it should
be easier for people to discover that an existing package does what
they want - rather than creating their own.
- Naming. How many ways can a package providing an Enum be named?
I'd prefer mine to be named "Enum" or "enum", but why should mine
be the one that claims that name?

I think "first come - first served" is the only possible way this can
work.
- It's just a pretty simple type, with unit tests. Does this really
justify a PyPI package?

If it solves a common problem in an elegant way, then it's better
shared. :-)
This is common to any repository of code. But the "automatic
dependency" problem means that all those packages, and many more
outside that repository, need to know how those problems are resolved.

Operating system distributors have policies (to greater or lesser
degrees of strictness) to ensure this kind of quality control. My
understanding of PyPI is that there's no such policy.

I'd love to follow the mantra PJE espouses, but if it's good for one
person it's probably good for countless others. How do we deal with
that? What actions can we take in advance to prevent problems in
future?

Isn't setuptools *the system* that addresses these issues ? It provides
a way to track and auto-install dependencies - so long as you have the
right kind of netowrk connection [1] and the packager of the
dependencies provides them in a way compatible with setuptools.

All the best,

Fuzzy
http://www.voidspace.org.uk/python/index.shtml

[1] setuptools uses python code to access the internet and install
dependencies. Python code can't fetch https URLs through a proxy and
can't use a SOCKS proxy at all. That means with some kinds of internet
conenctions (e.g. behind company firewalls) it doesn't work. Building
optional support for pycurl into setuptools could possibly resolve
this.

[0] <URL:http://dirtsimple.org/2005/07/reinvent-no-more-forever.html>

[1] Of course, someone already has. I prefer mine to theirs, hence the
question.

--
\ "I planted some bird seed. A bird came up. Now I don't know |
`\ what to feed it." -- Steven Wright |
_o__) |
Ben Finney


Nov 22 '05 #2
Ben Finney wrote:
Howdy all,

Hello,
On dirtSimple.org[0], PJE wrote:

"Why is Python "blessed" with so much reinvention? Because it's
often cheaper to rewrite than to reuse. Python code is easy to
write, but hard to depend on. You pretty much have to:

1. limit yourself to platforms with a suitable packaging
system,
2. bundle all your dependencies into your distribution, or

For pure python modules I don't find this to be a big problem.
3. make your users do all the work themselves

Ouch. No wonder rewriting looks easier."
[snip..]
I now have a setuptools package of my Enum implementation. Should I
submit it to PyPI?

Advantages:

- I can declare a dependency on that package for all my other
packages that need such functionality, instead of bundling it
every time.

- Others can benefit from my code, instead of yet again including an
Enum implementation (home-grown, or picked from a cookbook) by a
simple dependency declaration.

- The code hopefully gets improved and generalised and all the other
benefits that accrue to software with many users.

These are all very compelling reasons.
Disadvantages:

- Proliferation. What's the protocol when[1] someone else puts an
(incompatible, differently-specified) Enum implementation into
PyPI?

That shouldn't be any more of a problem than the current situation. In
fact as the setuptools system becomes more established then it should
be easier for people to discover that an existing package does what
they want - rather than creating their own.
- Naming. How many ways can a package providing an Enum be named?
I'd prefer mine to be named "Enum" or "enum", but why should mine
be the one that claims that name?

I think "first come - first served" is the only possible way this can
work.
- It's just a pretty simple type, with unit tests. Does this really
justify a PyPI package?

If it solves a common problem in an elegant way, then it's better
shared. :-)
This is common to any repository of code. But the "automatic
dependency" problem means that all those packages, and many more
outside that repository, need to know how those problems are resolved.

Operating system distributors have policies (to greater or lesser
degrees of strictness) to ensure this kind of quality control. My
understanding of PyPI is that there's no such policy.

I'd love to follow the mantra PJE espouses, but if it's good for one
person it's probably good for countless others. How do we deal with
that? What actions can we take in advance to prevent problems in
future?

Isn't setuptools *the system* that addresses these issues ? It provides
a way to track and auto-install dependencies - so long as you have the
right kind of netowrk connection [1] and the packager of the
dependencies provides them in a way compatible with setuptools.

All the best,

Fuzzy
http://www.voidspace.org.uk/python/index.shtml

[1] setuptools uses python code to access the internet and install
dependencies. Python code can't fetch https URLs through a proxy and
can't use a SOCKS proxy at all. That means with some kinds of internet
conenctions (e.g. behind company firewalls) it doesn't work. Building
optional support for pycurl into setuptools could possibly resolve
this.

[0] <URL:http://dirtsimple.org/2005/07/reinvent-no-more-forever.html>

[1] Of course, someone already has. I prefer mine to theirs, hence the
question.

--
\ "I planted some bird seed. A bird came up. Now I don't know |
`\ what to feed it." -- Steven Wright |
_o__) |
Ben Finney


Nov 22 '05 #3
Fuzzyman <fu******@gmail .com> wrote:
Ben Finney wrote:
On dirtSimple.org[0], PJE wrote:

[...] Python code is easy to write, but hard to depend on. You
pretty much have to:

1. limit yourself to platforms with a suitable packaging
system,
2. bundle all your dependencies into your distribution, or


For pure python modules I don't find this to be a big problem.


The problem isn't whether it's Python or not; the problem is the
complexity of the code base. A simple application that depends on
infrastructure from five different non-standard packages becomes a
right mess to distribute, is stuck with code that is peripheral to its
own purpose, and can't benefit from new versions of those packages.
[distributing a simple package via PyPI]

Disadvantages:

- Proliferation. What's the protocol when[1] someone else puts
an (incompatible, differently-specified) Enum implementation
into PyPI?


That shouldn't be any more of a problem than the current situation.
In fact as the setuptools system becomes more established then it
should be easier for people to discover that an existing package
does what they want - rather than creating their own.


I hold up all existing public source code repositories as evidence
against your prediction. Reinventing the wheel is distressingly
common, and a dependency tool isn't going to stop that.
- Naming. How many ways can a package providing an Enum be
named? I'd prefer mine to be named "Enum" or "enum", but why
should mine be the one that claims that name?


I think "first come - first served" is the only possible way this
can work.


Perhaps so.
- It's just a pretty simple type, with unit tests. Does this
really justify a PyPI package?


If it solves a common problem in an elegant way, then it's better
shared. :-)


Sure. But the question was, is PyPI the place to do so?
This is common to any repository of code. But the "automatic
dependency" problem means that all those packages, and many more
outside that repository, need to know how those problems are
resolved.

Operating system distributors have policies (to greater or lesser
degrees of strictness) to ensure this kind of quality control. My
understanding of PyPI is that there's no such policy.


Isn't setuptools *the system* that addresses these issues ? It
provides a way to track and auto-install dependencies [...]


No, setuptools is only the answer for the packages themselves; the
problems I describe are inherent to the package repository.

The setuptools dependency model rests on the reliability of the
package repository. Not only in terms of availability but also in
terms of the quality and functionality of the package set.

--
\ "I went to the museum where they had all the heads and arms |
`\ from the statues that are in all the other museums." -- Steven |
_o__) Wright |
Ben Finney
Nov 22 '05 #4
Fuzzyman <fu******@gmail .com> wrote:
Ben Finney wrote:
On dirtSimple.org[0], PJE wrote:

[...] Python code is easy to write, but hard to depend on. You
pretty much have to:

1. limit yourself to platforms with a suitable packaging
system,
2. bundle all your dependencies into your distribution, or


For pure python modules I don't find this to be a big problem.


The problem isn't whether it's Python or not; the problem is the
complexity of the code base. A simple application that depends on
infrastructure from five different non-standard packages becomes a
right mess to distribute, is stuck with code that is peripheral to its
own purpose, and can't benefit from new versions of those packages.
[distributing a simple package via PyPI]

Disadvantages:

- Proliferation. What's the protocol when[1] someone else puts
an (incompatible, differently-specified) Enum implementation
into PyPI?


That shouldn't be any more of a problem than the current situation.
In fact as the setuptools system becomes more established then it
should be easier for people to discover that an existing package
does what they want - rather than creating their own.


I hold up all existing public source code repositories as evidence
against your prediction. Reinventing the wheel is distressingly
common, and a dependency tool isn't going to stop that.
- Naming. How many ways can a package providing an Enum be
named? I'd prefer mine to be named "Enum" or "enum", but why
should mine be the one that claims that name?


I think "first come - first served" is the only possible way this
can work.


Perhaps so.
- It's just a pretty simple type, with unit tests. Does this
really justify a PyPI package?


If it solves a common problem in an elegant way, then it's better
shared. :-)


Sure. But the question was, is PyPI the place to do so?
This is common to any repository of code. But the "automatic
dependency" problem means that all those packages, and many more
outside that repository, need to know how those problems are
resolved.

Operating system distributors have policies (to greater or lesser
degrees of strictness) to ensure this kind of quality control. My
understanding of PyPI is that there's no such policy.


Isn't setuptools *the system* that addresses these issues ? It
provides a way to track and auto-install dependencies [...]


No, setuptools is only the answer for the packages themselves; the
problems I describe are inherent to the package repository.

The setuptools dependency model rests on the reliability of the
package repository. Not only in terms of availability but also in
terms of the quality and functionality of the package set.

--
\ "I went to the museum where they had all the heads and arms |
`\ from the statues that are in all the other museums." -- Steven |
_o__) Wright |
Ben Finney
Nov 22 '05 #5
Ben Finney wrote:
- Proliferation. What's the protocol when[1] someone else puts an
(incompatible, differently-specified) Enum implementation into
PyPI?
Either one of the two will be judged better, and the other will wither
away, or else each will be better for different circumstances, and
different people will use them. Either way, not a problem.

- Naming. How many ways can a package providing an Enum be named?
I'd prefer mine to be named "Enum" or "enum", but why should mine
be the one that claims that name?
If you feel badly about it, just call it BFEnum, or SuperEnum, or make
up some other "branding" to use for your packages. Otherwise, take the
rightful spoils of the pioneer by staking your claim to the name. :)

- It's just a pretty simple type, with unit tests. Does this really
justify a PyPI package?
Yes. Excellent documentation would be a plus, of course, and perhaps
one of those screencasts that seem to be all the rage nowadays. ;)

I'd love to follow the mantra PJE espouses, but if it's good for one
person it's probably good for countless others. How do we deal with
that? What actions can we take in advance to prevent problems in
future?
It's simple, really. Ridicule and scorn are quite effective behavior
modification techniques for a community to employ in furthering its
operational goals. So, when people step out of line, we'll just make
fun of them until they conform. :)

[1] Of course, someone already has. I prefer mine to theirs, hence the
question.


Okay, so call yours "SuperEnum" or "PowerEnum" or "UltraEnum" or
"BetterEnum ", "Enum-O-Matic", "Symbolitron".. .

or just think about *why* yours is better, for *whom* it's better, and
*when*, and then give it a name that emphasizes one or more of those
things. Even though "all the good domain names are taken", there still
seem to be an infinity of names remaining. That's also true for PyPI.

Nov 22 '05 #6
Ben Finney wrote:
- Proliferation. What's the protocol when[1] someone else puts an
(incompatible, differently-specified) Enum implementation into
PyPI?
Either one of the two will be judged better, and the other will wither
away, or else each will be better for different circumstances, and
different people will use them. Either way, not a problem.

- Naming. How many ways can a package providing an Enum be named?
I'd prefer mine to be named "Enum" or "enum", but why should mine
be the one that claims that name?
If you feel badly about it, just call it BFEnum, or SuperEnum, or make
up some other "branding" to use for your packages. Otherwise, take the
rightful spoils of the pioneer by staking your claim to the name. :)

- It's just a pretty simple type, with unit tests. Does this really
justify a PyPI package?
Yes. Excellent documentation would be a plus, of course, and perhaps
one of those screencasts that seem to be all the rage nowadays. ;)

I'd love to follow the mantra PJE espouses, but if it's good for one
person it's probably good for countless others. How do we deal with
that? What actions can we take in advance to prevent problems in
future?
It's simple, really. Ridicule and scorn are quite effective behavior
modification techniques for a community to employ in furthering its
operational goals. So, when people step out of line, we'll just make
fun of them until they conform. :)

[1] Of course, someone already has. I prefer mine to theirs, hence the
question.


Okay, so call yours "SuperEnum" or "PowerEnum" or "UltraEnum" or
"BetterEnum ", "Enum-O-Matic", "Symbolitron".. .

or just think about *why* yours is better, for *whom* it's better, and
*when*, and then give it a name that emphasizes one or more of those
things. Even though "all the good domain names are taken", there still
seem to be an infinity of names remaining. That's also true for PyPI.

Nov 22 '05 #7
Phillip J. Eby <pj*@telecommun ity.com> wrote:
Ben Finney wrote:
- It's just a pretty simple type, with unit tests. Does this
really justify a PyPI package?


Yes.


Thanks for the brief, but supportive discussion from everyone. I've
now packaged and uploaded my simple module. (No prizes for discovering
it; I don't think it warrants discussion in this thread.)

I guess I wasn't putting much faith in social measures for solving
problems after they occur, and imagined some kind of oversight or
moderation or suchlike. In retrospect, that sounds like a terrible
idea, and social measures are the only thing that *can* properly deal
with these issues.

--
\ "Nothing in life is so exhilarating as to be shot at without |
`\ result." -- Winston Churchill |
_o__) |
Ben Finney
Nov 22 '05 #8
Phillip J. Eby <pj*@telecommun ity.com> wrote:
Ben Finney wrote:
- It's just a pretty simple type, with unit tests. Does this
really justify a PyPI package?


Yes.


Thanks for the brief, but supportive discussion from everyone. I've
now packaged and uploaded my simple module. (No prizes for discovering
it; I don't think it warrants discussion in this thread.)

I guess I wasn't putting much faith in social measures for solving
problems after they occur, and imagined some kind of oversight or
moderation or suchlike. In retrospect, that sounds like a terrible
idea, and social measures are the only thing that *can* properly deal
with these issues.

--
\ "Nothing in life is so exhilarating as to be shot at without |
`\ result." -- Winston Churchill |
_o__) |
Ben Finney
Nov 22 '05 #9
On 17 Nov 2005 18:06:55 -0800 in comp.lang.pytho n, "Phillip J. Eby"
<pj*@telecommun ity.com> wrote:

[...]

Okay, so call yours "SuperEnum" or "PowerEnum" or "UltraEnum" or
"BetterEnum" , "Enum-O-Matic", "Symbolitron".. .


ITYM "EnumOMatic " or "Enum_O_Mat ic". "Enum-O-Matic" is a syntax
error. Or worse...

Regards,
-=Dave

--
Change is inevitable, progress is not.
Nov 22 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
6322
by: Yannick Turgeon | last post by:
Hello all, I'm using SS 2000 and NT4 (and Access97 as front-end on another server) Well, probably by lack of knowledge about table locks, I don't really know where to start to present this problem. In Enterprise manager, section "Management->Current activity->Locks/Objects", we have a couple (5-7) of "forever runnable" processes, all...
0
1214
by: Cable | last post by:
Greetings, We have a production website, and within that website we have an 'Admin' section of the website. Two separate ASP.NET/C# web applications. Recently when trying to log into the admin portion, we have noticed the page never loading - the IE globe will literally spin forever. So we figured we had some rogue infinite loop, memory...
28
1962
by: Stefano Masini | last post by:
On 8 Sep 2005 08:24:50 -0700, Fuzzyman <fuzzyman@gmail.com> wrote: > What is pythonutils ? > ===================== > ConfigObj - simple config file handling > validate - validation and type conversion system > listquote - string to list conversion > StandOut - simple logging and output control object > pathutils - for working with paths and...
1
2147
by: Amil Hanish | last post by:
I'm having an issue on IIS 6 on Windows 2003 Server. The following simple file hangs the client forever (I quite waiting after about five minutes). No error in IIS error file or IIS log file. The website has no traffic except my testing. <HTML> <HEAD> </HEAD> <body> <form method="post" runat="server"></form>
0
977
by: Ben Finney | last post by:
Howdy all, On dirtSimple.org, PJE wrote: "Why is Python "blessed" with so much reinvention? Because it's often cheaper to rewrite than to reuse. Python code is easy to write, but hard to depend on. You pretty much have to: 1. limit yourself to platforms with a suitable packaging system,
6
16138
by: alessandro | last post by:
Hi all, This is my framework for create TCP server listening forever on a port and supporting threads: import SocketServer port = 2222 ip = "192.168.0.4"
8
2195
by: damod.php | last post by:
Iam a php/mysql developer. I wanna know whether staying in php and mysql forever would affect my future. Most s/w people are in either java or dotnet. Iam novice in both of them. I love php and i dont wanna shift from it. Please tell me whether staying as a php developer is good enough to have a settled future in spftware industry. Pro's and...
4
1111
by: Ronald S. Cook | last post by:
We're looking to not reinvent the wheel in designing the UI for our enterprise Windows app. It's a pretty common scenarion... user clicks to view a list of customers. User clicks on a customer and sees details of that customer which include a list of accounts owned by the customer. User clicks on account to view those details. User wants...
3
3145
by: Inny | last post by:
I want To offer a login Option, two Checkboxs, 1 labeled 'normal' the other labeled 'Forever'. I want to assign the check boxes to switch between the cookie script below (normal) and An altered version of the cookie script 'forever' Which will not expire but require deletion from the users pc. I need help to alter the cookie code below NOT to...
0
7478
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7410
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7668
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7773
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5343
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3466
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1901
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
722
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.