organizing many python scripts, in a large corporate environment.

B

bukzor

We've been doing a fair amount of Python scripting, and now we have a
directory with almost a hundred loosely related scripts. It's
obviously time to organize this, but there's a problem. These scripts
import freely from each other and although code reuse is generally a
good thing it makes it quite complicated to organize them into
directories.

There's a few things that you should know about our corporate
environment:

1) I don't have access to the users' environment. Editing the
PYTHONPATH is out, unless it happens in the script itself.
2) Users don't install things. Systems are expected to be *already*
installed and working, so setup.py is not a solution.

I'm quite willing to edit my import statements and do some minor
refactoring, but the solutions I see currently require me to divide
all the code strictly between "user runnable scripts" and "libraries",
which isn't feasible, considering the amount of code.

Has anyone out there solved a similar problem? Are you happy with it?
--Buck
 
J

Jean-Michel Pichavant

bukzor said:
We've been doing a fair amount of Python scripting, and now we have a
directory with almost a hundred loosely related scripts. It's
obviously time to organize this, but there's a problem. These scripts
import freely from each other and although code reuse is generally a
good thing it makes it quite complicated to organize them into
directories.

There's a few things that you should know about our corporate
environment:

1) I don't have access to the users' environment. Editing the
PYTHONPATH is out, unless it happens in the script itself.
2) Users don't install things. Systems are expected to be *already*
installed and working, so setup.py is not a solution.

I'm quite willing to edit my import statements and do some minor
refactoring, but the solutions I see currently require me to divide
all the code strictly between "user runnable scripts" and "libraries",
which isn't feasible, considering the amount of code.

Has anyone out there solved a similar problem? Are you happy with it?
--Buck
Short story:
- Too late ! haha

Long story:
- Windows: no clue
- Unix like:
* There was a time I didn't have root access to my machine. In
that case what most people do is create a ~/bin and ~/lib directory
where libraries and executable will be placed in. Works for everything
including python and most installers have a --prefix options to change
the installation root directory. I have a ~/lib/python2.5/site-packages
for instance where python package are installed, and I don't need root
access to install official packages.
* Ask your IT to install on every user python site a symbolic
link to a network directory where you'll install your package

I'm sopping here 'cause from your OP, I have the feeling it's a locked
Windows environment (troll free statement).

JM
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top