From 2ec15ca8fa44c20528603ac0f667d6d7fc343fae Mon Sep 17 00:00:00 2001 From: John Ellis Date: Mon, 5 Jul 2021 07:24:04 -0400 Subject: [PATCH] Migration to Python 3 (#30) --- BUILDING | 12 ++++++------ docs/INSTALLING.md | 6 +++--- lib/tallypi/webapp/routes.py | 3 --- scripts/run_server.py | 2 +- setup.py | 2 +- stdeb.cfg | 2 +- 6 files changed, 12 insertions(+), 15 deletions(-) diff --git a/BUILDING b/BUILDING index fff3f31..0d7faa3 100644 --- a/BUILDING +++ b/BUILDING @@ -3,25 +3,25 @@ Building Binary Distributions Distributions are generated using stdeb, execute it on the Raspberry Pi to build for the correct architecture: - python setup.py --command-packages=stdeb.command bdist_deb + python3 setup.py --command-packages=stdeb.command bdist_deb To debug installation: - sudo dpkg -D113 -i ../python-tallypi_0.1.0-1_all.deb + sudo dpkg -D113 -i ../python3-tallypi_0.1.0-1_all.deb To completely uninstall: - sudo dpkg -P python-tallypi + sudo dpkg -P python3-tallypi To verify the files inside the package: - dpkg -c deb_dist/python-tallypi_0.1.0-1_all.deb + dpkg -c deb_dist/python3-tallypi_0.1.0-1_all.deb Requirements ============ -Requires python-stdeb and debhelper +Requires python3-stdeb and debhelper Generating Debian Metadata @@ -31,7 +31,7 @@ stdeb generates the debian/ folder automatically & this is version controlled. However, if it needs regeneration one can save python-tallypi.postinst to a separate directory, delete the debian/ directory, then re-issue: - python ./setup.py --command-packages=stdeb.command debianize + python3 ./setup.py --command-packages=stdeb.command debianize Running Locally diff --git a/docs/INSTALLING.md b/docs/INSTALLING.md index 1a34f61..6f2d22f 100644 --- a/docs/INSTALLING.md +++ b/docs/INSTALLING.md @@ -100,16 +100,16 @@ an SSH session: To install the TallyPi software, first install Python requirements from an SSH session on your Pi: - apt-get install python-bottle python-paste + apt-get install python3-bottle python3-paste Next, use wget to get the latest package of TallyPi from the release page at https://github.com/deckerego/tally_pi/releases. For example: - wget https://github.com/deckerego/tally_pi/releases/download/0.3.1/python-tallypi_0.3.1-1_all.deb + wget https://github.com/deckerego/tally_pi/releases/download/0.3.1/python3-tallypi_0.3.1-1_all.deb After downloading the package, install it using: - dpkg -i python-tallypi_0.3.1-1_all.deb + dpkg -i python3-tallypi_0.3.1-1_all.deb Once the software is installed, you can enable it with: diff --git a/lib/tallypi/webapp/routes.py b/lib/tallypi/webapp/routes.py index 0cd48f6..8959432 100644 --- a/lib/tallypi/webapp/routes.py +++ b/lib/tallypi/webapp/routes.py @@ -1,6 +1,3 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - import logging import socket diff --git a/scripts/run_server.py b/scripts/run_server.py index ffb03dd..dbafee8 100755 --- a/scripts/run_server.py +++ b/scripts/run_server.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os diff --git a/setup.py b/setup.py index 6ec8ac0..8b4c4a7 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- from distutils.core import setup diff --git a/stdeb.cfg b/stdeb.cfg index bec82dd..004fee8 100644 --- a/stdeb.cfg +++ b/stdeb.cfg @@ -1,3 +1,3 @@ [DEFAULT] -Depends: python-bottle, python-paste +Depends: python3-bottle, python3-paste XS-Python-Version: >= 2.7