Skip to content

Commit

Permalink
Add all sources to new folder src (#13)
Browse files Browse the repository at this point in the history
* Add all sources to new folder `src`

* Fix lint action

* Fix config file path

* Update readme with the new path
  • Loading branch information
damyan authored Jan 24, 2024
1 parent 42c0e16 commit c956755
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pylint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v4
- uses: Silleellie/pylint-github-action@v2
with:
lint-path: ./
lint-path: ./src
python-version: 3.11
requirements-path: requirements.txt
readme-path: README.md
2 changes: 1 addition & 1 deletion .github/workflows/python-test-and-run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
run: pip install -r requirements.txt

- name: Run kicktipp
run: ./auto_submit_tips.py -h
run: ./src/auto_submit_tips.py -h
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,13 @@ pip install -r requirements.txt
# Execution

```bash
./auto_submit_tips.py
./src/auto_submit_tips.py -h
usage: Kicktipp auto tipping [-h] [-2 | -r]

Perform automatic kicktipp tipping for the bots

options:
-h, --help show this help message and exit
-2 2:1 tipping
-r random tipping
```
File renamed without changes.
7 changes: 5 additions & 2 deletions auto_submit_tips.py → src/auto_submit_tips.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import argparse
import logging
import random
import os
import subprocess
import sys
import yaml
Expand All @@ -19,7 +20,7 @@
TIPPER_ID_2_1_BOT = "46952968" # 2:1 bot
TIPPER_ID_7_6_BOT = "50360538" # random bot
TIPP_SAISON_ID = "1670602"
CREDS_FILE = "creds-secret.yaml"
CREDS_FILE_PATH = "config/creds-secret.yaml"

RANDOM_RESULTS = []

Expand Down Expand Up @@ -78,7 +79,9 @@ def get_creds() -> tuple[str, str]:
return(string): password, if successfully decrypted, None else
"""
try:
result = subprocess.run(['sops', '-d', CREDS_FILE],
full_config_file_path = os.path.join(os.path.dirname(__file__),
CREDS_FILE_PATH)
result = subprocess.run(['sops', '-d', full_config_file_path],
capture_output=True,
check=True,
text=True)
Expand Down
File renamed without changes.

0 comments on commit c956755

Please sign in to comment.