Upgrade to python 3.9

This commit is contained in:
Gabriel Augendre 2020-12-26 14:36:46 +01:00
parent 1be7e28566
commit 17ac650531
No known key found for this signature in database
GPG key ID: 1E693F4CE4AEE7B4
2 changed files with 17 additions and 13 deletions

View file

@ -1,7 +1,7 @@
image: freebsd/12.x image: freebsd/12.x
packages: packages:
- python38 - python39
- py38-sqlite3 - py39-sqlite3
- jpeg-turbo - jpeg-turbo
- py37-ansible - py37-ansible
sources: sources:
@ -14,7 +14,7 @@ environment:
tasks: tasks:
- install_poetry: | - install_poetry: |
mkdir $HOME/bin mkdir $HOME/bin
ln -s $(which python3.8) $HOME/bin/python ln -s $(which python3.9) $HOME/bin/python
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
echo "source $HOME/.poetry/env" >> ~/.buildenv echo "source $HOME/.poetry/env" >> ~/.buildenv
- install_deps: | - install_deps: |

View file

@ -2,35 +2,39 @@
- name: deploy blog - name: deploy blog
hosts: blognas hosts: blognas
remote_user: root remote_user: root
environment: # environment:
PATH: /root/.poetry/bin:{{ ansible_env.PATH }} # PATH: /root/.poetry/bin:{{ ansible_env.PATH }}
tasks: tasks:
- name: install system dependencies - name: install system dependencies
pkgng: pkgng:
name: git,python38,py38-sqlite3,jpeg-turbo,nginx,curl,vim name: git,python39,py39-sqlite3,jpeg-turbo,nginx,curl,vim
- name: make python3.8 default - name: make python3.9 default
file: file:
path: /usr/local/bin/python3 path: /usr/local/bin/python3
src: /usr/local/bin/python3.8 src: /usr/local/bin/python3.9
state: link state: link
- name: install pip
shell:
cmd: python -m ensurepip
creates: /usr/local/lib/python3.9/site-packages/pip
- name: fetch code - name: fetch code
git: git:
repo: https://git.sr.ht/~crocmagnon/blog repo: https://git.sr.ht/~crocmagnon/blog
dest: /srv/blog dest: /srv/blog
force: yes force: yes
- name: install poetry
shell:
cmd: POETRY_VERSION=1.1.4 curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
creates: /root/.poetry/bin/poetry
- name: create venv - name: create venv
shell: shell:
cmd: python -m venv /srv/blogvenv cmd: python -m venv /srv/blogvenv
creates: /srv/blogvenv/bin/python creates: /srv/blogvenv/bin/python
- name: install poetry
shell:
cmd: . /srv/blogvenv/bin/activate && python -m pip install poetry==1.1.4
creates: /srv/blogvenv/bin/poetry
- name: install python dependencies - name: install python dependencies
shell: shell:
chdir: /srv/blog chdir: /srv/blog
cmd: . /srv/blogvenv/bin/activate && poetry install --no-dev --remove-untracked cmd: . /srv/blogvenv/bin/activate && poetry install --no-dev
- name: install service - name: install service
copy: copy:
remote_src: yes remote_src: yes