Skip to content

Commit a2980a0

Browse files
authored
Merge pull request #5 from itk-dev-rpa/release-v1
Release v1
2 parents 305822b + 400395e commit a2980a0

22 files changed

+286
-228
lines changed

.github/workflows/pylint.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Pylint
1+
name: Linting
22

33
on: [push]
44

@@ -14,10 +14,18 @@ jobs:
1414
uses: actions/setup-python@v3
1515
with:
1616
python-version: ${{ matrix.python-version }}
17+
1718
- name: Install dependencies
1819
run: |
1920
python -m pip install --upgrade pip
2021
pip install pylint
22+
pip install flake8
23+
pip install .
24+
2125
- name: Analysing the code with pylint
2226
run: |
2327
pylint --rcfile=.pylintrc $(git ls-files '*.py')
28+
29+
- name: Analysing the code with flake8
30+
run: |
31+
flake8 --extend-ignore=E501,E251 $(git ls-files '*.py')

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This repo is meant to be used as a template for robots made for [OpenOrchestrato
66

77
1. To use the template simply use the repo as a template as shown [here](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template).
88

9-
2. Fill out the requirements.txt file with all packages needed by the robot.
9+
2. Fill out the dependencies in the pyproject.toml file with all packages needed by the robot.
1010

1111
3. Implement all functions in the files:
1212
* src/initialize.py
@@ -15,12 +15,12 @@ This repo is meant to be used as a template for robots made for [OpenOrchestrato
1515
* src/process.py
1616
* Feel free to add more files as needed.
1717

18-
4. Make sure the smtp setup in error_screenshot.py is set up to your needs.
18+
4. Change config.py to your needs.
1919

20-
When the robot is run from OpenOrchestrator the main.bat file is run.
21-
main.bat does a few things:
20+
When the robot is run from OpenOrchestrator the main.py file is run.
21+
main.py does a few things:
2222
1. A virtual environment is automatically setup with the required packages.
23-
2. The framework is called passing on all arguments needed by [OpenOrchestratorConnection](https://github.com/itk-dev-rpa/OpenOrchestratorConnection).
23+
2. The framework is called passing on all arguments needed by [OpenOrchestrator](https://github.com/itk-dev-rpa/OpenOrchestrator).
2424

2525
## Requirements
2626
Minimum python version 3.10

Robot-Framework.drawio

Lines changed: 32 additions & 32 deletions
Large diffs are not rendered by default.

main.bat

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

main.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""The main file of the robot which will install all requirements in
2+
a virtual environment and then start the actual process.
3+
"""
4+
5+
import subprocess
6+
import os
7+
import sys
8+
9+
script_directory = os.path.dirname(os.path.realpath(__file__))
10+
os.chdir(script_directory)
11+
12+
subprocess.run("python -m venv .venv", check=True)
13+
subprocess.run(r'.venv\Scripts\pip install .', check=True)
14+
15+
command_args = [r".venv\Scripts\python", "-m", "robot_framework"] + sys.argv[1:]
16+
17+
subprocess.run(command_args, check=True)

pyproject.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[build-system]
2+
requires = ["setuptools>=65.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "robot_framework"
7+
version = "0.0.1"
8+
authors = [
9+
{ name="ITK Development", email="itk-rpa@mkb.aarhus.dk" },
10+
]
11+
readme = "README.md"
12+
requires-python = ">=3.11"
13+
classifiers = [
14+
"Programming Language :: Python :: 3",
15+
"License :: OSI Approved :: MIT License",
16+
"Operating System :: Microsoft :: Windows",
17+
]
18+
dependencies = [
19+
"OpenOrchestrator == 1.*",
20+
"Pillow == 9.5.0",
21+
]

requirements.txt

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

robot_framework/__init__.py

Whitespace-only changes.

robot_framework/__main__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
"""The entry point of the process."""
2+
3+
from robot_framework.framework import main
4+
main()

robot_framework/config.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"""This module contains configuration constants used across the framework"""
2+
3+
# The number of times the robot retries on an error before terminating.
4+
MAX_RETRY_COUNT = 3
5+
6+
# Error screenshot config
7+
SMTP_SERVER = "smtp.aarhuskommune.local"
8+
SMTP_PORT = 25
9+
SCREENSHOT_SENDER = "robot@friend.dk"

0 commit comments

Comments
 (0)