Questions about the new plugin
First off, a big thank you for this release, it's a significant improvement
over the previous build. I've hit a couple of exceptions and have submitted
them, but generally it works well.
I have a few questions:
Is it possible to add a Python dependency between two modules? I currently
have quite a lot of Python (and Java) code in a module that many other modules
depend on. The Java dependencies obviously work fine, but Python code in
the other modules doesn't seem able to resolve references to the common/shared
module. I've tried exporting the "Python 2.5.2 interpreter library" from
the Dependencies tab of my common module's settings but that doesn't appear
to have any effect.
Not all standard libararies appear to be found when the Python SDK is parsed.
For example code that contains "import sys" complains with "unresolved reference
'sys'". Some others that also have the same problem include "time", "math",
"thread", "select" and more. Am I doing something stupid here?
Is it possible to include two Python facets in a single module? I realise
the answer's probably no, but we have quite a few logical modules that have
both Jython and Python intermingled and I'm wondering what the best approach
might be. Creating 40+ new modules or shuffling around our code isn't going
to be practical so maybe I just have to live with this one.
Many thanks,
Chris
Please sign in to leave a comment.
A followup to the first question - I have the module SDKs for my modules
set to Java 1.6 (because I have plenty of Java code in the modules too).
Is this why the Python dependencies can't be resolved? If so is that a bug
or a feature?
Hello Chris,
This is generally supposed to work, although I don't think we have specifically
tested this case. JIRA issue is welcome.
Please try deleting and recreating the Python SDK - it will likely fix the
problem.
Why do you need to include multiple facets? If the goal is running scripts
with different interpreters, you can specify an intepreter in the run configuration.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Hi Dmitry, thanks for the quick response. Comments inline...
>> First off, a big thank you for this release, it's a significant
>> improvement over the previous build. I've hit a couple of exceptions
>> and have submitted them, but generally it works well.
>>
>> I have a few questions:
>>
>> Is it possible to add a Python dependency between two modules? I
>> currently have quite a lot of Python (and Java) code in a module that
>> many other modules depend on. The Java dependencies obviously work
>> fine, but Python code in the other modules doesn't seem able to
>> resolve references to the common/shared module. I've tried exporting
>> the "Python 2.5.2 interpreter library" from the Dependencies tab of
>> my common module's settings but that doesn't appear to have any
>> effect.
>>
Which case, "Module SDK being set to a JDK", or "Python dependencies between
modules (regardless of module SDK setting)"? It's the latter than seems to
be the problem.
I've opened an issue for this: http://www.jetbrains.net/jira/browse/IDEA-23515
>> Not all standard libararies appear to be found when the Python SDK is
>> parsed. For example code that contains "import sys" complains with
>> "unresolved reference 'sys'". Some others that also have the same
>> problem include "time", "math", "thread", "select" and more. Am I
>> doing something stupid here?
>>
I tried that, and invalidated caches. Still the same problem (with the exact
same python modules). However what I have just noticed is that the imports
are resolved correctly if I change the module SDK to Python rather than Java.
Of course I'd like them to resolve even if the module SDK is a JDK.
I've opened another issue for this one: http://www.jetbrains.net/jira/browse/IDEA-23516
>> Is it possible to include two Python facets in a single module? I
>> realise the answer's probably no, but we have quite a few logical
>> modules that have both Jython and Python intermingled and I'm
>> wondering what the best approach might be. Creating 40+ new modules
>> or shuffling around our code isn't going to be practical so maybe I
>> just have to live with this one.
>>
I don't need to include multiple facets really. I was thinking about the
case where I'm editing one .py file that is intended to be run with Jython,
and editing another along side it (generally in a separate subdirectory but
same module) which is intended to be pure Python. I'm not running either
Jython or Python from the IDE. I haven't yet tried configuring anything on
the Jython side so aren't really even sure what, if any, problems I'll run
in to here. I figure the solution might be similar to the SQL stuff where
certain directories and/or files can be mapped to different RDBMSes.
Regards,
Chris