Changeset - 180d7b99f777
[Not reviewed]
0 7 0
Branko Majic (branko) - 5 years ago 2019-08-25 19:36:20
branko@majic.rs
MAR-146: Added separate parameter for Pyhton 3 virtual environment used for upgrade checks:

- Release notes updated to mention the breaking change.
- Updated role reference documentation to cover the new parameter.
- Updated default values for the dedicated Python virtual
environments.
- Update role common to deploy separate requirements for the two
environments.
- Include wheel package in the requirements.
7 files changed with 67 insertions and 26 deletions:
0 comments (0 inline, 0 general)
docs/releasenotes.rst
Show inline comments
 
@@ -5,6 +5,20 @@ Release notes
 
NEXT RELEASE
 
------------
 

	
 
Breaking changes:
 

	
 
* ``common`` role:
 

	
 
  * Added separate parameter (``pip_check_requirements_py3``) for
 
    specifying dedicated Python 3 virtual environment package
 
    requirements used for package upgrade checks on (other
 
    user-provided) Python 3 virtual environments. If the existing
 
    ``pip_check_requirements`` parameter has been overridden, the new
 
    parameter will most likely need to be overridden in your site
 
    configuration as well. Take note that the new requirements will
 
    differ between Debian Jessie and Debian Stretch due to differnece
 
    in Python 3 minor version releases.
 

	
 
Bug fixes:
 

	
 
* ``backup_client`` role
docs/rolereference.rst
Show inline comments
 
@@ -421,12 +421,29 @@ Parameters
 
    - "2.debian.pool.ntp.org"
 
    - "3.debian.pool.ntp.org"
 

	
 
**pip_check_requirements** (list, optional, ``[click==7.0, pip-tools==3.1.0, pip==18.1, setuptools==40.6.2, six==1.11.0, wheel==0.32.3]``)
 
  List of Python package requirements to install in Python 2 and
 
  Python 3 virtual environments in order to be able to run the
 
  ``pip-tools`` applications as part of pip requirements upgrade
 
  checks. This list needs to be updated from time to time as the new
 
  releases of ``pip-tools`` and related packages are coming out.
 
**pip_check_requirements** (list, optional, ``[click==7.0, pip-tools==4.0.0, pip==19.2.3, setuptools==41.2.0, six==1.12.0, wheel==0.33.6]``)
 
  List of Python package requirements to install in Python 2 virtual
 
  environment in order to be able to run the ``pip-tools``
 
  applications as part of pip requirements upgrade checks. This list
 
  needs to be updated from time to time as the new releases of
 
  ``pip-tools`` and related packages are coming out. For Python 3, see
 
  the dedicatd parameter ``pip_check_requirements_py3`` below.
 

	
 
**pip_check_requirements_py3** (list, optional, ``[click==7.0, pip-tools==3.9.0, pip==19.1.1, setuptools==41.2.0, six==1.12.0, wheel==0.33.6]``)
 
  List of Python package requirements to install in Python 3 virtual
 
  environment in order to be able to run the ``pip-tools``
 
  applications as part of pip requirements upgrade checks. This list
 
  needs to be updated from time to time as the new releases of
 
  ``pip-tools`` and related packages are coming out. For Python 2, see
 
  the dedicatd parameter ``pip_check_requirements`` above.
 

	
 
  Take note that on Debian Jessie and Stretch there will be
 
  differences in what the system uses because of differing Python 3
 
  versions and deprecation around Python 3 minor version releases. The
 
  listed defaults are conservative on the side of being usable on both
 
  Debian Jessie and Debian Stretch as of time of this writing. For
 
  Debian Stretch machines you will most likely end up updating the
 
  list almost immediatelly.
 

	
 
**pipreqcheck_uid** (integer, optional, ``whatever OS picks``)
 
  UID for user running the pip requirements upgrade checks. User is created with
roles/common/defaults/main.yml
Show inline comments
 
@@ -14,11 +14,18 @@ extra_backup_patterns:
 
  - "/home"
 
pip_check_requirements:
 
  - click==7.0
 
  - pip-tools==3.1.0
 
  - pip==18.1
 
  - setuptools==40.6.2
 
  - six==1.11.0
 
  - wheel==0.32.3
 
  - pip-tools==4.0.0
 
  - pip==19.2.3
 
  - setuptools==41.2.0
 
  - six==1.12.0
 
  - wheel==0.33.6
 
pip_check_requirements_py3:
 
  - click==7.0
 
  - pip-tools==3.9.0
 
  - pip==19.1.1
 
  - setuptools==41.2.0
 
  - six==1.12.0
 
  - wheel==0.33.6
 
ntp_servers: []
 

	
 
# Internal use only.
roles/common/files/pipreqcheck_requirements.in
Show inline comments
 
pip
 
pip-tools
 
setuptools
 
\ No newline at end of file
 
setuptools
 
wheel
 
\ No newline at end of file
roles/common/molecule/default/tests/test_default.py
Show inline comments
 
@@ -308,19 +308,19 @@ def test_pipreqcheck_requirements(host, requirements_in_path, requirements_txt_p
 
@pytest.mark.parametrize("pip_path, expected_packages",  [
 
    ('/var/lib/pipreqcheck/virtualenv/bin/pip', [
 
        "Click==7.0",
 
        "pip==18.1",
 
        "pip-tools==3.1.0",
 
        "setuptools==40.6.2",
 
        "six==1.11.0",
 
        "wheel==0.32.3"
 
        "pip==19.2.3",
 
        "pip-tools==4.0.0",
 
        "setuptools==41.2.0",
 
        "six==1.12.0",
 
        "wheel==0.33.6",
 
    ]),
 
    ('/var/lib/pipreqcheck/virtualenv-py3/bin/pip', [
 
        "Click==7.0",
 
        "pip==18.1",
 
        "pip-tools==3.1.0",
 
        "setuptools==40.6.2",
 
        "six==1.11.0",
 
        "wheel==0.32.3",
 
        "pip==19.1.1",
 
        "pip-tools==3.9.0",
 
        "setuptools==41.2.0",
 
        "six==1.12.0",
 
        "wheel==0.33.6",
 
    ]),
 
])
 
def test_pipreqcheck_virtualenv_packages(host, pip_path, expected_packages):
roles/common/tasks/main.yml
Show inline comments
 
@@ -383,13 +383,15 @@
 
- name: Deploy requirements file for pipreqcheck virtual environment
 
  template:
 
    src: "pipreqcheck_requirements.txt.j2"
 
    dest: "{{ item }}"
 
    dest: "{{ item.file }}"
 
    owner: root
 
    group: pipreqcheck
 
    mode: 0640
 
  with_items:
 
    - "/etc/pip_check_requirements_upgrades/pipreqcheck/requirements.txt"
 
    - "/etc/pip_check_requirements_upgrades-py3/pipreqcheck/requirements.txt"
 
    - file: "/etc/pip_check_requirements_upgrades/pipreqcheck/requirements.txt"
 
      requirements: "{{ pip_check_requirements }}"
 
    - file: "/etc/pip_check_requirements_upgrades-py3/pipreqcheck/requirements.txt"
 
      requirements: "{{ pip_check_requirements_py3 }}"
 

	
 
- name: Install requirements in the pipreqcheck virtual environment
 
  pip:
roles/common/templates/pipreqcheck_requirements.txt.j2
Show inline comments
 
{% for requirement in pip_check_requirements %}
 
{% for requirement in item.requirements %}
 
{{ requirement }}
 
{% endfor %}
0 comments (0 inline, 0 general)