Skip to content

Commit 60fdac6

Browse files
authored
Merge pull request #97 from stewartfrancis/update-requirements-meta
Move execution env, update requirements, update dev guide, update build
2 parents 795ed4b + 0dfd5c2 commit 60fdac6

File tree

7 files changed

+28
-19
lines changed

7 files changed

+28
-19
lines changed

build.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fi
1616
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
1717

1818
source "$CMCI_PYTHON_38/bin/activate"
19-
(set -x; pip install -r requirements.txt)
19+
(set -x; pip install -r dev-requirements.txt)
2020

2121
(set -x; ANSIBLE_COLLECTIONS_PATHS=../../.. ansible-lint)
2222
(set -x; python3 -m yamllint -c yamllint.yaml .)
@@ -41,10 +41,10 @@ echo "/* Integration tests for missing libraries Python 3.8
4141
echo "/* -------------------------------------------------------------------------- */"
4242
(set -x; pip uninstall xmltodict -y)
4343
(set -x; ansible-test integration cics_cmci_missing_xmltodict_library --python 3.8)
44-
(set -x; pip install -r prod-requirements.txt)
44+
(set -x; pip install -r requirements.txt)
4545
(set -x; pip uninstall requests -y)
4646
(set -x; ansible-test integration cics_cmci_missing_requests_library --python 3.8)
47-
(set -x; pip install -r prod-requirements.txt)
47+
(set -x; pip install -r requirements.txt)
4848

4949
echo $?
5050
deactivate
@@ -54,7 +54,7 @@ echo "/* -----------------------------------------------------------------------
5454
echo "/* Unit tests Python 2.7 */"
5555
echo "/* -------------------------------------------------------------------------- */"
5656
source "$CMCI_PYTHON_27/bin/activate"
57-
pip install -r requirements.txt
57+
pip install -r dev-requirements.txt
5858
(set -x; ansible-test units --python 2.7)
5959

6060
echo "/* -------------------------------------------------------------------------- */"

dev-requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# (c) Copyright IBM Corp. 2020,2021
22
# Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0)
3-
ansible==2.10.5
3+
-r requirements.txt
4+
ansible==2.10.7
45
junit-xml==1.9 # To get JUnit xml report from ansible-test
56
pytest_mock==1.12.1
67
mock==3.0.5

devguide.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ python3 -m venv venv3
8787
# Activate venv3
8888
source venv3/bin/activate
8989

90-
# Install requirements
91-
pip install -r requirements.txt
90+
# Install dev-requirements
91+
pip install -r dev-requirements.txt
9292
```
9393

9494
#### Running the unit tests
@@ -141,17 +141,17 @@ python2.7 -m virtualenv venv2
141141
# Activate venv2
142142
source venv2/bin/activate
143143

144-
# Install requirements
145-
pip install -r requirements.txt
144+
# Install dev-requirements
145+
pip install -r dev-requirements.txt
146146
```
147147

148-
Note that a slightly different set of 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 requirements for the python 2.7 environment.
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.
150150

151151
#### Running the build, tests and static analysis locally
152152

153153
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 requirements pre-installed. You will
154+
environments. You will need to have set up `venv`s as described above, with the dev-requirements pre-installed. You will
155155
then be able to run the build, passing the locations of the python 2.7 and python 3.8 `venv`s as environment variables:
156156

157157
```bash
@@ -163,7 +163,7 @@ If you are running on Windows, you will need to run the automated build in a doc
163163
#### Configure PyCharm to be able to run Ansible collection unit tests
164164

165165
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 requirements file:
166+
venv if you installed the dependencies using the dev requirements file:
167167

168168
- `Preferences > Project: cics-ansible > Python Interpreter > Cog menu > Show all >
169169
Select your interpreter > Show paths for the selected interpreter (at the bottom) > Plus >

execution-environment.yml

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

meta/execution-environment.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dependencies:
2+
python: requirements.txt
3+
version: 1

meta/ibm_zos_cics_meta.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: ibm_zos_cics
2+
version: "1.0.1"
3+
managed_requirements:
4+
- name: "Python"
5+
version: ">=2.7"
6+
- name: "CICS TS with CICSplex System Manager"
7+
version: ">=4.1"

requirements.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# (c) Copyright IBM Corp. 2020
1+
# (c) Copyright IBM Corp. 2020,2021
22
# Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0)
3-
-r prod-requirements.txt
4-
-r dev-requirements.txt
3+
requests==2.23.0
4+
xmltodict==0.12.0
5+
typing;python_version<"3.5"

0 commit comments

Comments
 (0)