ts: remove some Flickr-specific code
- ID
94c1cbb- date
2026-02-08 17:21:55+00:00- author
Alex Chan <alex@alexwlchan.net>- parent
61394ba- message
ts: remove some Flickr-specific code- changed files
1 file, 13 additions, 28 deletions
Changed files
ts (2992) → ts (2219)
diff --git a/ts b/ts
index 6fbaa98..8bfb67f 100755
--- a/ts
+++ b/ts
@@ -5,24 +5,6 @@ set -o nounset
function run_python_tests() {
REPO_NAME="$(basename $(pwd))"
-
- # In the test suites for flickr.org work, I need a Flickr API key
- # to run certain tests.
- #
- # If I need an API key for my tests, retrieve it from the keychain.
- if [[ "$REPO_NAME" = "commons.flickr.org" ]]
- then
- print_info 'export FLICKR_API_KEY=$(keyring get flickr_api key)'
- export FLICKR_API_KEY=$(keyring get flickr_api key)
-
- echo ""
- elif [[ "$REPO_NAME" = "data-lifeboat" ]]
- then
- print_info 'export FLICKR_API_KEY=$(keyring get data_lifeboat_creator flickr_client_key)'
- export FLICKR_API_KEY=$(keyring get data_lifeboat_creator flickr_client_key)
-
- echo ""
- fi
# Run ruff to do Python formatting
print_info "-> ruff check --fix"
@@ -47,20 +29,29 @@ function run_python_tests() {
fi
# This is one repo which is a bit special -- I'm gradually trying to chase
- # the code into `src`, but for now I have to remmeber to look at *.py
+ # the code into `src`, but for now I have to remember to look at *.py
if [[ "$REPO_NAME" = "library-lookup" ]]
then
print_info '-> mypy *.py src tests'
mypy *.py src tests
- else
+ elif [[ -d "src" ]]; then
print_info '-> mypy src tests'
-
+
if mypy src tests >/dev/null
then
mypy src tests --no-color-output
else
mypy src tests
fi
+ else
+ print_info '-> mypy *.py'
+
+ if mypy *.py >/dev/null
+ then
+ mypy *.py --no-color-output
+ else
+ mypy *.py
+ fi
fi
echo ""
@@ -70,13 +61,7 @@ function run_python_tests() {
# I have a couple of repos which are a bit special and need a
# different command because I use pytest-xdist, but not all
# my repos work that way.
- if [[ "$REPO_NAME" = "commons.flickr.org" ]]
- then
- print_info "-> pytest tests/ --ignore uptime_tests/ --quiet"
- pytest --cov=src --cov=tests tests --ignore uptime_tests --quiet
- elif [[ "$REPO_NAME" = "data-lifeboat" ]] ||
- [[ "$REPO_NAME" = "flickr-photos-api" ]] ||
- [[ "$REPO_NAME" = "analytics.alexwlchan.net" ]]
+ if [[ "$REPO_NAME" = "analytics.alexwlchan.net" ]]
then
print_info "-> pytest tests --cov=src --cov=tests"
pytest tests --cov=src --cov=tests --quiet