|
1 | | - |
2 | 1 | [](https://github.com/reqstool/reqstool-python-decorators/pulse) |
3 | 2 | [](https://github.com/reqstool/reqstool-python-decorators/issues) |
4 | 3 | [](https://opensource.org/license/mit/) |
5 | 4 | [](https://github.com/reqstool/reqstool-python-decorators/actions/workflows/build.yml) |
6 | | -[](https://reqstool.github.io/reqstool-python-decorators/reqstool-python-decorators/0.0.1/index.html) |
| 5 | +[](https://reqstool.github.io) |
7 | 6 |
|
8 | 7 | # Reqstool Python Decorators |
9 | 8 |
|
10 | | -## Description |
11 | | - |
12 | | -This provides decorators and collecting of decorated code, formatting it and writing to yaml file. |
| 9 | +Python decorators for [reqstool](https://github.com/reqstool/reqstool-client) requirements traceability. Provides `@Requirements` and `@SVCs` decorators for linking Python code to requirements and software verification cases. |
13 | 10 |
|
14 | | -## Requirements |
| 11 | +## Prerequisites |
15 | 12 |
|
16 | 13 | - Python >= 3.13 |
17 | 14 |
|
18 | 15 | ## Installation |
19 | 16 |
|
20 | | -The package name is `reqstool-python-decorators`. |
21 | | - |
22 | | -* Using pip install: |
23 | | - |
24 | | -``` |
25 | | -$pip install reqstool-python-decorators |
| 17 | +```bash |
| 18 | +pip install reqstool-python-decorators |
26 | 19 | ``` |
27 | 20 |
|
28 | 21 | ## Usage |
29 | 22 |
|
30 | | -### pyproject.toml |
31 | | - |
32 | | -* Hatch |
33 | | - |
34 | | -``` |
35 | | -dependencies = [ |
36 | | - "reqstool-python-decorators == <version>" |
37 | | -] |
38 | | -``` |
39 | | - |
40 | | -* Poetry |
41 | | - |
42 | | -``` |
43 | | -[tool.poetry.dependencies] |
44 | | -reqstool-python-decorators = "<version>" |
45 | | -``` |
46 | | - |
47 | | -### Decorators |
48 | | - |
49 | | -Import decorators: |
50 | | - |
51 | | -``` |
| 23 | +```python |
52 | 24 | from reqstool_python_decorators.decorators.decorators import Requirements, SVCs |
53 | | -``` |
54 | | - |
55 | | -Example usage of the decorators: |
56 | 25 |
|
57 | | -``` |
58 | 26 | @Requirements("REQ_111", "REQ_222") |
59 | 27 | def somefunction(): |
60 | | -``` |
| 28 | + pass |
61 | 29 |
|
62 | | -``` |
63 | 30 | @SVCs("SVC_111", "SVC_222") |
64 | 31 | def test_somefunction(): |
| 32 | + pass |
65 | 33 | ``` |
66 | 34 |
|
67 | 35 | ### Processor |
68 | 36 |
|
69 | | -Import processor: |
70 | | - |
71 | | -``` |
| 37 | +```python |
72 | 38 | from reqstool_python_decorators.processors.decorator_processor import DecoratorProcessor |
73 | | -``` |
74 | | - |
75 | | -Main function to collect decorators data and generate yaml file: |
76 | 39 |
|
77 | | -``` |
| 40 | +# Collect decorators and generate annotations.yml |
78 | 41 | process_decorated_data(path_to_python_files, output_file) |
79 | 42 | ``` |
80 | 43 |
|
81 | | -`path_to_python_files` is the directories to search through to find decorated code. |
| 44 | +Used together with the [Hatch Plugin](https://github.com/reqstool/reqstool-python-hatch-plugin) or [Poetry Plugin](https://github.com/reqstool/reqstool-python-poetry-plugin). |
| 45 | + |
| 46 | +## Documentation |
| 47 | + |
| 48 | +Full documentation can be found [here](https://reqstool.github.io). |
82 | 49 |
|
83 | | -(Optional) `output_file` is output file(path) the yaml file is stored to. Default is `/build/reqstool/annotations.yml`. |
| 50 | +## Contributing |
84 | 51 |
|
| 52 | +See the organization-wide [CONTRIBUTING.md](https://github.com/reqstool/.github/blob/main/CONTRIBUTING.md). |
85 | 53 |
|
86 | 54 | ## License |
87 | 55 |
|
88 | | -This project is licensed under the MIT License - see the LICENSE.md file for details. |
| 56 | +MIT License. |
0 commit comments