How to install Python package from source on Windows

Chris Angelico rosuav at gmail.com
Sun May 21 11:21:08 EDT 2017


On Mon, May 22, 2017 at 12:58 AM, bartc <bc at freeuk.com> wrote:
> On 21/05/2017 12:06, Chris Angelico wrote:
>>
>> On Sun, May 21, 2017 at 8:23 PM, bartc <bc at freeuk.com> wrote:
>
>
>>> (If you imagine a future where the number of targets has increased a
>>> hundred-fold (or we colonise the galaxy and there are a million possible
>>> targets), then it might become clearer that the approach used here -
>>> putting
>>> files for every conceivable machine in the same place - is not scalable.)
>>
>>
>> Actually it's not scalable as soon as you have TWO targets. Every
>> change has to be made to both source files. And where they differ, you
>> need markers to say that it's different. You know, like ifdef lines
>> usually are. I wonder if maybe the current system isn't the result of
>> incompetence after all?
>
>
> Let's say we have a very simple OS that just does this:
>
>  beep(1000,100)       # pitch, duration
>
> and stops. So the above is the entire source. It runs on disparate machines
> A and B. Each of those needs to provide an implementation of beep():
>
> def beep(p,d):       # machine A
>     out(0x100, p)
>     out(0x101, d)    # or whatever
>
> def beep(p,d):       # machine B
>     callint(0x30, p,d)
>
> Now I want to port it to a new machine, and need to provide a custom version
> of beep() that works here:
>
> def beep(p,d):
>     print("beeeep!")
>
> Explain why ALL these drivers, including the one I've just created, need to
> be part of the common source code for the OS.

I don't know. YOU are the one who said the source code should be in a
single file. The normal thing to do is to (a) have separate source
files for different underlying hardware, and then (b) have *a
configure script* that decides which one should be compiled in. That
way, you only compile in those parts that you need, and link them
together appropriately. Every piece of important code exists in one
place.

ChrisA



More information about the Python-list mailing list