Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/config_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ The syntax we use in the following to describe the different configuration objec

.. |jq| replace:: :attr:`jq(1)`
.. _jq: https://stedolan.github.io/jq/manual/
.. |schemas/config.json| replace:: ``schemas/config.json``
.. _schemas/config.json: https://github.com/eth-cscs/reframe/blob/master/schemas/config.json
.. |schemas/config.json| replace:: ``reframe/schemas/config.json``
.. _schemas/config.json: https://github.com/eth-cscs/reframe/blob/master/reframe/schemas/config.json
.. |access| replace:: :attr:`access`
.. _access: #.systems[].partitions[].access
.. |basedir| replace:: :attr:`basedir`
Expand Down
4 changes: 4 additions & 0 deletions docs/manpage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,10 @@ Miscellaneous options

This option can also be set using the :envvar:`RFM_COLORIZE` environment variable or the :js:attr:`colorize` general configuration parameter.

.. option:: --upgrade-config-file=OLD[:NEW]

Convert the old-style configuration file ``OLD``, place it into the new file ``NEW`` and exit.
If a new file is not given, a file in the system temporary directory will be created.

.. option:: -v, --verbose

Expand Down
8 changes: 2 additions & 6 deletions docs/migration_2_to_3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,13 @@ As soon as it detects an old-style configuration file, it will convert it to the
./bin/reframe: the syntax of the configuration file 'unittests/resources/settings_old_syntax.py' is deprecated
./bin/reframe: configuration file has been converted to the new syntax here: '/var/folders/h7/k7cgrdl13r996m4dmsvjq7v80000gp/T/tmph5n8u3kf.py'

Alternatively, you can convert any old configuration file using the conversion tool |convert_config|_:

.. |convert_config| replace:: :obj:`convert-config`
.. _convert_config: https://github.com/eth-cscs/reframe/blob/master/tools/convert-config
Alternatively, you can convert any old configuration file using the command line option :option:`--upgrade-config-file`:

.. code-block:: none

$ ./tools/convert-config unittests/resources/settings_old_syntax.py new_config.py
$ ./bin/reframe --upgrade-config-file unittests/resources/settings_old_syntax.py:new_config.py
Conversion successful! The converted file can be found at 'new_config.py'.


Another important change is that default locations for looking up a configuration file has changed (see `Configuring ReFrame for Your Site <configure.html>`__ for more details).
That practically means that if you were relying on ReFrame loading your ``reframe/settings.py`` by default, this is no longer true.
You have to move it to any of the default settings locations or set the corresponding command line option or environment variable.
Expand Down
6 changes: 5 additions & 1 deletion docs/started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ ReFrame's latest stable version is available through different channels:

pip install reframe-hpc

.. note::

The above method performs a bare installation of ReFrame not including unittests and tutorial examples.


- As a `Spack <https://spack.io/>`__ package:

.. code:: bash
Expand All @@ -58,7 +63,6 @@ ReFrame's latest stable version is available through different channels:
eb easybuild/easyconfigs/r/ReFrame/ReFrame-VERSION.eb -r



-------------------------------
Getting the Latest and Greatest
-------------------------------
Expand Down
2 changes: 1 addition & 1 deletion reframe/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(self, site_config, filename):
self._sticky_options = {}

# Open and store the JSON schema for later validation
schema_filename = os.path.join(reframe.INSTALL_PREFIX,
schema_filename = os.path.join(reframe.INSTALL_PREFIX, 'reframe',
'schemas', 'config.json')
with open(schema_filename) as fp:
try:
Expand Down
22 changes: 22 additions & 0 deletions reframe/frontend/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,10 @@ def main():
'--system', action='store', help='Load configuration for SYSTEM',
envvar='RFM_SYSTEM'
)
misc_options.add_argument(
'--upgrade-config-file', action='store', metavar='OLD[:NEW]',
help='Upgrade old configuration file to new syntax'
)
misc_options.add_argument(
'-V', '--version', action='version', version=os_ext.reframe_version()
)
Expand Down Expand Up @@ -368,6 +372,24 @@ def main():
printer.colorize = site_config.get('general/0/colorize')
printer.inc_verbosity(site_config.get('general/0/verbose'))

if options.upgrade_config_file is not None:
old_config, *new_config = options.upgrade_config_file.split(
':', maxsplit=1)
new_config = new_config[0] if new_config else None

try:
new_config = config.convert_old_config(old_config, new_config)
except Exception as e:
printer.error(f'could not convert file: {e}')
sys.exit(1)

printer.info(
f'Conversion successful! '
f'The converted file can be found at {new_config!r}.'
)

sys.exit(0)

# Now configure ReFrame according to the user configuration file
try:
try:
Expand Down
File renamed without changes.
11 changes: 8 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/eth-cscs/reframe',
licence='BSD 3-Clause',
packages=setuptools.find_packages(exclude=['unittests']),
python_requires='>=3.5',
license='BSD 3-Clause',
packages=setuptools.find_namespace_packages(
include=['reframe', 'reframe.*']
),
package_data={'reframe': ['schemas/*']},
include_package_data=True,
install_requires=['jsonschema'],
python_requires='>=3.6',
scripts=['bin/reframe'],
classifiers=(
'Development Status :: 5 - Production/Stable',
Expand Down
1 change: 0 additions & 1 deletion tools/convert-config

This file was deleted.

43 changes: 0 additions & 43 deletions tools/convert_config.py

This file was deleted.