Home Download Buy Blog Forum Support

variables not working in env for build systems

variables not working in env for build systems

Postby pyppo on Wed Aug 29, 2012 4:33 pm

Hello,

I am trying to create a custom build system for python and to set PYTHONPATH environment variable to the project path.

Currently my build system looks like this:
Code: Select all
{
   "cmd": ["python","${file}"],
   "env": {
      "PYTHONPATH":"${project_path}"
   }
}


The issue is that $project_path variable (nor any other variable) is expanded to its value when used in env element, while $file works perfectly in cmd.
At the same time $project_path works properly in cmd
Code: Select all
"cmd":["echo","$project_path"]


PYHONPATH is indeed set (checked with os.environ inside my python script) but with the string "$project_path".

Is it normal that variables are not taken into account in env element ?

I am using Sublime Text 2.0.1 build 2217 on Mac OS X Lion

Thanks
Bye

Filippo
pyppo
 
Posts: 1
Joined: Wed Aug 29, 2012 4:24 pm

Re: variables not working in env for build systems

Postby sweavo on Fri Nov 16, 2012 11:04 pm

Same problem here. I'm evaluating ST for maintaining a large python library and I need to set PYTHONPATH according to the project root (so that I can use multiple sandboxes). Hugely frustrating!

(BTW, how about using python classes for configuration rather than json? Then the whole language is available giving more flexibility :-) )
sweavo
 
Posts: 1
Joined: Fri Nov 16, 2012 11:01 pm

Re: variables not working in env for build systems

Postby eliquious on Tue Dec 04, 2012 11:58 pm

Bump.

I'm having the same problems trying to get my PYTHONPATH to mirror my system path.
eliquious
 
Posts: 6
Joined: Tue Dec 04, 2012 7:55 pm

Re: variables not working in env for build systems

Postby abogushov on Thu Dec 06, 2012 6:52 pm

Use this to solve problem:

Code: Select all
"working_dir": "$project_path",
"env": {"PYTHONPATH": "."}
abogushov
 
Posts: 1
Joined: Thu Dec 06, 2012 6:48 pm


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 25 guests