Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use --system-site-packages and install package to omit building 'netifaces' wheel [Calibre-Web] #3503

Merged
merged 3 commits into from
Apr 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
35 changes: 16 additions & 19 deletions roles/calibre-web/tasks/install.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
- name: "Install packages: imagemagick, python3-venv"
- name: "Install packages: imagemagick, python3-venv, python3-netifaces"
package:
name:
- imagemagick
- python3-venv
- python3-netifaces
state: present

# https://github.com/iiab/iiab/pull/3496#issuecomment-1475094542
- name: "Install packages: python3-dev, gcc to compile 'netifaces'"
package:
name:
- python3-dev # header files
- gcc # compiler
state: present
when: python_version is version('3.10', '>=')

#- name: "Install packages: python3-dev, gcc to compile 'netifaces'"
# package:
# name:
# - python3-dev # header files
# - gcc # compiler
# state: present
# when: python_version is version('3.10', '>=')
- name: Allow ImageMagick to read PDFs, per /etc/ImageMagick-6/policy.xml, to create book cover thumbnails
lineinfile:
path: /etc/ImageMagick-6/policy.xml
Expand All @@ -22,6 +22,11 @@
line: ' <policy domain="coder" rights="read" pattern="PDF" />'
state: present

- name: Remove previous virtual environment {{ calibreweb_venv_path }}
file:
path: "{{ calibreweb_venv_path }}"
state: absent

- name: "Create 3 Calibre-Web folders to store data and config files: {{ calibreweb_home }}, {{ calibreweb_venv_path }}, {{ calibreweb_config }} (all set to {{ calibreweb_user }}:{{ apache_user }}) (default to 0755)"
file:
state: directory
Expand Down Expand Up @@ -56,7 +61,8 @@
requirements: "{{ calibreweb_venv_path }}/requirements.txt"
virtualenv: "{{ calibreweb_venv_path }}" # /usr/local/calibre-web-py3
virtualenv_site_packages: no
virtualenv_command: python3 -m venv {{ calibreweb_venv_path }}
virtualenv_command: python3 -m venv --system-site-packages {{ calibreweb_venv_path }}

# VIRTUALENV EXAMPLE COMMANDS:
# cd /usr/local/calibre-web-py3
# source bin/activate
Expand Down Expand Up @@ -102,15 +108,6 @@
backup: yes
when: not appdb.stat.exists

# https://github.com/iiab/iiab/pull/3496#issuecomment-1475094542
#- name: "Uninstall packages: python3-dev, gcc used to compile 'netifaces'"
# package:
# name:
# - python3-dev # header files
# - gcc # compiler
# state: absent
# when: python_version is version('3.10', '>=')


# RECORD Calibre-Web AS INSTALLED

Expand Down