Skip to content

Commit 7a73104

Browse files
stewartfrancisandrewhughes101
authored andcommitted
Remove support for python < 3.9, Ansible < 2.14
Signed-off-by: Stewart Francis <[email protected]>
1 parent e373667 commit 7a73104

13 files changed

+20
-278
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -60,129 +60,4 @@ You must use your real name and email address.
6060

6161
To save you having to type the above for every commit, Git can add the `Signed-off-by` line. When committing, add the `-s` option to your `git commit` command.
6262

63-
If you haven't signed each commit, then the pull request will fail to pass all checks.
64-
65-
# Development Environment Set-Up Instructions
66-
=============================================
67-
68-
This repository contains an Ansible collection, which is tested using `ansible-test`. This combination of development
69-
tooling requires you to clone the repository to a pretty specific path. As an example, clone the repository to:
70-
71-
```
72-
.../ibm_zos_cics/ansible_collections/ibm/ibm_zos_cics
73-
```
74-
75-
`ansible-test` requires your project to exist in a FQCN-compatible folder structure following the Ansible Collections
76-
conventions. For details, see [this issue](https://github.com/ansible/ansible/issues/60215).
77-
78-
### Create a new virtual environment
79-
80-
Create a virtual environment in the checked out repository. The dir `venv3` is gitignored, and the rest of this
81-
documentation assumes you'll be using that as the name for your virtual environment:
82-
83-
```bash
84-
# Create a new venv called venv3
85-
python3 -m venv venv3
86-
87-
# Activate venv3
88-
source venv3/bin/activate
89-
90-
# Install dev-requirements
91-
pip install -r dev-requirements.txt
92-
```
93-
94-
#### Running the unit tests
95-
96-
You can use the `ansible-test` command to run all of the unit tests:
97-
```bash
98-
# Run unit tests
99-
ansible-test units --python=3.8
100-
```
101-
102-
#### Run Integration Tests
103-
104-
You can also use the `ansible-test` command to run all of the integration tests:
105-
106-
```bash
107-
# Run integration tests
108-
ansible-test integration --python=3.8
109-
```
110-
111-
### PyCharm set-up instructions
112-
113-
If you're planning on using a development environment such as PyCharm to develop `ibm_zos_cics`, you will need to
114-
load the bolded folder in the sample checkout path, in order that your development environment is able to resolve
115-
references to FQCN imports:
116-
117-
<code>.../<b>ibm_zos_cics</b>/ansible_collections/ibm/ibm_zos_cics</code>
118-
119-
#### Make your virtual environment the default Python interpreter for the project
120-
121-
Add the virtual environment as an existing Python interpreter:
122-
123-
- `Preferences > Project: cics-ansible > Python Interpreter > Cog menu > Add.. > {project_root}/ansible_collections/ibm/ibm_zos_cics/env/bin/python`
124-
125-
Set the virtual environment as the default Python interpreter:
126-
127-
- `Preferences > Project: cics-ansible > Python Interpreter > Top dropdown box > Select interpreter you just imported > Apply`
128-
129-
#### Python 2 support
130-
131-
The CMCI modules support running on Python 2.7. To ensure we maintain python 2.7 compatibility, you will also want to
132-
configure a Python 2.7 virtualenv:
133-
134-
```bash
135-
# Ensure virtualenv is installed
136-
python2.7 -m pip install virtualenv
137-
138-
# Create a new virtualenv called venv2
139-
python2.7 -m virtualenv venv2
140-
141-
# Activate venv2
142-
source venv2/bin/activate
143-
144-
# Install dev-requirements
145-
pip install -r dev-requirements.txt
146-
```
147-
148-
Note that a slightly different set of dev requirements is installed for python 2.7, as most of the static analysis tools in
149-
the automated build are run in python 3.8, so are not dev requirements for the python 2.7 environment.
150-
151-
#### Running the build, tests and static analysis locally
152-
153-
A bash script is provided to automate running the static analysis, and tests in both python 2.7 and python 3.8
154-
environments. You will need to have set up `venv`s as described above, with the dev-requirements pre-installed. You will
155-
then be able to run the build, passing the locations of the python 2.7 and python 3.8 `venv`s as environment variables:
156-
157-
```bash
158-
CMCI_PYTHON_38=./venv3 CMCI_PYTHON_27=./venv2 ./build.sh
159-
```
160-
161-
If you are running on Windows, you will need to run the automated build in a docker container produced by building the `Dockerfile` in this repository
162-
163-
#### Configure PyCharm to be able to run Ansible collection unit tests
164-
165-
First, add the `ansible_pytest_collections` plugin to `PYTHONPATH` for your python interpreter. This will be in your
166-
venv if you installed the dependencies using the dev requirements file:
167-
168-
- `Preferences > Project: cics-ansible > Python Interpreter > Cog menu > Show all >
169-
Select your interpreter > Show paths for the selected interpreter (at the bottom) > Plus >
170-
add the path to the 'ansible_test' 'pytest' plugin in your python environment`
171-
172-
- For the sample path:
173-
`.../ibm_zos_cics/ansible_collections/ibm/ibm_zos_cics/venv3/lib/python3.8/site-packages/ansible_test/_data/pytest/plugins`
174-
175-
Next, you'll need to set some default environment variables for pytest launches, to enable the
176-
`ansible_pytest_collections` plugin, and successfully resolve the `ibm_zos_cics` collection locally.
177-
178-
Go to `Run Config Menu > Edit Configurations... > Templates > Python tests > pytest > Environment variables button`
179-
180-
- Set `PYTEST_PLUGINS` to `ansible_pytest_collections`
181-
182-
- Set `ANSIBLE_COLLECTIONS_PATHS` to your project root, i.e. the directory that contains `ansible_collections`. For the
183-
example configuration, that's set to `.../ibm_zos_cics`.
184-
185-
*(You may need to delete existing test configurations in `Python Tests` as they won't have been created with the new
186-
template)*
187-
188-
You should be able to launch the unit tests in `tests/unit/modules` by clicking the play button.
63+
If you haven't signed each commit, then the pull request will fail to pass all checks.

Dockerfile

Lines changed: 0 additions & 14 deletions
This file was deleted.

build.sh

Lines changed: 0 additions & 72 deletions
This file was deleted.

dev-requirements.txt

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
1-
# (c) Copyright IBM Corp. 2020,2023
1+
# (c) Copyright IBM Corp. 2020,2024
22
# Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0)
33
-r requirements.txt
4-
# ansible-core==2.13.7; python_version >= '3'
5-
# ansible-core==2.11.12; python_version < '3'
64
junit-xml==1.9 # To get JUnit xml report from ansible-test
75
pytest_mock==2.0.0
86
mock==3.0.5
97
requests_mock==1.8.0
108
pytest-xdist==1.34.0 # Need this to work around a problem running ansible-test
11-
pytest==4.6.11; python_version < '3'
12-
pytest==7.2.0; python_version >= '3'
13-
# Non-test requirements (python 3+ only)
14-
pylint==2.5.3; python_version >= '3'
15-
shellcheck-py==0.9.0.5; python_version >= '3'
16-
rstcheck==6.1.2; python_version >= '3'
17-
yamllint==1.32.0; python_version >= '3'
18-
voluptuous==0.13.1; python_version >= '3'
19-
ansible-lint==6.22.0; python_version >= '3.9'
20-
pycodestyle==2.10.0; python_version >= '3'
21-
bandit==1.7.8; python_version >= '3'
9+
pytest==7.2.0
10+
# Non-test requirements
11+
pylint==2.5.3
12+
shellcheck-py==0.9.0.5
13+
rstcheck==6.1.2
14+
yamllint==1.32.0
15+
voluptuous==0.13.1
16+
ansible-lint==6.22.0
17+
pycodestyle==2.10.0
18+
bandit==1.7.8

doc-requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
# Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0)
33
-r dev-requirements.txt
44

5-
ansible-doc-extractor==0.1.6; python_version >= '3'
6-
Sphinx==3.4.3; python_version >= '3'
7-
sphinx-rtd-theme==0.5.1; python_version >= '3'
5+
ansible-doc-extractor==0.1.11
6+
Sphinx==6.2.1
7+
sphinx-rtd-theme==1.2.2

docs/source/requirements.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ A control node is any machine with Ansible® installed. You can run commands and
1515

1616
.. note:: The IBM® z/OS® CICS® collection cannot run on a Windows system.
1717

18-
* `Ansible version`_: 2.11 or later
19-
* `Python`_: 2.7 or later
18+
* `Ansible version`_: 2.14 or later
19+
* `Python`_: 3.9 or later
2020

2121

2222
.. _Ansible version:

meta/ibm_zos_cics_meta.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ name: ibm_zos_cics
33
version: 1.0.6
44
managed_requirements:
55
- name: Python
6-
version: ">=2.7"
6+
version: ">=3.9"
77
- name: CICS TS with CICSplex System Manager
88
version: ">=4.1"

requirements.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# (c) Copyright IBM Corp. 2020,2021
22
# Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0)
3-
requests==2.27.1;python_version<'3.7'
4-
requests==2.31.0;python_version>='3.7'
3+
requests==2.31.0
54
xmltodict==0.12.0
6-
typing;python_version<"3.5"
5+
typing

tests/sanity/ignore-2.10.txt

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/sanity/ignore-2.11.txt

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)