File: garden.yaml

package info (click to toggle)
git-cola 4.17.1-1
  • links: PTS
  • area: main
  • in suites: sid
  • size: 6,928 kB
  • sloc: python: 38,426; sh: 298; makefile: 223; xml: 115; tcl: 62
file content (420 lines) | stat: -rw-r--r-- 17,029 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
# Use "cargo install garden-tools" to install garden https://gitlab.com/garden-rs/garden
#
#   # Installation
#   garden install              # Install git-cola to the installation ${prefix}
#   garden doc                  # Generate documentation: html + manual pages
#   garden install docs         # Install documentation
#
#   # Variables can be overridden using "-D name=value", e.g.:
#   garden -D prefix=$PWD/dist install docs
#   garden -D DESTDIR=/tmp/stage -D prefix=/usr/local install
#
#   # Development
#   garden test                 # Run the test suite
#   garden fmt                  # Format code using "cercis"
#   garden html                 # Generate documentation: html only
#   garden man                  # Generate documentation: manual pages only
#   garden pot                  # Regenerate git-cola.pot with new translations
#   garden po                   # Update .po files with new translations from git-cola.pot
#   garden pages                # Install docs into the pages/ website sources.
#   garden build pages          # Generate the pages/ website from the html templates.
#
#   # macOS
#   garden macos/app            # Build a git-cola.app bundle
#
#   # Related Projects
#   garden grow pages           # Clone the Git Cola homepage
#   garden grow fedora          # Clone the Fedora packaging
#   garden grow deb             # Clone the Debian packaging
#   garden grow flatpak         # Clone the Flatpak packaging
trees:
  git-cola:
    description: The highly-caffeinated Git GUI
    path: "${GARDEN_CONFIG_DIR}"
    commands:
      clean: rm -rf build dist git_cola.egg-info git-cola-*.windows.zip
      dev>:
        - dev/virtualenv
        - dev/pkgs
      dev/virtualenv: |
        test -e ${env-dir} || ${PYTHON} -m venv --system-site-packages ${env-dir}
        if test -n "${pip-upgrade}"
        then
            ${activate}
            pip install --upgrade pip
            pip install --upgrade setuptools packaging
        fi
      dev/pkgs>:
        - dev/development
        - dev/extras
        - dev/build
      dev/build: ${activate} pip install '.[build]'
      dev/development: ${activate} pip install '.[docs,dev,testing]'
      dev/extras: ${activate} pip install '.[extras]'
      dev/pyqt6: ${activate} pip install '.[pyqt6]'
      dev/env: ${activate} "$@"
      doc>:
        - doc/html
        - doc/man
      doc/html: garden html ${GARDEN_CMD_VERBOSE} docs -- "$@"
      doc/man: garden man ${GARDEN_CMD_VERBOSE} docs -- "$@"
      check>:
        - test
        - check/fmt
        - check/pyupgrade
      check/fmt: garden fmt -- --check
      check/pyupgrade: |
        ${activate}
        if type pyupgrade >/dev/null 2>&1
        then
            pyupgrade --py36-plus bin/git-* bin/*.py cola/*.py cola/*/*.py
        fi
      fmt: |
        ${activate}
        cercis --version
        cercis "$@" bin bin/git-* cola test extras/sphinxtogithub
      html: garden html ${GARDEN_CMD_VERBOSE} docs
      install: |
        ${activate}
        if test -n "${DESTDIR}"
        then
            pip_root="--root=${DESTDIR}"
        fi
        pip install --disable-pip-version-check $pip_root --prefix="${prefix}" .
        # "garden install" provides the '?' hotkeys html files.
        # Sphinx docs are handled by the separate "html", "man" and "install" commands in the "docs" tree.
        mkdir -p "${DESTDIR}${appsdir}"
        mkdir -p "${DESTDIR}${docdir}"
        mkdir -p "${DESTDIR}${iconsdir}"
        mkdir -p "${DESTDIR}${metainfodir}"
        install -m 664 cola/data/*.html "${DESTDIR}${docdir}"
        install -m 664 cola/icons/git-cola.svg "${DESTDIR}${iconsdir}"
        install -m 644 share/applications/*.desktop "${DESTDIR}${appsdir}"
        install -m 664 share/metainfo/*.xml "${DESTDIR}${metainfodir}"
      i18n>:
        - pot
        - po
      macos/app: |
        mkdir -p ${cola-app}/Contents/MacOS
        mkdir -p ${cola-app-resources}
        ${PYTHON} -m venv ${cola-app-resources}
        source ${cola-app-resources}/bin/activate
        pip install '.[docs,extras,pyqt6]'
        cp contrib/darwin/Info.plist contrib/darwin/PkgInfo ${cola-app}/Contents
        if test -n "${version-full}"
        then
            sed -i -e s/0.0.0.0/${version-full}/ ${cola-app}/Contents/Info.plist
        fi
        sed -i -e s/0.0.0/${version-digits}/ ${cola-app}/Contents/Info.plist
        cp contrib/darwin/git-cola ${cola-app}/Contents/MacOS
        cp contrib/darwin/git-cola.icns ${cola-app}/Contents/Resources
        # A stub binary makes macOS launch Python natively instead of via Rosetta.
        # https://github.com/git-cola/git-cola/issues/1485
        echo 'int main() { return 0; }' |
          cc -x c -o ${cola-app}/Contents/MacOS/git-cola-macos -
        garden install ${GARDEN_CMD_VERBOSE} -D prefix=${cola-app-resources}
        garden doc ${GARDEN_CMD_VERBOSE}
        garden install ${GARDEN_CMD_VERBOSE} -D prefix=${cola-app-resources} docs
      man: garden man ${GARDEN_CMD_VERBOSE} docs
      pkg: git make-pkg --global --name git-cola
      pynsist: |
        ${activate}
        rm -fr build/nsis
        garden html ${GARDEN_CMD_VERBOSE} docs
        garden install ${GARDEN_CMD_VERBOSE} -D htmldir="${TREE_PATH}/docs/html" docs
        pynsist "$@" pynsist.cfg
        rm -rf docs/html
      po: |
        for po in cola/i18n/*.po
        do
            msgmerge \
                --no-wrap \
                --no-fuzzy-matching \
                --output-file $$po.new \
                $$po \
                cola/i18n/git-cola.pot
            mv $$po.new $$po
        done
      pot: |
        xgettext \
            --language=Python \
            --keyword=N_ \
            --no-wrap \
            --omit-header \
            --output-dir cola/i18n \
            --output git-cola.pot \
            cola/*.py \
            cola/*/*.py
      pages<: doc
      pages: garden install ${GARDEN_CMD_VERBOSE} -D prefix=${TREE_PATH}/pages docs "$@"
      publish: ${activate} twine upload dist/*.whl dist/*.tar.gz
      release: ${activate} ./todo/release --all
      run: ${activate} ./bin/git-cola "$@"
      run/qt6: ${activate} QT_API=PyQt6 ./bin/git-cola "$@"
      test: ${activate} ${PYTEST} "$@" cola test
      tox: tox run "$@"
      tox/check: tox run -e check "$@"
      version/bump: ./todo/set-version "${version-next}"
      version/commit: git commit --all --signoff --message "git-cola v${version-digits}"
      version/tag: git tag --sign --message "git-cola ${version-builtin}" "v${version-builtin}"
      wheel: ${activate} python3 -m build -n .
    url: "${gl-https}/git-cola/git-cola.git"
    remotes:
      abid1998: "${gh-https}/abid1998/git-cola.git"
      achernet: "${gh-https}/achernet/git-cola.git"
      arnaudh: "${gh-https}/arnaudh/git-cola.git"
      axel-h: "${gh-https}/axel-h/git-cola.git"
      BaumiCoder: "${gh-https}/BaumiCoder/git-cola.git"
      bearsh: "${gh-https}/bearsh/git-cola.git"
      bensmrs: "${gh-https}/bensmrs/git-cola.git"
      bobvanderlinden: "${gh-https}/bobvanderlinden/git-cola.git"
      brccabral: "${gh-https}/brccabral/git-cola.git"
      brlin-tw: "${gh-https}/brlin-tw/git-cola.git"
      DasaniT: "${gh-https}/DasaniT/git-cola.git"
      davvid: "${gh-ssh}:davvid/git-cola.git"
      dschwoerer: "${gh-https}/dschwoerer/git-cola.git"
      florisla: "${gh-https}/florisla/git-cola.git"
      fu7mu4: "${gh-https}/fu7mu4/git-cola.git"
      gdebure: "${gh-https}/gdebure/git-cola.git"
      github: "${gh-ssh}:git-cola/git-cola.git"
      guoyunhe: "${gh-https}/guoyunhe/git-cola.git"
      gyuris: "${gh-https}/gyuris/git-cola.git"
      haffmans: "${gh-https}/haffmans/git-cola.git"
      harmathy: "${gh-https}/harmathy/git-cola.git"
      hsoft: "${gh-https}/hsoft/git-cola.git"
      jamie-pate: "${gh-https}/jamie-pate/git-cola.git"
      jm4R: "${gh-https}/jm4R/git-cola.git"
      kenyuy: "${gh-https}/kenyuy/git-cola.git"
      kisaragi-hiu: "${gh-https}/kisaragi-hiu/git-cola.git"
      kneirinck: "${gh-https}/kneirinck/git-cola.git"
      kt-devoss: "${gh-https}/kt-devoss/_oss_contrib_git-cola.git"
      kurtmckee: "${gh-https}/kurtmckee/git-cola.git"
      laerreal: "${gh-https}/laerreal/git-cola.git"
      lah7: "${gh-https}/lah7/git-cola.git"
      lefairy: "${gh-https}/lefairy/git-cola.git"
      living180: "${gh-https}/living180/git-cola.git"
      ljhcage: "${gh-https}/ljhcage/git-cola.git"
      Mailaender: "${gh-https}/Mailaender/git-cola.git"
      malpas: "${gh-https}/malpas/git-cola.git"
      melkecelioglu: "${gh-https}/melkecelioglu/git-cola.git"
      milestone12: "${gh-https}/milestone12/git-cola.git"
      Mithil467: "${gh-https}/Mithil467/git-cola.git"
      mmargoliono: "${gh-https}/mmargoliono/git-cola"
      mp-chet: "${gh-https}/mp-chet/git-cola.git"
      nandalopes: "${gh-https}/nandalopes/git-cola.git"
      NielBuys: "${gh-https}/NielBuys/git-cola.git"
      Nizhal: "${gh-https}/Nizhal/git-cola.git"
      OriShalhon: "${gh-https}/OriShalhon/git-cola.git"
      pilarmolinalopez: "${gh-https}/pilarmolinalopez/git-cola.git"
      PushKK: "${gh-https}/PushKK/git-cola.git"
      quintusfelix: "${gh-https}/quintusfelix/git-cola.git"
      rafaelreuber: "${gh-https}/rafaelreuber/git-cola.git"
      scop: "${gh-https}/scop/git-cola.git"
      sergei-dyshel: "${gh-https}/sergei-dyshel/git-cola.git"
      skunkwerks: "${gh-https}/skunkwerks/git-cola.git"
      sthalik: "${gh-https}/sthalik/git-cola.git"
      takluyver: "${gh-https}/takluyver/git-cola.git"
      thk123: "${gh-https}/thk123/git-cola.git"
      timgates42: "${gh-https}/timgates42/git-cola.git"
      vdragon: "${gh-https}/Vdragon/git-cola.git"
      victorhck: "${gh-https}/victorhck/git-cola.git"
      virtualstaticvoid: "${gh-https}/virtualstaticvoid/git-cola.git"
      VishnuSanal: "${gh-https}/VishnuSanal/git-cola.git"
      wm4: "${gh-https}/wm4/git-cola.git"
      WNguyen14: "${gh-https}/WNguyen14/git-cola.git"
      wojnilowicz: "${gh-https}/wojnilowicz/git-cola.git"
      yaellevy: "${gh-https}/yaellevy/git-cola.git"
      yakushabb: "${gh-https}/yakushabb/git-cola.git"
    gitconfig:
      remote.origin.pushurl:
        - "${gl-ssh}:git-cola/git-cola.git"
      remote.publish.pushurl:
        - "${gh-ssh}:git-cola/git-cola.git"
        - "${gl-ssh}:git-cola/git-cola.git"
  deb:
    description: Debian packaging
    url: "${gl-https}/git-cola/git-cola-debian.git"
    remotes:
      davvid: "${gh-ssh}:davvid/git-cola-debian.git"
    gitconfig:
      remote.origin.pushurl:
        - "${gl-ssh}:git-cola/git-cola-debian.git"
  docs:
    description: Sphinx documentation
    variables:
      env-dir: ../env3
    commands:
      clean: rm -fr _build
      doctest: ${activate} ${SPHINX} -b doctest . _build/doctest "$@"
      html: ${activate} ${SPHINX} -b html . _build/html "$@"
      man: ${activate} ${SPHINX} -b man . _build/man "$@"
      linkcheck: ${activate} ${SPHINX} -b linkcheck . _build/linkcheck "$@"
      install<:
        - html
        - man
      install: |
        ${activate}
        mkdir -p "${DESTDIR}${docdir}"
        install -m 644 ../cola/data/*.html "${DESTDIR}${docdir}"
        install -m 644 *.rst "${DESTDIR}${docdir}"
        # HTML documentation
        mkdir -p "${DESTDIR}${htmldir}"
        rsync -r --delete --exclude=.buildinfo _build/html/ "${DESTDIR}${htmldir}/"
        # Manual pages
        mkdir -p "${DESTDIR}${mandir}"
        install -m 644 _build/man/git-cola.1 "${DESTDIR}${mandir}"
        install -m 644 _build/man/git-dag.1 "${DESTDIR}${mandir}"
  fedora:
    description: Fedora packaging
    url: "https://src.fedoraproject.org/rpms/git-cola.git"
    remotes:
      davvid: "${gh-https}/davvid/git-cola-fedora.git"
      git-cola: "${gl-https}/git-cola/git-cola-fedora.git"
    gitconfig:
      remote.davvid.pushurl:
        - "${gh-ssh}:davvid/git-cola-fedora.git"
      remote.git-cola.pushurl:
        - "${gl-ssh}:git-cola/git-cola-fedora.git"
      remote.publish.pushurl:
        - "${gh-ssh}:davvid/git-cola-fedora.git"
        - "${gl-ssh}:git-cola/git-cola-fedora.git"
  flatpak:
    description: Flatpak packaging
    variables:
      app-id: com.github.git_cola.git-cola
    commands:
      build: flatpak-builder "$@" --user "${prefix}" "${app-id}.yml"
      check: |
        flatpak run --command=flatpak-builder-lint \
            org.flatpak.Builder "$@" --exceptions builddir "${prefix}"
      install: flatpak-builder "$@" --install --user "${prefix}" "${app-id}.yml"
      run: flatpak run ${app-id}
      setup: |
        flatpak remote-add --user --if-not-exists \
        flathub https://flathub.org/repo/flathub.flatpakrepo
        flatpak install --user \
        org.flatpak.Builder/x86_64 \
        org.kde.Sdk/x86_64/6.9 \
        org.kde.Platform/x86_64/6.9 \
        com.riverbankcomputing.PyQt.BaseApp/x86_64/6.9
    url: "${gh-https}/flathub/com.github.git_cola.git-cola.git"
    remotes:
      Erick555: "${gh-https}/Erick555/com.github.git_cola.git-cola.git"
      Mailaender: "${gh-https}/Mailaender/com.github.git_cola.git-cola.git"
      PunkPangolin: "${gh-https}/PunkPangolin/com.github.git_cola.git-cola.git"
    gitconfig:
      remote.origin.pushurl:
        - "${gh-ssh}:flathub/com.github.git_cola.git-cola.git"
  pages:
    description: "Git Cola's homepage"
    url: "${gl-https}/git-cola/git-cola.gitlab.io.git"
    remotes:
      github: "${gh-https}/git-cola/git-cola.github.io.git"
      ls-jad-elkik: "${gh-https}/ls-jad-elkik/git-cola.github.io.git"
      lz-coder: "${gh-https}/lz-coder/git-cola.github.io.git"
    gitconfig:
      remote.origin.pushurl:
        - "${gl-ssh}:git-cola/git-cola.gitlab.io.git"
        - "${gh-ssh}:git-cola/git-cola.github.io.git"
    variables:
      prefix: build
      container-image: "jekyll/minimal:latest"
    commands:
      build: jekyll build --destination "${prefix}" "$@"
      watch: |
        while true
        do
          garden build ${GARDEN_CMD_VERBOSE} "$@"
          inotifywait --event=close_write --recursive "${TREE_PATH}"
        done
      build/podman: |
        uid=$${UID:-$(id -u)}
        gid=$${GID:-$(id -g)}
        podman \
          run \
          --interactive \
          --rm \
          --user="$uid:$gid" \
          --userns keep-id:uid=$uid,gid=$gid \
          --volume="${TREE_PATH}:/srv/jekyll" \
          --workdir "${TREE_PATH}" \
          "${container-image}" \
          jekyll build --destination "${prefix}" "$@"
      sanitize: dos2unix share/doc/git-cola/*.html share/doc/git-cola/html/*.html
      setup: sudo apt install inotify-tools jekyll
      publish: |
        git add -u
        git add share
        git commit --signoff --message "git-cola v${version-builtin}"
        git push
    links:
      - "https://git-cola.gitlab.io"
      - "https://git-cola.github.io"
  todo:
    description: Maintainer scripts and notes
    worktree: git-cola
    branch: todo

commands:
  commit: git commit "$@"
  diff: git diff "$@"
  diffs: git diff --staged "$@"
  fetch: git fetch "$@"
  stat: git status --short "$@"
  status: git status "$@"
  stage: git add -u "$@"
  push: git push "$@"
  pull: git pull --ff-only "$@"

# Variables can be overridden externally using "garden -D name=value ...".
variables:
  # DESTDIR + prefix variables: https://www.gnu.org/software/make/manual/html_node/DESTDIR.html
  DESTDIR: ""
  prefix: ${GARDEN_CONFIG_DIR}/dist
  appsdir: ${datadir}/applications
  datadir: ${prefix}/share
  docdir: ${prefix}/share/doc/git-cola
  htmldir: ${docdir}/html
  iconsdir: ${datadir}/icons/hicolor/scalable/apps
  mandir: ${prefix}/share/man/man1
  metainfodir: ${datadir}/metainfo
  cola-app: ${TREE_PATH}/git-cola.app
  cola-app-resources: ${cola_app}/Contents/Resources
  is-virtualenv: |
    $ ${PYTHON} -c '
    import os, sys
    if sys.prefix != sys.base_prefix or os.environ.get("VIRTUAL_ENV"):
        print("true")
    '
  env-dir: env3
  activate: |
    if test -z "${is-virtualenv}" && test -f "${env-dir}/bin/activate"
    then
        source "${env-dir}/bin/activate"
    fi
  pip-editable: "--editable"
  pip-upgrade: ""
  version-digits: |
    $ eval "$(sed -e 's/ //g' "${GARDEN_CONFIG_DIR}/cola/_version.py")"
    printf '%s' "$VERSION"
  version-builtin: $ ${GARDEN_CONFIG_DIR}/bin/git-cola version --brief --builtin
  version-full: $ ${GARDEN_CONFIG_DIR}/bin/git-cola version --brief
  version-git: $ git -C "${GARDEN_CONFIG_DIR}" describe --first-parent --abbrev=0
  version-next: |
    $ ${PYTHON} -c "
    import sys
    version = sys.argv[1]
    parts = version.split('.')
    parts[1] = f'{int(parts[1]) + 1}'
    parts[2] = '0'
    print('.'.join(parts))
    " "${version-git}"
  gh-https: "https://github.com"
  gh-ssh: "git@github.com"
  gl-https: "https://gitlab.com"
  gl-ssh: "git@gitlab.com"
  # External commands and options
  PYTEST: ${PYTHON} -B -m pytest ${PYTEST-OPTIONS}
  PYTEST-OPTIONS: $ test "$(uname -s)" != Linux && printf '%s' --ignore=cola/inotify.py
  PYTHON: python3
  SPHINX: ${PYTHON} -m sphinx -d _build/doctrees -a