Skip to content

Commit fad3e84

Browse files
authored
chore(*): run update-checker.sh (#11)
1 parent 723fc15 commit fad3e84

File tree

6 files changed

+33
-27
lines changed

6 files changed

+33
-27
lines changed

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Exclude files from releases/tarballs
2+
tests/ export-ignore
3+
.github/ export-ignore
4+
.gitattributes export-ignore

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
## The Issue
22

3-
- #<issue number>
3+
- Fixes #REPLACE_ME_WITH_RELATED_ISSUE_NUMBER
44

55
<!-- Provide a brief description of the issue. -->
66

77
## How This PR Solves The Issue
88

9+
<!-- Describe the key change(s) in this PR that address the issue above. -->
10+
911
## Manual Testing Instructions
1012

13+
<!-- If this PR changes logic, consider adding additional steps or context to the instructions below. -->
14+
1115
```bash
12-
ddev add-on get https://github.com/<user>/<repo>/tarball/<branch>
16+
ddev add-on get https://github.com/stasadev/ddev-python2/tarball/refs/pull/REPLACE_ME_WITH_THIS_PR_NUMBER/head
1317
ddev restart
18+
ddev exec python -V
1419
```
1520

1621
## Automated Testing Overview

.github/workflows/tests.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
name: tests
22
on:
33
pull_request:
4+
paths-ignore:
5+
- "**.md"
46
push:
57
branches: [ main ]
8+
paths-ignore:
9+
- "**.md"
610

711
schedule:
8-
- cron: '25 08 * * *'
12+
- cron: '25 08 * * *'
913

1014
workflow_dispatch:
1115
inputs:

README.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,21 @@ It is only needed if your `npm` setup requires Python 2 to build dependencies.
1515

1616
## Installation
1717

18-
For DDEV v1.23.5 or above run:
19-
2018
```bash
2119
ddev add-on get stasadev/ddev-python2
2220
ddev restart
2321
```
2422

25-
For earlier versions of DDEV run:
26-
27-
```bash
28-
ddev get stasadev/ddev-python2
29-
ddev restart
30-
```
23+
After installation, make sure to commit the `.ddev` directory to version control.
3124

3225
## Usage
3326

34-
After installation, you can run Python 2:
35-
36-
- `python2.7` (installed at `/usr/bin/python2.7`)
37-
- `python` (symlink to `python2.7` installed at `/usr/local/bin/python`)
27+
| Command | Description |
28+
| ------- | ----------- |
29+
| `ddev exec python2.7` | Run Python 2.7.18 inside the `web` container.<br>Installed at `/usr/bin/python2.7` |
30+
| `ddev exec python` | Run Python 2.7.18 inside the `web` container.<br>Symlink at `/usr/local/bin/python` |
3831

39-
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.
32+
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.
4033

4134
## Credits
4235

install.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
name: python2
22

3-
# list of files and directories listed that are copied into project .ddev directory
43
project_files:
54
- config.python2.yaml
65
- web-build/Dockerfile.python2
76

8-
pre_install_actions:
9-
# Ensure we're on DDEV 1.23+ which uses Debian 12+ with Python3,
10-
# Python2 is available by default in previous versions of Debian.
11-
- |
12-
#ddev-description:Checking DDEV version
13-
(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)
7+
ddev_version_constraint: '>= v1.23.5'

tests/test.bats

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ setup() {
2626

2727
export DIR="$(cd "$(dirname "${BATS_TEST_FILENAME}")/.." >/dev/null 2>&1 && pwd)"
2828
export PROJNAME="test-$(basename "${GITHUB_REPO}")"
29-
mkdir -p ~/tmp
30-
export TESTDIR=$(mktemp -d ~/tmp/${PROJNAME}.XXXXXX)
29+
mkdir -p "${HOME}/tmp"
30+
export TESTDIR="$(mktemp -d "${HOME}/tmp/${PROJNAME}.XXXXXX")"
3131
export DDEV_NONINTERACTIVE=true
3232
export DDEV_NO_INSTRUMENTATION=true
3333
ddev delete -Oy "${PROJNAME}" >/dev/null 2>&1 || true
@@ -50,8 +50,14 @@ health_checks() {
5050

5151
teardown() {
5252
set -eu -o pipefail
53-
ddev delete -Oy ${PROJNAME} >/dev/null 2>&1
54-
[ "${TESTDIR}" != "" ] && rm -rf ${TESTDIR}
53+
ddev delete -Oy "${PROJNAME}" >/dev/null 2>&1
54+
# Persist TESTDIR if running inside GitHub Actions. Useful for uploading test result artifacts
55+
# See example at https://github.com/ddev/github-action-add-on-test#preserving-artifacts
56+
if [ -n "${GITHUB_ENV:-}" ]; then
57+
[ -e "${GITHUB_ENV:-}" ] && echo "TESTDIR=${HOME}/tmp/${PROJNAME}" >> "${GITHUB_ENV}"
58+
else
59+
[ "${TESTDIR}" != "" ] && rm -rf "${TESTDIR}"
60+
fi
5561
}
5662

5763
@test "install from directory" {

0 commit comments

Comments
 (0)