Settings ExternalToolsSettings/en: Unterschied zwischen den Versionen

Aus expecco Wiki (Version 2.x)
Zur Navigation springen Zur Suche springen
K
 
(257 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
== External Tools Settings==
===== Python2 and Python3 Settings =====
Be aware that there exist two partially incompatible python versions (2.x and 3.x) and there exist packages
Expecco may use external programs to provide additional functionality. This dialog allows for the configuration of which executable is used in particular.
which are compatible with both and also packages which need a particular version.
Although Python2.x is about to be obsoleted now, there are still older packages/applications around,
which have not yet been ported to 3.x. Expecco deals with this situation by allowing you to specify which python interpreter to be used for your actions and also to have multiple interpreters (with different versions) running in parallel.


You can skip this section, iff all of your python modules run in Python3.x and only specify one single path/module setup in the top area of the settings dialog (named "Python")
=== Shell (Win32 only) ===


Due to some bad planning in the python community, there were a number of changes between python2.x and python3.x, which may (and usually do) make scripts written for either version incompatible with the other.
Specify the program which is used to execute shell scripts. Notice, that under the Windows operating system, a Unix bourne/korn-shell compatible shell has to be installed (for example as part of the cygwin package).
For example, the following print expression from python2:
print "Hello World from a Python2 script\n"
needs parentheses in python3:
print ("Hello World from a Python2 script\n")
and will lead to a syntax error if executed in python3.


Although it is a good idea to use Python3 (because Python2 is going to be obsolete soon), there are many open-existing libraries for Python2 around. Thus, it may be necessary to specify an explicit interpreter version to be used for python script actions.
This is only needed if your test suite includes script actions which are written in the Unix shell command language AND your test suites are required to run unchanged under both Windows and Unix operating systems.
If unspecified, the default shell (value of the "SHELL" environment variable, in the shell environment) is used.


If all of your actions depend on the same python interpreter version,
Therefore, in most cases, this setting is not required.
it is sufficient to ensure that either the "<code>PYTHON_SHELL</code>" variable is set correctly,
or the "Python Path" is defined in the settings to point to the correct interpreter.


However, if you have mixed version scripts (for example, when importing python actions written by another team, which used a different version), you have to specify the python interpreter explicitly for some of the actions.
=== Ruby Path ===


You can either specify the version in the elementary action itself (language menu for bridged actions or #PYTHON-comment in script actions) or provide the version information dynamically without touching the action itself. The later is a bit more complicated to use, but required if you do not want to modify imported actions.
Specify which ruby interpreter to use for Ruby Elementary blocks.
By default, the ruby command which is found along your PATH setting is used
(i.e. the same as found when executing "ruby" on the command line).
Of course, you have to have ruby installed on your machine.
If unspecified, the value of the "RUBY_SHELL" environment variable (in the shell environment) is used.


For this, expecco contains 3 setting fields for the python interpreter: "Python Cmd Path" in the settings or "<code>PYTHON_SHELL</code>" in the shell environment, which are used when no explicit version is required, or if all of your script require the same python version, "Python2 Cmd Path" in the settings (or "<code>PYTHON2_SHELL</code>"), which are used for scripts which have been marked as explicitly requiring python2 and "Python3 Cmd Path" in the settings (or "<code>PYTHON3_SHELL</code>") for scripts which are marked to require python3.
This setting is not needed if you do not use any Ruby Elementary blocks.


The python version requirements are defined in the environment of the suite/imported library in which the action is defined: a variable named "<code>PYTHON_VERSION</code>", which should be an integer with either "<code>2</code>" or "<code>3</code>" as value specifies the version to be used for ALL of the python actions within that library. Notice, that the environment of the project from which the action was imported is relevant here - not the active environment at execution time, or the suite's top environment. This version number then determines, which of the above setting is to be used (i.e. PYTHON2_SHELL/path or PYTHON3_SHELL/path).
=== Python Path ===


Using that double-indirect mechanism, it is still possible to:
Specify which python interpreter to use for Python Elementary blocks.
* import multiple libraries with different python-versions requirements
By default, the python command which is found along your PATH setting is used
* specify the paths independent of where the python interpreters are installed (i.e. the machine on which the final suite is executed may have different installation paths than the machine on which the imported libraries were developed).
(i.e. the same as found when executing "python" on the command line).
Of course, you have to have python installed on your machine.
If unspecified, the value of the "PYTHON_SHELL" environment variable (in the shell environment) is used.


A concrete demo importing libraries which require different python interpreter versions is found in "<code>d46_Suite_using_both_Python2_and_Python3_actions.ets</code>" in the demo folder.
This setting is not needed if you do not use any Python Elementary blocks.


Notice:<br>In expecco 19.2, you can also choose the python version in the code editor's language chooser.
=== Node.js Path ===

Specify which node.js interpreter to use for Node Elementary blocks.
By default, the node command which is found along your PATH setting is used
(i.e. the same as found when executing "node" on the command line).
Of course, you have to have ruby installed on your machine.

This setting is not needed if you do not use any Python Elementary blocks.

=== HTML Viewer ===
Specify the program which is used to display online help documents. By default (if left blank), the configured web-browser (typically: Firefox, Safari or Internet Explorer) is used. For security reasons, it is recommended to use Firefox or Safari as opposed to Internet Explorer.

=== PDF Viewer ===
Specify the program which is used to display generated report documents. By default, the configured PDF viewer (typically: acrobat reader) is used.


=== Wiki Folder ===
Should point to this Wiki (and obviously, it does already, otherwise you would probably not
read this document)

=== External Text Editor ===
Specify the program to edit text attachments. Useful Linux/Unix settings are "<CODE>xterm -e vi %1</CODE>" or "<code>xterm -e emacs %1</code>". By default, a built in text editor (FileBrowser) is used.

=== External CSV Editor ===
Specify the program to edit CSV attachments. A useful Linux/Unix setting is "<code>/opt/libreoffice/bin/office %1</code>" or another excel-alike calculator which can read and write CSV files. By default, a built in text editor (FileBrowser) is used.

[[Category:Settings]]

Aktuelle Version vom 6. Dezember 2023, 15:37 Uhr

Python2 and Python3 Settings[Bearbeiten]

Be aware that there exist two partially incompatible python versions (2.x and 3.x) and there exist packages which are compatible with both and also packages which need a particular version. Although Python2.x is about to be obsoleted now, there are still older packages/applications around, which have not yet been ported to 3.x. Expecco deals with this situation by allowing you to specify which python interpreter to be used for your actions and also to have multiple interpreters (with different versions) running in parallel.

You can skip this section, iff all of your python modules run in Python3.x and only specify one single path/module setup in the top area of the settings dialog (named "Python")

Due to some bad planning in the python community, there were a number of changes between python2.x and python3.x, which may (and usually do) make scripts written for either version incompatible with the other. For example, the following print expression from python2:

print "Hello World from a Python2 script\n"

needs parentheses in python3:

print ("Hello World from a Python2 script\n")

and will lead to a syntax error if executed in python3.

Although it is a good idea to use Python3 (because Python2 is going to be obsolete soon), there are many open-existing libraries for Python2 around. Thus, it may be necessary to specify an explicit interpreter version to be used for python script actions.

If all of your actions depend on the same python interpreter version, it is sufficient to ensure that either the "PYTHON_SHELL" variable is set correctly, or the "Python Path" is defined in the settings to point to the correct interpreter.

However, if you have mixed version scripts (for example, when importing python actions written by another team, which used a different version), you have to specify the python interpreter explicitly for some of the actions.

You can either specify the version in the elementary action itself (language menu for bridged actions or #PYTHON-comment in script actions) or provide the version information dynamically without touching the action itself. The later is a bit more complicated to use, but required if you do not want to modify imported actions.

For this, expecco contains 3 setting fields for the python interpreter: "Python Cmd Path" in the settings or "PYTHON_SHELL" in the shell environment, which are used when no explicit version is required, or if all of your script require the same python version, "Python2 Cmd Path" in the settings (or "PYTHON2_SHELL"), which are used for scripts which have been marked as explicitly requiring python2 and "Python3 Cmd Path" in the settings (or "PYTHON3_SHELL") for scripts which are marked to require python3.

The python version requirements are defined in the environment of the suite/imported library in which the action is defined: a variable named "PYTHON_VERSION", which should be an integer with either "2" or "3" as value specifies the version to be used for ALL of the python actions within that library. Notice, that the environment of the project from which the action was imported is relevant here - not the active environment at execution time, or the suite's top environment. This version number then determines, which of the above setting is to be used (i.e. PYTHON2_SHELL/path or PYTHON3_SHELL/path).

Using that double-indirect mechanism, it is still possible to:

  • import multiple libraries with different python-versions requirements
  • specify the paths independent of where the python interpreters are installed (i.e. the machine on which the final suite is executed may have different installation paths than the machine on which the imported libraries were developed).

A concrete demo importing libraries which require different python interpreter versions is found in "d46_Suite_using_both_Python2_and_Python3_actions.ets" in the demo folder.

Notice:
In expecco 19.2, you can also choose the python version in the code editor's language chooser.



Copyright © 2014-2024 eXept Software AG