mirror of
https://github.com/frappe/frappe_docker.git
synced 2024-11-08 14:21:05 +00:00
add python 3.10 (#837)
* fix: use py 3.10 for v14 closes #836 * docs: update development readme for py versions * ci: update github actions py version to 3.10 * Quote Python version in yaml files * fix: typo in environment variable Co-authored-by: Lev Vereshchagin <mail@vrslev.com>
This commit is contained in:
parent
730e14b6cd
commit
1754e6872f
2
.github/workflows/build_stable.yml
vendored
2
.github/workflows/build_stable.yml
vendored
@ -77,7 +77,7 @@ jobs:
|
|||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: 3.9
|
python-version: "3.10"
|
||||||
|
|
||||||
- name: Get latest versions
|
- name: Get latest versions
|
||||||
run: python3 ./.github/scripts/get_latest_tags.py --repo erpnext --version 13
|
run: python3 ./.github/scripts/get_latest_tags.py --repo erpnext --version 13
|
||||||
|
2
.github/workflows/docker-build-push.yml
vendored
2
.github/workflows/docker-build-push.yml
vendored
@ -52,7 +52,7 @@ jobs:
|
|||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: 3.9
|
python-version: "3.10"
|
||||||
|
|
||||||
- name: Install Docker Compose v2
|
- name: Install Docker Compose v2
|
||||||
uses: ndeloof/install-compose-action@4a33bc31f327b8231c4f343f6fba704fedc0fa23
|
uses: ndeloof/install-compose-action@4a33bc31f327b8231c4f343f6fba704fedc0fa23
|
||||||
|
2
.github/workflows/lint.yml
vendored
2
.github/workflows/lint.yml
vendored
@ -18,7 +18,7 @@ jobs:
|
|||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: 3.9
|
python-version: "3.10"
|
||||||
|
|
||||||
# For shfmt pre-commit hook
|
# For shfmt pre-commit hook
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
|
@ -64,11 +64,23 @@ Notes:
|
|||||||
Run the following commands in the terminal inside the container. You might need to create a new terminal in VSCode.
|
Run the following commands in the terminal inside the container. You might need to create a new terminal in VSCode.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
bench init --skip-redis-config-generation --frappe-branch version-13 frappe-bench
|
bench init --skip-redis-config-generation frappe-bench
|
||||||
cd frappe-bench
|
cd frappe-bench
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: For version 12 use Python 3.7 by passing option to `bench init` command, e.g. `bench init --skip-redis-config-generation --frappe-branch version-12 --python python3.7 frappe-bench`
|
For version 13 use Python 3.9 by passing option to `bench init` command,
|
||||||
|
|
||||||
|
```shell
|
||||||
|
bench init --skip-redis-config-generation --frappe-branch version-13 --python python3.9 frappe-bench
|
||||||
|
cd frappe-bench
|
||||||
|
```
|
||||||
|
|
||||||
|
For version 12 use Python 3.7 by passing option to `bench init` command,
|
||||||
|
|
||||||
|
```shell
|
||||||
|
bench init --skip-redis-config-generation --frappe-branch version-12 --python python3.7 frappe-bench
|
||||||
|
cd frappe-bench
|
||||||
|
```
|
||||||
|
|
||||||
### Setup hosts
|
### Setup hosts
|
||||||
|
|
||||||
|
@ -73,8 +73,8 @@ target "default-args" {
|
|||||||
BENCH_REPO = "${BENCH_REPO}"
|
BENCH_REPO = "${BENCH_REPO}"
|
||||||
FRAPPE_VERSION = "${FRAPPE_VERSION}"
|
FRAPPE_VERSION = "${FRAPPE_VERSION}"
|
||||||
ERPNEXT_VERSION = "${ERPNEXT_VERSION}"
|
ERPNEXT_VERSION = "${ERPNEXT_VERSION}"
|
||||||
# If `ERPNEXT_VERSION` variable contains "v12" use Python 3.7. Else — 3.9.
|
# If `ERPNEXT_VERSION` variable contains "v12" use Python 3.7. If "v13" — 3.9. Else 3.10.
|
||||||
PYTHON_VERSION = can(regex("v12", "${ERPNEXT_VERSION}")) ? "3.7" : "3.9"
|
PYTHON_VERSION = can(regex("v12", "${ERPNEXT_VERSION}")) ? "3.7" : can(regex("v13", "${ERPNEXT_VERSION}")) ? "3.9" : "3.10"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,15 +79,17 @@ WORKDIR /home/frappe
|
|||||||
# Python 3.7 sits here for ERPNext version-12
|
# Python 3.7 sits here for ERPNext version-12
|
||||||
# TODO: Remove Python 3.7 when version-12 will not be supported
|
# TODO: Remove Python 3.7 when version-12 will not be supported
|
||||||
ENV PYTHON_VERSION_V12=3.7.12
|
ENV PYTHON_VERSION_V12=3.7.12
|
||||||
ENV PYTHON_VERSION=3.9.9
|
ENV PYTHON_VERSION_V13=3.9.9
|
||||||
|
ENV PYTHON_VERSION=3.10.5
|
||||||
ENV PYENV_ROOT /home/frappe/.pyenv
|
ENV PYENV_ROOT /home/frappe/.pyenv
|
||||||
ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
|
ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
|
||||||
|
|
||||||
# From https://github.com/pyenv/pyenv#basic-github-checkout
|
# From https://github.com/pyenv/pyenv#basic-github-checkout
|
||||||
RUN git clone --depth 1 https://github.com/pyenv/pyenv.git .pyenv \
|
RUN git clone --depth 1 https://github.com/pyenv/pyenv.git .pyenv \
|
||||||
&& pyenv install $PYTHON_VERSION_V12 \
|
&& pyenv install $PYTHON_VERSION_V12 \
|
||||||
|
&& pyenv install $PYTHON_VERSION_V13 \
|
||||||
&& pyenv install $PYTHON_VERSION \
|
&& pyenv install $PYTHON_VERSION \
|
||||||
&& pyenv global $PYTHON_VERSION $PYTHON_VERSION_V12 \
|
&& pyenv global $PYTHON_VERSION $PYTHON_VERSION_V12 $PYTHON_VERSION_v13 \
|
||||||
&& sed -Ei -e '/^([^#]|$)/ {a export PYENV_ROOT="/home/frappe/.pyenv" a export PATH="$PYENV_ROOT/bin:$PATH" a ' -e ':a' -e '$!{n;ba};}' ~/.profile \
|
&& sed -Ei -e '/^([^#]|$)/ {a export PYENV_ROOT="/home/frappe/.pyenv" a export PATH="$PYENV_ROOT/bin:$PATH" a ' -e ':a' -e '$!{n;ba};}' ~/.profile \
|
||||||
&& echo 'eval "$(pyenv init --path)"' >>~/.profile \
|
&& echo 'eval "$(pyenv init --path)"' >>~/.profile \
|
||||||
&& echo 'eval "$(pyenv init -)"' >>~/.bashrc
|
&& echo 'eval "$(pyenv init -)"' >>~/.bashrc
|
||||||
|
Loading…
Reference in New Issue
Block a user