[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

distutils setup - changing the location in site-packages

imageguy

2/21/2008 4:33:00 PM

I am hoping if someone can set me straight.

I have created a setup script for a module, however, when running the
install on my own machine, I would like to place the module in a
specific site-packages directory/package.


So if I start with a module in

..\dev\mygreatmodule.py

I want to end up with;

..\lib\site-packages\mytools\mygreatmodule.py.

I have the setup script working, however, when I run the install, it
places the module in the root of site-packages.

The following is the deatils from the script
setup (
name = "mymodule",
version = "0.1",
description = "My modules special description",
author = "me",
author_email = "me@mydomain.com",
py_modules = ["exceptionhandler"]
)

This is for development purposes. I would like to have a development
copy of some "tools", but when ready and tested "publish" them to the
site-packages where they can be included in "production" code.

Any guidance/suggestions would be appreciated.
4 Answers

james.pye

2/21/2008 5:15:00 PM

0

On Feb 21, 9:33 am, imageguy <imageguy1...@gmail.com> wrote:
> I have the setup script working, however, when I run the install, it
> places the module in the root of site-packages.
>
> The following is the deatils from the script
> setup (
>   name = "mymodule",
>   version = "0.1",
>   description = "My modules special description",
>   author = "me",
>   author_email = "m...@mydomain.com",
>   py_modules = ["exceptionhandler"]
> )

Yeah, you need to specify the module path. ie, ``py_modules =
["mytools.exceptionhandler"]``

However, chances are that you want use ``packages``:

setup (
...
packages = ["mytools"]
)

This should include the ``exceptionhandler`` module in the package.

Additionally, you'll need to structure the project to have a
``mytools`` directory that contains an ``__init__.py`` file(package
initialization module), and the ``exceptionhandler.py`` file:

projectdir/
|
|- mytools/
| |
| |- __init__.py
| |- exceptionhandler.py
|
|- setup.py
...

This can be somewhat undesirable if you're using cvs, as chances are
you'll want to change the package's name at some point in the future.
However, I have found that the annoyance of empty directories
littering the module's tree does not outweigh the annoyance of not
being able to use setuptools' ``develop`` command. Not to mention the
simplicity of just using ``packages``.

> This is for development purposes.  I would like to have a development
> copy of some "tools", but when ready and tested "publish" them to the
> site-packages where they can be included in "production" code.

setuptools' 'develop' command can be handy for this.

Hope this helps.

JoeSpareBedroom

7/25/2010 10:16:00 PM

0

"Califbill" <bmckee@nospamix.netcom.com> wrote in message
news:d7ydnVwASqPg4tHRnZ2dnUVZ_oOdnZ2d@earthlink.com...
>
>
> "edspyhill01" <edspyhill01@gmail.com> wrote in message
> news:2a9f0e27-918b-4eb8-a40f-84cdc87ef974@e5g2000yqn.googlegroups.com...
>> On Jul 25, 12:13 pm, FatterDumber& Happier Moe
>> <"WheresMyCheck"@UncleSamLoves.Mee> wrote:
>>> walt tonne wrote:
>>> > On Jul 25, 6:18 am, walt tonne <tonnewalt...@gmail.com> wrote:
>>> >> On Jul 25, 6:07 am, walt tonne <tonnewalt...@gmail.com> wrote:
>>>
>>> >>>http://www.aolnews.com/world/article/germany-considers-tax-......
>>> >>> About time somebody made the move.
>>> >> I see people 30 - 60 years old using mobility carts in the
>>> >> supermarket.
>>> >> Nothing wrong with them except overeating.
>>>
>>> > To fat to f---, too proud to suck, so we had to shoot grandmaw.
>>>
>>> Bread and circuses, keeps us fat dumb and happy. You sure don't
>>> want hungry, thinking, unhappy people come election time if you want to
>>> be re-elected.
>>
>> Tax fat Americans and we'll pay of the national debt in 4 years.
>
> Most of the fat ones pay no taxes anyway. Only country in the world where
> the poor are obese.


Kool-Aid and sugar are cheaper than decent juice.



WheresMyCheck

7/25/2010 10:25:00 PM

0

JoeSpareBedroom wrote:
> "Califbill" <bmckee@nospamix.netcom.com> wrote in message
> news:d7ydnVwASqPg4tHRnZ2dnUVZ_oOdnZ2d@earthlink.com...
>>
>> "edspyhill01" <edspyhill01@gmail.com> wrote in message
>> news:2a9f0e27-918b-4eb8-a40f-84cdc87ef974@e5g2000yqn.googlegroups.com...
>>> On Jul 25, 12:13 pm, FatterDumber& Happier Moe
>>> <"WheresMyCheck"@UncleSamLoves.Mee> wrote:
>>>> walt tonne wrote:
>>>>> On Jul 25, 6:18 am, walt tonne <tonnewalt...@gmail.com> wrote:
>>>>>> On Jul 25, 6:07 am, walt tonne <tonnewalt...@gmail.com> wrote:
>>>>>>> http://www.aolnews.com/world/article/germany-considers-tax-......
>>>>>>> About time somebody made the move.
>>>>>> I see people 30 - 60 years old using mobility carts in the
>>>>>> supermarket.
>>>>>> Nothing wrong with them except overeating.
>>>>> To fat to f---, too proud to suck, so we had to shoot grandmaw.
>>>> Bread and circuses, keeps us fat dumb and happy. You sure don't
>>>> want hungry, thinking, unhappy people come election time if you want to
>>>> be re-elected.
>>> Tax fat Americans and we'll pay of the national debt in 4 years.
>> Most of the fat ones pay no taxes anyway. Only country in the world where
>> the poor are obese.
>
>
> Kool-Aid and sugar are cheaper than decent juice.
>
>
>

So true, and candy bars and potato chips are good to store until they
are eaten, unlike more expensive fresh fruit.

Clive.

7/26/2010 1:22:00 AM

0

In message <d7ydnVwASqPg4tHRnZ2dnUVZ_oOdnZ2d@earthlink.com>, Califbill
<bmckee@nospamix.netcom.com> writes
>Most of the fat ones pay no taxes anyway. Only country in the world
>where the poor are obese.
Poor people tend to be fatter because the cheaper food tends to be
higher in animal fats.
--
Clive