Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-21191

Improve release script interpolation syntax

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: QualifiedToSchedule
    • Component/s: Dev Tools

      Description

      The current syntax is powerful but not user-friendly:

      other_versions = %(nuxeo-snapshot)s/%(nuxeo-tag)s/%(nuxeo-next_snapshot)s,%(marketplace-dam-snapshot)s/%(marketplace-dam-tag)s/%(marketplace-dam-next_snapshot)s

      This is based on PEP 498 Literal String Interpolation:

      1) Allow line return:

      other_versions = %(nuxeo-snapshot)s/%(nuxeo-tag)s/%(nuxeo-next_snapshot)s,
                       %(marketplace-diff-snapshot)s/%(marketplace-diff-tag)s/%(marketplace-diff-next_snapshot)s,
                       %(marketplace-dam-snapshot)s/%(marketplace-dam-tag)s/%(marketplace-dam-next_snapshot)s

      or use a trick:

      other_versions.1 = %(nuxeo-snapshot)s/%(nuxeo-tag)s/%(nuxeo-next_snapshot)s
      other_versions.2 = %(marketplace-diff-snapshot)s/%(marketplace-diff-tag)s/%(marketplace-diff-next_snapshot)s
      other_versions.3 = %(marketplace-dam-snapshot)s/%(marketplace-dam-tag)s/%(marketplace-dam-next_snapshot)s

      2) Look if the syntax can be simplified as in Python 3.6:

      other_versions = {nuxeo-snapshot}/{nuxeo-tag}/{nuxeo-next_snapshot},
                       {marketplace-diff-snapshot}/{marketplace-diff-tag}/{marketplace-diff-next_snapshot},
                       {marketplace-dam-snapshot}/{marketplace-dam-tag}/{marketplace-dam-next_snapshot}

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jcarsique Julien Carsique
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: