Skip to content

Commit d542dab

Browse files
Merge branch 'dev' into robust-error-handling
2 parents ee2df75 + 102413b commit d542dab

File tree

89 files changed

+3086
-723
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+3086
-723
lines changed

.github/workflows/.github-actions.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,28 @@ name: pyRACF Linting & Unit Test
22
on: [push, pull_request]
33
jobs:
44
build:
5+
strategy:
6+
fail-fast: false
7+
matrix:
8+
python-version: ["3.10", "3.11"]
59
runs-on: ubuntu-latest
610
steps:
711
- uses: actions/checkout@v3
8-
- name: Python Setup
12+
- name: Set Up Python ${{ matrix.python-version }}
913
uses: actions/setup-python@v4
1014
with:
11-
python-version: '3.11'
12-
- name: Install Dependencies
13-
run: |
14-
python3 -m pip install --upgrade pip
15-
python3 -m pip install -r requirements.txt
16-
python3 -m pip install -r requirements-development.txt
15+
python-version: ${{ matrix.python-version }}
16+
- name: Install Poetry
17+
run: curl -sSL https://install.python-poetry.org | python3 -
18+
- name: Show Poetry Environment Info
19+
run: poetry env info
20+
- name: Install Development Dependencies
21+
run: poetry install --no-root
1722
- name: Flake8
18-
run: flake8 .
23+
run: poetry run flake8 .
1924
- name: Pylint
20-
run: pylint --recursive=y .
25+
run: poetry run pylint --recursive=y .
2126
- name: Unit Test
22-
run: coverage run tests/test_runner.py
27+
run: poetry run coverage run tests/test_runner.py
2328
- name: Code Coverage
24-
run: coverage report -m
29+
run: poetry run coverage report -m

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,4 +170,7 @@ _site
170170
.jekyll-cache
171171
.jekyll-metadata
172172
vendor
173-
Gemfile.lock
173+
Gemfile.lock
174+
175+
# Poetry
176+
poetry.lock

.pre-commit-config.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,43 @@ repos:
33
hooks:
44
- id: isort
55
name: isort
6-
entry: isort .
6+
entry: poetry run isort .
77
language: system
88
pass_filenames: false
99
always_run: true
1010
- id: black
1111
name: black
12-
entry: black .
12+
entry: poetry run black .
1313
language: system
1414
pass_filenames: false
1515
always_run: true
1616
- id: flake8
1717
name: flake8
18-
entry: flake8 .
18+
entry: poetry run flake8 .
1919
language: system
2020
pass_filenames: false
2121
always_run: true
2222
- id: pylint
2323
name: pylint
24-
entry: pylint --recursive=y .
24+
entry: poetry run pylint --recursive=y .
2525
language: system
2626
pass_filenames: false
2727
always_run: true
2828
- id: unittest
2929
name: unittest
30-
entry: coverage run tests/test_runner.py
30+
entry: poetry run coverage run tests/test_runner.py
3131
language: system
3232
pass_filenames: false
3333
always_run: true
3434
- id: coverage-html
3535
name: coverage-html
36-
entry: coverage html
36+
entry: poetry run coverage html
3737
language: system
3838
pass_filenames: false
3939
always_run: true
4040
- id: coverage
4141
name: coverage
42-
entry: coverage report -m
42+
entry: poetry run coverage report -m
4343
language: system
4444
pass_filenames: false
4545
always_run: true

CONTRIBUTING.md

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,19 @@ The following are a set of guidelines to help you contribute.
99

1010
* [Ways to Contribute](#ways-to-contribute)
1111

12-
* [Coding](#coding)
12+
* [Coding](#coding)
1313

14-
* [pre-commit Hooks](#pre-commit-hooks)
14+
* [pre-commit Hooks](#pre-commit-hooks)
1515

16-
* [Adding New Functionality](#adding-new-functionality)
16+
* [Adding New Functionality](#adding-new-functionality)
1717

18-
* [Testing](#testing)
18+
* [Testing](#testing)
1919

20-
* [Fixing Bugs](#fixing-bugs)
20+
* [Fixing Bugs](#fixing-bugs)
2121

22-
* [Adding or Fixing Documentation](#adding-or-fixing-documentation)
22+
* [Adding or Fixing Documentation](#adding-or-fixing-documentation)
23+
24+
* [Branch Naming Conventions](#branch-naming-conventions)
2325

2426
* [Style Guidelines](#style-guidelines)
2527

@@ -52,14 +54,16 @@ If you want to write code, a good way to get started is by looking at the issues
5254
### pre-commit Hooks
5355
To ensure that **code formatters _(isort and black)_**, **linters _(flake8 and pylint)_**, and **unit tests** are always run against your code on **every commit** set up the **pre-commit hooks**.
5456

55-
* Install development dependencies
57+
> :warning: _pyRACF uses Poetry as it's **build backend** and for **dependency management**. After installing Poetry, ensure that the install location of Poetry is added to the `$PATH` **environment variable** if it is not already._
58+
* [Install Poetry](https://python-poetry.org/docs/#installation)
59+
60+
* Install dependencies
5661
```shell
57-
python3 -m pip install -r requirements-development.txt
62+
poetry install --no-root
5863
```
5964
* Setup pre-commit hooks
60-
> :warning: _If your workstation cannot find `pre-commit`, ensure that the **Python package** `bin` directory location is added to the `$PATH` **environment variable**._
6165
```shell
62-
pre-commit install -f
66+
poetry run pre-commit install -f
6367
```
6468

6569
### Adding New Functionality
@@ -70,6 +74,12 @@ If you have a new functionality that can be added to the package, open a GitHub
7074

7175
The main way to test pyRACF is to write **unit tests** in the [`tests`](tests) folder which **mock** the real **IRRSMO00 API** to enable **XML generation** and **XML parsing** logic to be validated in a **fast** and **automated** way. The unit test suite can be run by just executing [`test_runner.py`](tests/test_runner.py). It is also recommended to do manual tests on a **z/OS system** for **new functionality** and **bug fixes** to test the real calls to **IRRSMO00**.
7276

77+
Since pyRACF uses Poetry as it's **build backend** and for **dependency management**, the pyRACF unit test suite should be executed as follows:
78+
79+
```shell
80+
poetry run coverage run tests/test_runner.py
81+
```
82+
7383
* **Unit Tests:**
7484

7585
> :bulb: _See the Python [`unittest`](https://docs.python.org/3/library/unittest.html) and [`unittest.mock`](https://docs.python.org/3/library/unittest.mock.html) documentation for more details on writing test cases._
@@ -88,13 +98,22 @@ If you fix a bug, open a GitHub pull request against the `dev` branch with the f
8898

8999
If any updates need to be made to the pyRACF documentation, open a GitHub pull request against the `gh-pages-dev` branch with your changes. This may include updates to document new functionality or updates to correct errors or mistakes in the existing documentation.
90100

101+
### Branch Naming Conventions
102+
103+
Code branches should use the following naming conventions:
104+
105+
* `wip/name` *(Work in progress branch that likely won't be finished soon)*
106+
* `feat/name` *(Branch where new functionality or enhancements are being developed)*
107+
* `bug/name` *(Branch where one or more bugs are being fixed)*
108+
* `junk/name` *(Throwaway branch created for experimentation)*
109+
91110
## Style Guidelines
92111

93112
:bulb: _These steps can be done automatically using the [pre-commit Hooks](#pre-commit-hooks)._
94113

95114
* When adding code to pyRACF, follow the PEP8 style guide for Python
96-
* The use of Flake8, Black, and pydocstyle as helpers is recommended
97-
* It is strongly recommended that you perform a pylint check on your code. We expect it to have a pylint score greater than 9
115+
* The use of `pylint`, `flake8`, `black`, and `isort` is required.
116+
* We expect all contributions to pass `flake8` and to have a `pylint` score of **10**.
98117

99118
## Contribution checklist
100119

@@ -106,8 +125,8 @@ When contributing to pyRACF, think about the following:
106125
* Add any available test cases to `/tests`.
107126
* Verify `__init__.py` files are updated properly.
108127
* Ensure that you have __pre-commit Hooks__ setup to ensure that **isort**, **black**, **flake8**, and **pylint** are run against the code for every commit you make.
109-
* Run unit test suite by executing `python3 tests/test_runner.py`.
110-
* Install pyRACF on a z/OS system and do a smoke test to make sure no regressions have been introduced with the C code that interfaces with IRRSOM00.
128+
* Run unit test suite by executing `poetry run coverage run tests/test_runner.py`.
129+
* Install pyRACF on a z/OS system and do a smoke test to make sure no regressions have been introduced with the C code that interfaces with IRRSOM00. [`function_test.py`](tests/function_test/function_test.py) can be used for this smoke test.
111130

112131
## Found a bug?
113132

0 commit comments

Comments
 (0)