Re: How to deploy a custom common module?

2015-05-16 Thread Irmen de Jong
On 17-5-2015 4:06, Jason Friedman wrote:
>> When I deploy test.py on another computer, I put (rsync) both test.py and 
>> cmn_funcs.py in the same remote directory.
>>
>> If I create another python project (test2.py) in new directory, that needs 
>> common functions, what should I do with cmn_funcs.py?
> 
> I put my shared code in a separate folder, named something like
> /path/to/module_dir.
> 
> I then add to /etc/profile.d/something.sh:
> 
> export PYTHONPATH=$PYTHONPATH:/path/to/module_dir
> 


I think you could use the user site packages directory as well for this... then 
you
should not have to change the PYTHONPATH.

https://docs.python.org/3.5/library/site.html#site.USER_SITE

(if you don't want to or cannot install into to the system's site-packages 
directory)


Irmen

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to deploy a custom common module?

2015-05-16 Thread Jason Friedman
> When I deploy test.py on another computer, I put (rsync) both test.py and 
> cmn_funcs.py in the same remote directory.
>
> If I create another python project (test2.py) in new directory, that needs 
> common functions, what should I do with cmn_funcs.py?

I put my shared code in a separate folder, named something like
/path/to/module_dir.

I then add to /etc/profile.d/something.sh:

export PYTHONPATH=$PYTHONPATH:/path/to/module_dir
-- 
https://mail.python.org/mailman/listinfo/python-list


How to deploy a custom common module?

2015-05-15 Thread zljubisicmob
While working on one python script (test.py), I developed some functions that I 
will probably need in my future projects, so I decided to put such functions in 
another python file (cmn_funcs.py).

So in my test.py there is import cmn_funcs in order to use common functions and 
everything works well.

When I deploy test.py on another computer, I put (rsync) both test.py and 
cmn_funcs.py in the same remote directory.

If I create another python project (test2.py) in new directory, that needs 
common functions, what should I do with cmn_funcs.py?

Cmn_funcs.py should be in some shared directory accessible by my every current 
and future python project.

Furthermore, I would like to preserve simplicity of using rsync for upgrading 
these three python files on remote computers. 

How to deploy custom a custom common module?
Where to put it?
How to use it?
How to upgrade it?
-- 
https://mail.python.org/mailman/listinfo/python-list