[IronPython] config files vs. env vars and site.py
jimhug at exchange.microsoft.com
Wed May 4 23:03:50 CEST 2005
Right now, IronPython-0.7.* isn't well designed for building Python applications to be deployed. It's primarily a tool for developer use. Part of fixing this is making configuration nicer; however, I'm not sure that config files will be the right final answer. Here's how I see people wanting to deploy IronPython code.
1. A single pre-compiled self-contained MyPythonApp.exe. We will be providing a static compiler to build this based on walking the graph of imported modules and including compiled forms of any other Python modules you want to pass to it explicitly. From the outside this will be indistinguishable from any other CLI program.
2. As a self-contained MyPythonLibrary.dll to include in C#/VB/F#/... applications. This similarly wants the static compiler that produces a nicely pre-compiled self-contained bundle.
3. As an embedded scripting language in a CLI application. In this case the application will be in control through PythonEngine. Here, I think that the application should take on the responsibility for configuration based on its own config mechanisms and can explicitly set sys.path and perform other configuration before running any scripts. We want to make this as easy as possible, possibly with some helper methods on PythonEngine; however, I think that it's pretty easy right now for an embedding application.
Unless you have a really compelling short-term need, I'd like to wait until we get the static compiler for cases 1 and 2 built and then see if there's still need for .config file support or not. I expect this will be available in a small number of months.
Thanks - Jim
From: users-ironpython.com-bounces at lists.ironpython.com [mailto:users-ironpython.com-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer
Sent: Tuesday, May 03, 2005 11:05 AM
To: Discussion of IronPython
Subject: RE: [IronPython] IronPython 0.7.4 released
.. So how would I do such configuration for non-command-line programs? Do I need to always front the executable with a bat file? Such a requirement presents a big wart for those not living in the command line, and I don't see any good reason to let it remain. I think this is a point where Python should hybridize to live well among its new neighbors.
May I request .config file support for a future release? Heck, I'd be happy to hack it in myself.
Good news on the testing progress!
From: users-ironpython.com-bounces at lists.ironpython.com on behalf of Martin Maly
Sent: Tue 5/3/2005 10:36 AM
* site.py, IRONPYTHONPATH and IRONPYTHONSTARTUP environment variables
(see below for more details)
variables into the global (per-machine or per-user) settings. Instead we
use simple scripts to configure environment of the command line for the
task at hand. Sdkvars.bat from the .NET SDK is an example.
More information about the Ironpython-users