Skip to content

Commit

Permalink
fixing python version to 3.11 in the threader_job
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Philion committed Mar 14, 2024
1 parent b2c51a2 commit 2bf86ba
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
17 changes: 17 additions & 0 deletions test_synctime.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from dotenv import load_dotenv

import datetime as dt
import synctime
import test_utils

Expand Down Expand Up @@ -43,6 +44,22 @@ def test_redmine_times(self):
self.redmine.remove_ticket(ticket.id)


def test_redmine_isoformat(self):
date_str = "2024-03-14T17:45:11Z"
date = synctime.parse_str(date_str)
self.assertIsNotNone(date)
self.assertEqual(2024, date.year)
self.assertEqual(3, date.month)
self.assertEqual(14, date.day)

date2 = dt.datetime.fromisoformat(date_str)
self.assertIsNotNone(date2)
self.assertEqual(2024, date2.year)
self.assertEqual(3, date2.month)
self.assertEqual(14, date2.day)




if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG, format="{asctime} {levelname:<8s} {name:<16} {message}", style='{')
Expand Down
9 changes: 4 additions & 5 deletions threader_job.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@
# */5 * * * * /home/scn/github/netbot/threader_job.sh | /usr/bin/logger -t threader


name=$(basename "$0")
project_dir="$(cd -P -- "$(dirname -- "$0")" && pwd -P)"
cd "$project_dir" || exit 1

env="venv"
PYTHON="$project_dir/venv/bin/python3"
VENV=.venv
PYTHON="$project_dir/$VENV/bin/python3"

if [ ! -x "$PYTHON" ]; then
echo Building $env
python3 -m venv venv
echo Building $VENV
python3.11 -m venv $VENV
$PYTHON -m pip install --upgrade pip
$PYTHON -m pip install -r requirements.txt
fi
Expand Down

0 comments on commit 2bf86ba

Please sign in to comment.