From 66482d0761aa98b4ed47dc36cb524f0301f2cb35 Mon Sep 17 00:00:00 2001 From: Stanislav Zhuk Date: Mon, 10 Nov 2025 19:15:41 +0200 Subject: [PATCH 1/3] chore(*): run update-checker.sh --- .gitattributes | 4 ++++ .github/PULL_REQUEST_TEMPLATE.md | 9 +++++++-- .github/workflows/tests.yml | 6 +++++- README.md | 11 ++--------- install.yaml | 8 +------- tests/test.bats | 14 ++++++++++---- 6 files changed, 29 insertions(+), 23 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..70215be --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +# Exclude files from releases/tarballs +tests/ export-ignore +.github/ export-ignore +.gitattributes export-ignore diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 5d88d2a..1c103b8 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,16 +1,21 @@ ## The Issue -- # +- Fixes #REPLACE_ME_WITH_RELATED_ISSUE_NUMBER ## How This PR Solves The Issue + + ## Manual Testing Instructions + + ```bash -ddev add-on get https://github.com///tarball/ +ddev add-on get https://github.com/stasadev/ddev-python2/tarball/refs/pull/REPLACE_ME_WITH_THIS_PR_NUMBER/head ddev restart +ddev exec python -V ``` ## Automated Testing Overview diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 67a5936..ffdc8a4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,11 +1,15 @@ name: tests on: pull_request: + paths-ignore: + - "**.md" push: branches: [ main ] + paths-ignore: + - "**.md" schedule: - - cron: '25 08 * * *' + - cron: '25 08 * * *' workflow_dispatch: inputs: diff --git a/README.md b/README.md index b75d04d..85718dc 100644 --- a/README.md +++ b/README.md @@ -15,19 +15,12 @@ It is only needed if your `npm` setup requires Python 2 to build dependencies. ## Installation -For DDEV v1.23.5 or above run: - ```bash ddev add-on get stasadev/ddev-python2 ddev restart ``` -For earlier versions of DDEV run: - -```bash -ddev get stasadev/ddev-python2 -ddev restart -``` +After installation, make sure to commit the `.ddev` directory to version control. ## Usage @@ -36,7 +29,7 @@ After installation, you can run Python 2: - `python2.7` (installed at `/usr/bin/python2.7`) - `python` (symlink to `python2.7` installed at `/usr/local/bin/python`) -This add-on also adds packages that are normally required for `npm` build, see [config.python2.yaml](./config.python2.yaml). Remove or replace the contents of this file if you only need Python 2. +This add-on also installs `build-essential`, which is normally required for `npm` build, see [config.python2.yaml](./config.python2.yaml). Remove or replace the contents of this file if you only need Python 2. ## Credits diff --git a/install.yaml b/install.yaml index 1557dd2..cb601d3 100644 --- a/install.yaml +++ b/install.yaml @@ -1,13 +1,7 @@ name: python2 -# list of files and directories listed that are copied into project .ddev directory project_files: - config.python2.yaml - web-build/Dockerfile.python2 -pre_install_actions: - # Ensure we're on DDEV 1.23+ which uses Debian 12+ with Python3, - # Python2 is available by default in previous versions of Debian. - - | - #ddev-description:Checking DDEV version - (ddev debug capabilities | grep corepack >/dev/null) || (echo "This addon should only be installed in DDEV v1.23+ since you already have Python2 in yours $(ddev --version)" && false) +ddev_version_constraint: '>= v1.23.5' diff --git a/tests/test.bats b/tests/test.bats index 7b7d09e..7fa175d 100644 --- a/tests/test.bats +++ b/tests/test.bats @@ -26,8 +26,8 @@ setup() { export DIR="$(cd "$(dirname "${BATS_TEST_FILENAME}")/.." >/dev/null 2>&1 && pwd)" export PROJNAME="test-$(basename "${GITHUB_REPO}")" - mkdir -p ~/tmp - export TESTDIR=$(mktemp -d ~/tmp/${PROJNAME}.XXXXXX) + mkdir -p "${HOME}/tmp" + export TESTDIR="$(mktemp -d "${HOME}/tmp/${PROJNAME}.XXXXXX")" export DDEV_NONINTERACTIVE=true export DDEV_NO_INSTRUMENTATION=true ddev delete -Oy "${PROJNAME}" >/dev/null 2>&1 || true @@ -50,8 +50,14 @@ health_checks() { teardown() { set -eu -o pipefail - ddev delete -Oy ${PROJNAME} >/dev/null 2>&1 - [ "${TESTDIR}" != "" ] && rm -rf ${TESTDIR} + ddev delete -Oy "${PROJNAME}" >/dev/null 2>&1 + # Persist TESTDIR if running inside GitHub Actions. Useful for uploading test result artifacts + # See example at https://github.com/ddev/github-action-add-on-test#preserving-artifacts + if [ -n "${GITHUB_ENV:-}" ]; then + [ -e "${GITHUB_ENV:-}" ] && echo "TESTDIR=${HOME}/tmp/${PROJNAME}" >> "${GITHUB_ENV}" + else + [ "${TESTDIR}" != "" ] && rm -rf "${TESTDIR}" + fi } @test "install from directory" { From d653781d82f97193abcab0bf6d2cb70bd0b40b59 Mon Sep 17 00:00:00 2001 From: Stanislav Zhuk Date: Mon, 10 Nov 2025 19:29:53 +0200 Subject: [PATCH 2/3] update readme --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 85718dc..7682866 100644 --- a/README.md +++ b/README.md @@ -24,10 +24,10 @@ After installation, make sure to commit the `.ddev` directory to version control ## Usage -After installation, you can run Python 2: - -- `python2.7` (installed at `/usr/bin/python2.7`) -- `python` (symlink to `python2.7` installed at `/usr/local/bin/python`) +| Command | Description | +| ------- | ----------- | +| `ddev exec python2.7` | Run Python 2.7.18 inside the `web` container
Installed at `/usr/bin/python2.7` | +| `ddev exec python` | Run Python 2.7.18 inside the `web` container
Symlink to `/usr/bin/python2.7` installed at `/usr/local/bin/python` | This add-on also installs `build-essential`, which is normally required for `npm` build, see [config.python2.yaml](./config.python2.yaml). Remove or replace the contents of this file if you only need Python 2. From 57ac2227c34af9c78950774c176ca9c8c65bd3c5 Mon Sep 17 00:00:00 2001 From: Stanislav Zhuk Date: Mon, 10 Nov 2025 19:32:03 +0200 Subject: [PATCH 3/3] formatting --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7682866..306c238 100644 --- a/README.md +++ b/README.md @@ -26,10 +26,10 @@ After installation, make sure to commit the `.ddev` directory to version control | Command | Description | | ------- | ----------- | -| `ddev exec python2.7` | Run Python 2.7.18 inside the `web` container
Installed at `/usr/bin/python2.7` | -| `ddev exec python` | Run Python 2.7.18 inside the `web` container
Symlink to `/usr/bin/python2.7` installed at `/usr/local/bin/python` | +| `ddev exec python2.7` | Run Python 2.7.18 inside the `web` container.
Installed at `/usr/bin/python2.7` | +| `ddev exec python` | Run Python 2.7.18 inside the `web` container.
Symlink at `/usr/local/bin/python` | -This add-on also installs `build-essential`, which is normally required for `npm` build, see [config.python2.yaml](./config.python2.yaml). Remove or replace the contents of this file if you only need Python 2. +This add-on also installs the `build-essential` package, which is usually required for the `npm build`, see [config.python2.yaml](./config.python2.yaml). Remove or replace the contents of this file if you only need Python 2. ## Credits