From a501d569195c0be3b57c8806548a147706ee9544 Mon Sep 17 00:00:00 2001 From: Hauke D Date: Thu, 9 Jan 2025 11:39:10 +0100 Subject: [PATCH] Use `python` instead of `python3` --- .devcontainer/devcontainer.json | 27 +++++++++++++-------------- .devcontainer/initialize.sh | 6 +++--- .github/workflows/tests.yml | 4 ++-- checksum.py | 2 +- checksum_gui.py | 2 +- datatypes.py | 2 +- deltaparse.py | 2 +- hashedfile.py | 2 +- jsonvalidate.py | 2 +- loggerdata/importdefs.py | 2 +- loggerdata/importer.py | 2 +- loggerdata/metadata.py | 2 +- loggerdata/qualitycheck.py | 2 +- loggerdata/toa5/__init__.py | 2 +- loggerdata/toa5/dataimport.py | 2 +- loggerdata/toa5/pandas.py | 2 +- lsb_obo.py | 2 +- prove.sh | 2 +- requirements.txt | 4 ++-- safe_filenames_check.py | 2 +- sqlite3helper.py | 2 +- tests/test_checksum.py | 2 +- tests/test_datatypes.py | 2 +- tests/test_deltaparse.py | 2 +- tests/test_hashedfile.py | 2 +- tests/test_jsonvalidate.py | 2 +- tests/test_logger_importdefs.py | 2 +- tests/test_logger_importer.py | 2 +- tests/test_logger_metadata.py | 2 +- tests/test_logger_qualitycheck.py | 2 +- tests/test_lsb_obo.py | 2 +- tests/test_safe_filenames_check.py | 2 +- tests/test_sqlite3helper.py | 2 +- tests/test_toa5.py | 2 +- tests/test_toa5_dataimport.py | 2 +- tests/test_toa5_pandas.py | 2 +- tests/test_uniutils.py | 2 +- uniutils.py | 2 +- 38 files changed, 54 insertions(+), 55 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 788ddb5..6af052d 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,16 +1,15 @@ -// https://aka.ms/devcontainer.json -{ - "image": "mcr.microsoft.com/devcontainers/python:1-3.12-bookworm", - "features": { - "ghcr.io/devcontainers/features/common-utils:2": { - "installZsh": false, - "installOhMyZsh": false, - "installOhMyZshConfig": false, - "username": "none", - "nonFreePackages": true - }, +{ // https://aka.ms/devcontainer.json + // https://github.com/devcontainers/images/tree/main/src/python + "image": "mcr.microsoft.com/devcontainers/python:3.13-bookworm", + "features": { + /* `features/common-utils` is already in the python image; it's missing non-free + * packages, but that's only manpages-posix and manpages-posix-dev. */ + // "ghcr.io/devcontainers/features/node:1": {}, + // "ghcr.io/devcontainers/features/docker-in-docker:2": {}, + // "ghcr.io/haukex/devcontainer-features/perl:1": {}, "ghcr.io/lukewiwa/features/shellcheck:0": {}, "ghcr.io/guiyomh/features/vim:0": {} - }, - "postCreateCommand": ".devcontainer/initialize.sh" -} \ No newline at end of file + }, + "postCreateCommand": ".devcontainer/initialize.sh" +} +/* vim: set filetype=javascript ts=4 sw=4 expandtab : */ diff --git a/.devcontainer/initialize.sh b/.devcontainer/initialize.sh index aa30161..ba65c96 100755 --- a/.devcontainer/initialize.sh +++ b/.devcontainer/initialize.sh @@ -2,8 +2,8 @@ set -euxo pipefail cd "$( dirname "${BASH_SOURCE[0]}" )"/.. -python3 -m venv .venv +python -m venv .venv # shellcheck source=/dev/null source .venv/bin/activate -python3 -m pip install --upgrade pip wheel -pip install -r requirements.txt -r requirements-dev.txt +python -m pip install --upgrade pip wheel +python -m pip install -r requirements.txt -r requirements-dev.txt diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ab0946d..e64d0b5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -30,7 +30,7 @@ jobs: requirements-dev.txt - name: Install dependencies run: | - python3 -m pip install --upgrade pip wheel - pip install -r requirements.txt -r requirements-dev.txt + python -m pip install --upgrade pip wheel + python -m pip install -r requirements.txt -r requirements-dev.txt - name: Run tests run: ./prove.sh diff --git a/checksum.py b/checksum.py index 902d4e3..484a6d8 100755 --- a/checksum.py +++ b/checksum.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """File checksumming tool. Author, Copyright, and License diff --git a/checksum_gui.py b/checksum_gui.py index dd7bb28..b8e7810 100755 --- a/checksum_gui.py +++ b/checksum_gui.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """Graphical frontend for file checksumming tool. Author, Copyright, and License diff --git a/datatypes.py b/datatypes.py index 2c01fae..07d1e48 100755 --- a/datatypes.py +++ b/datatypes.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """Data type library with type checks and type inferral. These types are based on and are compatible with Postgres data types, but are diff --git a/deltaparse.py b/deltaparse.py index 7d79fb2..4018792 100755 --- a/deltaparse.py +++ b/deltaparse.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """Parser for "time delta" strings. Author, Copyright, and License diff --git a/hashedfile.py b/hashedfile.py index a5d00ba..8578e47 100644 --- a/hashedfile.py +++ b/hashedfile.py @@ -1,4 +1,4 @@ -#!python3 +#!python """A library for representing files together with their hashes. Author, Copyright, and License diff --git a/jsonvalidate.py b/jsonvalidate.py index 85b09b2..d566148 100755 --- a/jsonvalidate.py +++ b/jsonvalidate.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """Utility functions to load and validate JSON Schemas. Author, Copyright, and License diff --git a/loggerdata/importdefs.py b/loggerdata/importdefs.py index 337b465..4e2b2f8 100644 --- a/loggerdata/importdefs.py +++ b/loggerdata/importdefs.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """Common definitions used in the importing of logger data. Author, Copyright, and License diff --git a/loggerdata/importer.py b/loggerdata/importer.py index 33337ba..6a98e3e 100644 --- a/loggerdata/importer.py +++ b/loggerdata/importer.py @@ -1,4 +1,4 @@ -#!python3 +#!python """General-purpose logger data importer functions. Author, Copyright, and License diff --git a/loggerdata/metadata.py b/loggerdata/metadata.py index b6d52a6..04b6b44 100755 --- a/loggerdata/metadata.py +++ b/loggerdata/metadata.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """Metadata for representing datalogger data tables. Author, Copyright, and License diff --git a/loggerdata/qualitycheck.py b/loggerdata/qualitycheck.py index a68b035..bca26d1 100644 --- a/loggerdata/qualitycheck.py +++ b/loggerdata/qualitycheck.py @@ -1,4 +1,4 @@ -#!python3 +#!python """Basic Data Quality checking functions Author, Copyright, and License diff --git a/loggerdata/toa5/__init__.py b/loggerdata/toa5/__init__.py index b70a462..7cfdba8 100644 --- a/loggerdata/toa5/__init__.py +++ b/loggerdata/toa5/__init__.py @@ -1,4 +1,4 @@ -#!python3 +#!python """Functions for handling TOA5 files. .. deprecated:: 2024-10-18 diff --git a/loggerdata/toa5/dataimport.py b/loggerdata/toa5/dataimport.py index e286eef..a5f8ba0 100644 --- a/loggerdata/toa5/dataimport.py +++ b/loggerdata/toa5/dataimport.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """Functions for importing TOA5 data files. Author, Copyright, and License diff --git a/loggerdata/toa5/pandas.py b/loggerdata/toa5/pandas.py index 2f6db9a..c47f104 100644 --- a/loggerdata/toa5/pandas.py +++ b/loggerdata/toa5/pandas.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """Functions for reading TOA5 files into Pandas data frames. Author, Copyright, and License diff --git a/lsb_obo.py b/lsb_obo.py index 8bac6e3..842f4bf 100644 --- a/lsb_obo.py +++ b/lsb_obo.py @@ -1,4 +1,4 @@ -#!python3 +#!python """Test whether two decimal numbers are off-by-one on their least significant digit. Author, Copyright, and License diff --git a/prove.sh b/prove.sh index 66941bb..73a395a 100755 --- a/prove.sh +++ b/prove.sh @@ -3,7 +3,7 @@ set -euo pipefail cd "$(dirname "${BASH_SOURCE[0]}")" || exit 1 if [ "$OSTYPE" == "msys" ] # e.g. Git bash on Windows then - PYTHONWARNDEFAULTENCODING=1 python3 -m unittest "$@" + PYTHONWARNDEFAULTENCODING=1 python -m unittest "$@" else PYTHONWARNDEFAULTENCODING=1 coverage run --branch -m unittest "$@" if coverage report --skip-covered --show-missing --fail-under=100 diff --git a/requirements.txt b/requirements.txt index 7c93f25..45988ce 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ -# python3 -m pip install --upgrade pip wheel -# pip3 install --upgrade --upgrade-strategy=eager -r requirements.txt +# python -m pip install --upgrade pip wheel +# python -m pip install --upgrade --upgrade-strategy=eager -r requirements.txt more-itertools >= 9.1.0 igbpyutils >= 0.3.2 Unidecode diff --git a/safe_filenames_check.py b/safe_filenames_check.py index a6e0f47..1e64309 100755 --- a/safe_filenames_check.py +++ b/safe_filenames_check.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """Utility to check for Windows-safe filenames. Author, Copyright, and License diff --git a/sqlite3helper.py b/sqlite3helper.py index 299f077..fd3370d 100644 --- a/sqlite3helper.py +++ b/sqlite3helper.py @@ -1,4 +1,4 @@ -#!python3 +#!python """Helpers for SQLite3 databases used as logger data storage. The functions in this module provide helpers for our use case of importing diff --git a/tests/test_checksum.py b/tests/test_checksum.py index 868525f..8768a20 100755 --- a/tests/test_checksum.py +++ b/tests/test_checksum.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """Tests for file checksumming tool. Author, Copyright, and License diff --git a/tests/test_datatypes.py b/tests/test_datatypes.py index 09fe92f..1915c35 100755 --- a/tests/test_datatypes.py +++ b/tests/test_datatypes.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """Tests for datatypes library. Author, Copyright, and License diff --git a/tests/test_deltaparse.py b/tests/test_deltaparse.py index ac811f3..16ad4ee 100755 --- a/tests/test_deltaparse.py +++ b/tests/test_deltaparse.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """Tests for deltaparse. Author, Copyright, and License diff --git a/tests/test_hashedfile.py b/tests/test_hashedfile.py index 25c0977..70ff9cf 100755 --- a/tests/test_hashedfile.py +++ b/tests/test_hashedfile.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """Tests for hashedfile library. Author, Copyright, and License diff --git a/tests/test_jsonvalidate.py b/tests/test_jsonvalidate.py index 6084c24..e3bf3f6 100755 --- a/tests/test_jsonvalidate.py +++ b/tests/test_jsonvalidate.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """Tests for jsonvalidate. Author, Copyright, and License diff --git a/tests/test_logger_importdefs.py b/tests/test_logger_importdefs.py index 65def2d..7138788 100755 --- a/tests/test_logger_importdefs.py +++ b/tests/test_logger_importdefs.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """Tests for loggerdata.importdefs Author, Copyright, and License diff --git a/tests/test_logger_importer.py b/tests/test_logger_importer.py index dfca60f..4e6ee63 100755 --- a/tests/test_logger_importer.py +++ b/tests/test_logger_importer.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """Tests for loggerdata.importer Author, Copyright, and License diff --git a/tests/test_logger_metadata.py b/tests/test_logger_metadata.py index 82449af..6f3eac4 100755 --- a/tests/test_logger_metadata.py +++ b/tests/test_logger_metadata.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """Tests for loggerdata.metadata. Author, Copyright, and License diff --git a/tests/test_logger_qualitycheck.py b/tests/test_logger_qualitycheck.py index 53b04b3..37ae543 100755 --- a/tests/test_logger_qualitycheck.py +++ b/tests/test_logger_qualitycheck.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """Tests for loggerdata.qualitycheck. Author, Copyright, and License diff --git a/tests/test_lsb_obo.py b/tests/test_lsb_obo.py index c0e7f5d..aac194e 100755 --- a/tests/test_lsb_obo.py +++ b/tests/test_lsb_obo.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """Tests for lsb_obo. Author, Copyright, and License diff --git a/tests/test_safe_filenames_check.py b/tests/test_safe_filenames_check.py index 2e32d81..40f6e75 100755 --- a/tests/test_safe_filenames_check.py +++ b/tests/test_safe_filenames_check.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """Tests for uniutils. Author, Copyright, and License diff --git a/tests/test_sqlite3helper.py b/tests/test_sqlite3helper.py index e7b266e..0db1724 100755 --- a/tests/test_sqlite3helper.py +++ b/tests/test_sqlite3helper.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """Tests for Sqlite3 Helper. Author, Copyright, and License diff --git a/tests/test_toa5.py b/tests/test_toa5.py index 5ccf899..7e424fb 100755 --- a/tests/test_toa5.py +++ b/tests/test_toa5.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """Tests for loggerdata.toa5. Author, Copyright, and License diff --git a/tests/test_toa5_dataimport.py b/tests/test_toa5_dataimport.py index 1e650d7..0eea19b 100755 --- a/tests/test_toa5_dataimport.py +++ b/tests/test_toa5_dataimport.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """Tests for loggerdata.toa5.dataimport Author, Copyright, and License diff --git a/tests/test_toa5_pandas.py b/tests/test_toa5_pandas.py index 7d0378d..9c6c163 100755 --- a/tests/test_toa5_pandas.py +++ b/tests/test_toa5_pandas.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """Tests for loggerdata.toa5.pandas Author, Copyright, and License diff --git a/tests/test_uniutils.py b/tests/test_uniutils.py index 60764c9..825c8a7 100755 --- a/tests/test_uniutils.py +++ b/tests/test_uniutils.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """Tests for uniutils. Author, Copyright, and License diff --git a/uniutils.py b/uniutils.py index 7fe42ed..10ad4b4 100755 --- a/uniutils.py +++ b/uniutils.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """Various Unicode related utility functions. Author, Copyright, and License