diff --git a/docs/development.rst b/docs/development.rst index a2359cf3e8aa69b4bb8952f3fafd6ee24d802e75..affb4b1cdc2144dc5131a4611d0480381a0ec3eb 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -199,9 +199,9 @@ WSGI applications deployed via roles: - ``phpinfo``, used to serve information about the local PHP installation. -- ``wsgihello``, small hello world application using Python 2 -- ``wsgihello2``, small hello world application using Python 3 and a - couple of additional ``wsgi_website`` role parameters. +- ``wsgihello``, small hello world application. +- ``wsgihello2``, small hello world application using a couple of + additional ``wsgi_website`` role parameters. To make the web applications reachable, make sure the web server (``web.example.com``) IP is also resolvable via names: diff --git a/docs/rolereference.rst b/docs/rolereference.rst index 905aa79538185a0b5111afdb89fcc2395f994de4..a9327a6f3ca810908e1d411ad884de32f3f3b64e 100644 --- a/docs/rolereference.rst +++ b/docs/rolereference.rst @@ -1746,10 +1746,7 @@ The role implements the following: * Adds website administrator to website's group, so administrator could manage the code and data. * Installs additional packages required for running the role (as configured). -* Sets-up a dedicated Python virtual environment for website. Python - version can be specified (default is Python 2). -* Install ``futures`` package in Python virtual environment (required for - Gunicorn in combination with Python 2.7). +* Sets-up a dedicated Python virtual environment for website. * Install Gunicorn in Python virtual environment. * Installs additional packages required for running the role in Python virtual environment (as configured). @@ -1919,13 +1916,11 @@ Parameters noted that in either case the value should be specsified relative to the ``code`` sub-directory. I.e. don't use full paths. -**wsgi_requirements** (list, optional, ``[ futures==3.3.0, gunicorn==19.10.0 ]``) +**wsgi_requirements** (list, optional, ``[ gunicorn==21.2.0, packaging==23.2 ]``) Complete list of pip requirements used for deploying Gunicorn. If specified, this list will be used to create requirements file and install Gunicorn and its dependencies from that one. This allows to - have pinned packages for both Gunicorn, futures, and their - dependencies. The ``futures`` package is required by Gunicorn when - using Python 2.7. + have pinned packages for both Gunicorn and its dependencies. It should be noted that this installation method is meant primarily in case of roles that want to take advantage of upgrade checks for pip requirements @@ -1935,10 +1930,9 @@ Parameters specified the role will deploy necessary files for running the pip requirements upgrade check (see the ``common`` role for description). For this a directory is created under - ``/etc/pip_check_requirements_upgrades/FQDN`` for Python 2 or - ``/etc/pip_check_requirements_upgrades-py3/FQDN`` for Python 3. The same - directory should be used by dependant roles to deploy their own - ``.in`` and ``.txt`` files. Make sure the file ownership is set to + ``/etc/pip_check_requirements_upgrades/FQDN``. The same directory + should be used by dependant roles to deploy their own ``.in`` and + ``.txt`` files. Make sure the file ownership is set to ``root:pipreqcheck``. Should you need to utilise the requirements file in some manner (other than @@ -1950,12 +1944,10 @@ Parameters `_ (the ``pip-compile`` utility) with ``gunicorn`` and ``futures`` in the ``.in.`` file. -**wsgi_requirements_in** (list, optional, ``[ futures, gunicorn ]``) +**wsgi_requirements_in** (list, optional, ``[ gunicorn ]``) List of top level packages to use when performing the pip requirements upgrade checks for the Gunicorn requirements (listed - via ``wsgi_requirements`` parameter). For Python 3-based websites, - it should be sufficient to list only ``gunicorn`` (``futures`` is - required for Python 2). + via ``wsgi_requirements`` parameter). Distribution compatibility diff --git a/docs/usage.rst b/docs/usage.rst index 667db9dff3e009f7e78f9097f1f5dfb7a274d7be..9df690f6c0ab380b23f1ab8448adc1c124926bc5 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -1871,8 +1871,6 @@ on the safe side: - libpng-dev - libmariadb-dev - libmariadb-dev-compat - # Specify that Python 3 should be used for the application - python_version: 3 # Here we specify that anything accessing our website with "/static/" # URL should be treated as request to a static file, to be served # directly by Nginx instead of the WSGI server. diff --git a/roles/common/molecule/default/tests/test_default.py b/roles/common/molecule/default/tests/test_default.py index fa177a842db5f8070c8286762feddb4ad69eb9a5..b25cd3da09689fcc8fc0fbac521891dfd151380a 100644 --- a/roles/common/molecule/default/tests/test_default.py +++ b/roles/common/molecule/default/tests/test_default.py @@ -326,8 +326,7 @@ def test_pipreqcheck_virtualenv_packages(host): actual_packages = sorted(packages.stdout.lower().strip().split("\n")) # This is a dummy distro-provided package ignored by the - # pip-tools. pkg-resources for Python 2.7, pkg_resources for - # Python 3. + # pip-tools. Two variants of this name have been previously known. if "pkg-resources==0.0.0" in actual_packages: actual_packages.remove("pkg-resources==0.0.0") if "pkg_resources==0.0.0" in actual_packages: diff --git a/roles/wsgi_website/molecule/default/tests/test_default.py b/roles/wsgi_website/molecule/default/tests/test_default.py index 930ff246ace330192242c42b88628491c4b683eb..e9fab47eadd19eb4246683b63dae979739fb2d24 100644 --- a/roles/wsgi_website/molecule/default/tests/test_default.py +++ b/roles/wsgi_website/molecule/default/tests/test_default.py @@ -512,9 +512,7 @@ def test_python_version_in_virtualenv(host, python_path, expected_version): assert python_version.rc == 0 - # Python 2 outputs version to stderr, Python 3 outputs it to - # stdout. Go figure. - assert expected_version in python_version.stdout or expected_version in python_version.stderr + assert expected_version in python_version.stdout @pytest.mark.parametrize("fqdn, pip_check_requirements_upgrades_directory, expected_requirements_in, expected_requirements", [ diff --git a/testsite/playbooks/roles/wsgihello2/meta/main.yml b/testsite/playbooks/roles/wsgihello2/meta/main.yml index 876620ef9f41dceb5650d1e6ded6ddab8aa22035..4a73b8547f323ffab04b564a775bfaa039146f50 100644 --- a/testsite/playbooks/roles/wsgihello2/meta/main.yml +++ b/testsite/playbooks/roles/wsgihello2/meta/main.yml @@ -16,7 +16,6 @@ dependencies: - gunicorn==19.9.0 wsgi_requirements_in: - gunicorn - python_version: 3 - role: database db_name: wsgi_{{ testsite_domain_underscores }} db_password: wsgi_{{ testsite_domain_underscores }} diff --git a/testsite/playbooks/roles/wsgihello2/tasks/main.yml b/testsite/playbooks/roles/wsgihello2/tasks/main.yml index b9227bce6bb7bde52135025e875014282c5f2514..8fed7495cb887880b46857e71d5304cd73c245de 100644 --- a/testsite/playbooks/roles/wsgihello2/tasks/main.yml +++ b/testsite/playbooks/roles/wsgihello2/tasks/main.yml @@ -5,7 +5,7 @@ owner="admin-wsgireq_{{ testsite_domain_underscores }}" group="web-wsgireq_{{ testsite_domain_underscores }}" mode=2750 - name: Deploy requirements and its source for upgrade checks - copy: src="{{ item }}" dest="/etc/pip_check_requirements_upgrades-py3/wsgireq.{{ testsite_domain }}/{{ item }}" + copy: src="{{ item }}" dest="/etc/pip_check_requirements_upgrades/wsgireq.{{ testsite_domain }}/{{ item }}" owner="root" group="pipreqcheck" mode=640 with_items: - requirements.in