<commit_before>.. _integrator_update_application:

Update a c2cgeoportal application
---------------------------------

Update the application code
~~~~~~~~~~~~~~~~~~~~~~~~~~~

To get the changes done by other people, we need to ``pull`` the new code::

    git pull
    git submodule sync
    git submodule update --init
    git submodule foreach git submodule sync
    git submodule foreach git submodule update --init

.. note::
   The submodule command is used to have the right version of CGXP.

If you still use SVN::

    svn update

.. caution::
   This command will not update CGXP, and c2cgeoportal is not able to
   fix the revision of CGXP.

Update c2cgeoportal
~~~~~~~~~~~~~~~~~~~

.. note::

   if you do a minor update (e.g. ``1.3.0`` -> ``1.3.1``) you don't need to
   do the steps 2. to 4.

Upgrading an application to a new version of c2cgeoportal requires several
steps:

1. Make your application require the new version of the ``c2cgeoportal``
   package. To do so, simply edit the application's Buildout config
   (``buildout.cfg``) and change the version of ``c2cgeoportal`` in the
   ``[versions]`` section. Make sure the version specifications in ``setup.py``
   and ``buildout.cfg`` do not conflict.

.. note::

   If you do a minor update you should build the application to get the
   new ``c2cgeoportal`` egg by calling
   ``./buildout/bin/buildout -c <buildout_config_file>``.
   If you get a dependencies error have a look at the
   `changelog <https://github.com/camptocamp/c2cgeoportal/blob/master/c2cgeoportal/scaffolds/update/CONST_CHANGELOG.txt_tmpl>`_
   to see if there a note about it.

2. Now, if you want or need to update the application's other dependencies,
   edit the application's Buildout config (``buildout.cfg``), and remove all
   the lines from the ``[versions]`` section. Emptying the ``[versions]``
   section is necessary for getting new dependency versions using ``buildout
   -n`` (see the next step). Keep only the new version of c2cgeoportal to use::

       [versions]
       c2cgeoportal = <version to install>

.. note::

   If the ``CONST_buildout.cfg`` file does not already have::

       distribute = 0.6.22
       zc.buildout = 1.5.2

   in its ``[versions]`` section (c2cgeoportal < 1.3), add them to the
   ``[versions]`` section of the ``buildout.cfg`` file.

   If you upgrade from c2cgeoportal < 1.3.2, you should also keep/add::

       [versions]
       ...
       zc.recipe.egg = 1.3.2

3. Execute ``buildout`` with the ``-n`` flag to download and install new
   versions of dependencies (``c2cgeoportal`` included)::

       $ ./buildout/bin/buildout -n -c <buildout_config_file>

   At this point you can verify that the ``buildout/eggs`` directory
   includes the new version of the ``c2cgeoportal`` package.

4. Copy the dependency version lines (of the form ``Mako = 0.7.2``)
   from the ``buildout`` command output and paste them into the ``[versions]``
   part of ``buildout.cfg``. Then, apply the following corrections
   (to work around bugs in ``buildout.dumppickedversions``)::

    -Mako = x.y.z
    +mako = x.y.z
    -Markdown = x.y.z
    +markdown = x.y.z
    -SQLAHelper = x.y.z
    +sqlahelper = x.y.z
    -SQLAlchemy = x.y.z
    +sqlalchemy = x.y.z
    -Tempita = x.y.z
    +tempita = x.y.z

.. note::

    If you have ``tilecloud_chain`` installed, please make the
    following changes as well::

        -Jinja2 = x.y.z
        +jinja2 = x.y.z
        -Pillow = x.y.z
        +pillow = x.y.z

5. Apply the ``c2cgeoportal_update`` scaffold::

       $ ./buildout/bin/pcreate --interactive -s c2cgeoportal_update \
         ../<project_name> package=<package_name>

.. note::<commit_msg>Doc: fix version of Mako<commit_after>.. _integrator_update_application:

Update a c2cgeoportal application
---------------------------------

Update the application code
~~~~~~~~~~~~~~~~~~~~~~~~~~~

To get the changes done by other people, we need to ``pull`` the new code::

    git pull
    git submodule sync
    git submodule update --init
    git submodule foreach git submodule sync
    git submodule foreach git submodule update --init

.. note::
   The submodule command is used to have the right version of CGXP.

If you still use SVN::

    svn update

.. caution::
   This command will not update CGXP, and c2cgeoportal is not able to
   fix the revision of CGXP.

Update c2cgeoportal
~~~~~~~~~~~~~~~~~~~

.. note::

   if you do a minor update (e.g. ``1.3.0`` -> ``1.3.1``) you don't need to
   do the steps 2. to 4.

Upgrading an application to a new version of c2cgeoportal requires several
steps:

1. Make your application require the new version of the ``c2cgeoportal``
   package. To do so, simply edit the application's Buildout config
   (``buildout.cfg``) and change the version of ``c2cgeoportal`` in the
   ``[versions]`` section. Make sure the version specifications in ``setup.py``
   and ``buildout.cfg`` do not conflict.

.. note::

   If you do a minor update you should build the application to get the
   new ``c2cgeoportal`` egg by calling
   ``./buildout/bin/buildout -c <buildout_config_file>``.
   If you get a dependencies error have a look at the
   `changelog <https://github.com/camptocamp/c2cgeoportal/blob/master/c2cgeoportal/scaffolds/update/CONST_CHANGELOG.txt_tmpl>`_
   to see if there a note about it.

2. Now, if you want or need to update the application's other dependencies,
   edit the application's Buildout config (``buildout.cfg``), and remove all
   the lines from the ``[versions]`` section. Emptying the ``[versions]``
   section is necessary for getting new dependency versions using ``buildout
   -n`` (see the next step). Keep only the new version of c2cgeoportal to use::

       [versions]
       c2cgeoportal = <version to install>

.. note::

   If the ``CONST_buildout.cfg`` file does not already have::

       distribute = 0.6.22
       zc.buildout = 1.5.2

   in its ``[versions]`` section (c2cgeoportal < 1.3), add them to the
   ``[versions]`` section of the ``buildout.cfg`` file.

   If you upgrade from c2cgeoportal < 1.3.2, you should also keep/add::

       [versions]
       ...
       zc.recipe.egg = 1.3.2

3. Execute ``buildout`` with the ``-n`` flag to download and install new
   versions of dependencies (``c2cgeoportal`` included)::

       $ ./buildout/bin/buildout -n -c <buildout_config_file>

   At this point you can verify that the ``buildout/eggs`` directory
   includes the new version of the ``c2cgeoportal`` package.

4. Copy the dependency version lines (of the form ``Mako = 0.7.2``)
   from the ``buildout`` command output and paste them into the ``[versions]``
   part of ``buildout.cfg``. Then, apply the following corrections
   (to work around bugs in ``buildout.dumppickedversions``)::

     Mako = x.y.z
    +mako = x.y.z
    -Markdown = x.y.z
    +markdown = x.y.z
    -SQLAHelper = x.y.z
    +sqlahelper = x.y.z
    -SQLAlchemy = x.y.z
    +sqlalchemy = x.y.z
    -Tempita = x.y.z
    +tempita = x.y.z

.. note::

    Mako version has to be specified using both ``Mako`` and ``mako`` because
    of some bug in the version selection of this package.

.. note::

    If you have ``tilecloud_chain`` installed, please make the
    following changes as well::

        -Jinja2 = x.y.z
        +jinja2 = x.y.z
        -Pillow = x.y.z
        +pillow = x.y.z

5. Apply the ``c2cgeoportal_update`` scaffold::

       $ ./buildout/bin/pcreate --interactive -s c2cgeoportal_update \
         ../<project_name> package=<package_name>

.. note::
{'fraction_non_alphanumeric': 0.12864174537714515, 'fraction_numerical': 0.013303179459890914, 'mean_word_length': 2.887280248190279, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 17, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '655319', 'n_tokens_mistral': 2493, 'n_tokens_neox': 2394, 'n_words': 900}