Fix version worktree (#16431)

* git worktree friendly precomit install

* worktrees don't have a .git directory. Before, docker-compose would
  trigger pre-commit install and fail.

* make docker-compose work in git worktree

* AWX tries to discover the version via info stored in .git/ dir.
  setuptools-scm is capable of finding the .git/ dir, starting from a
  worktree, but is unable because only the worktree is mapped into the
  container, not the .git/ dir itself. Thus, we have to detect and pass
  the version into the container from outside. That is why this change
  landed in the Makefile.
This commit is contained in:
Chris Meyers
2026-04-28 16:07:14 -04:00
committed by GitHub
parent df771d0e9d
commit eac8968217
3 changed files with 18 additions and 8 deletions

View File

@@ -42,6 +42,7 @@ services:
DJANGO_SUPERUSER_PASSWORD: {{ admin_password }}
UWSGI_MOUNT_PATH: {{ ingress_path }}
DJANGO_COLORS: "${DJANGO_COLORS:-}"
SETUPTOOLS_SCM_PRETEND_VERSION: "${SETUPTOOLS_SCM_PRETEND_VERSION:-}"
{% if loop.index == 1 %}
RUN_MIGRATIONS: 1
{% endif %}