mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-18 02:40:07 +00:00
test(py3): Move temporary porting utilities
Move some Python 3 porting utility targets out of the root `./Makefile` and into the appropriate `./misc/*/` directory.
This commit is contained in:
parent
dc203e2fb2
commit
b6af065881
23
Makefile
23
Makefile
@ -242,26 +242,3 @@ src/allmydata/_version.py:
|
|||||||
|
|
||||||
.tox: tox.ini setup.py
|
.tox: tox.ini setup.py
|
||||||
tox --notest -p all
|
tox --notest -p all
|
||||||
|
|
||||||
|
|
||||||
# BBB: Python 3 porting targets
|
|
||||||
|
|
||||||
# Gauge the impact of changes on Python 3 compatibility
|
|
||||||
# Compare the output from running all tests under Python 3 before and after changes.
|
|
||||||
# Before changes:
|
|
||||||
# `$ rm -f .tox/make-test-py3-all-*.log && make .tox/make-test-py3-all-old.log`
|
|
||||||
# After changes:
|
|
||||||
# `$ make .tox/make-test-py3-all.diff`
|
|
||||||
$(foreach side,old new,.tox/make-test-py3-all-$(side).log):
|
|
||||||
tox --develop --notest -e py36-coverage
|
|
||||||
(make VIRTUAL_ENV=.tox/py36-coverage TEST_SUITE=allmydata test-venv-coverage \
|
|
||||||
|| true) | \
|
|
||||||
sed -E 's/\([0-9]+\.[0-9]{3} secs\)/(#.### secs)/' | tee "$(@)"
|
|
||||||
.tox/make-test-py3-all.diff: .tox/make-test-py3-all-new.log
|
|
||||||
(diff -u "$(<:%-new.log=%-old.log)" "$(<)" || true) | tee "$(@)"
|
|
||||||
|
|
||||||
# Locate modules that are candidates for naively converting `unicode` -> `str`.
|
|
||||||
# List all Python source files that reference `unicode` but don't reference `str`
|
|
||||||
.tox/py3-unicode-no-str.ls:
|
|
||||||
find src -type f -iname '*.py' -exec grep -l -E '\Wunicode\W' '{}' ';' | \
|
|
||||||
xargs grep -L '\Wstr\W' | xargs ls -ld | tee "$(@)"
|
|
||||||
|
46
misc/python3/Makefile
Normal file
46
misc/python3/Makefile
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
# BBB: Python 3 porting targets
|
||||||
|
#
|
||||||
|
# NOTE: this Makefile requires GNU make
|
||||||
|
|
||||||
|
### Defensive settings for make:
|
||||||
|
# https://tech.davis-hansson.com/p/make/
|
||||||
|
SHELL := bash
|
||||||
|
.ONESHELL:
|
||||||
|
.SHELLFLAGS := -xeu -o pipefail -c
|
||||||
|
.SILENT:
|
||||||
|
.DELETE_ON_ERROR:
|
||||||
|
MAKEFLAGS += --warn-undefined-variables
|
||||||
|
MAKEFLAGS += --no-builtin-rules
|
||||||
|
|
||||||
|
|
||||||
|
# Top-level, phony targets
|
||||||
|
|
||||||
|
.PHONY: default
|
||||||
|
default:
|
||||||
|
@echo "no default target"
|
||||||
|
|
||||||
|
|
||||||
|
# Real targets
|
||||||
|
|
||||||
|
# Gauge the impact of changes on Python 3 compatibility
|
||||||
|
# Compare the output from running all tests under Python 3 before and after changes.
|
||||||
|
# Before changes:
|
||||||
|
# `$ rm -f .tox/make-test-py3-all-*.log && make .tox/make-test-py3-all-old.log`
|
||||||
|
# After changes:
|
||||||
|
# `$ make .tox/make-test-py3-all.diff`
|
||||||
|
$(foreach side,old new,../../.tox/make-test-py3-all-$(side).log):
|
||||||
|
cd "../../"
|
||||||
|
tox --develop --notest -e py36-coverage
|
||||||
|
(make VIRTUAL_ENV=./.tox/py36-coverage TEST_SUITE=allmydata \
|
||||||
|
test-venv-coverage || true) | \
|
||||||
|
sed -E 's/\([0-9]+\.[0-9]{3} secs\)/(#.### secs)/' | \
|
||||||
|
tee "./misc/python3/$(@)"
|
||||||
|
../../.tox/make-test-py3-all.diff: ../../.tox/make-test-py3-all-new.log
|
||||||
|
(diff -u "$(<:%-new.log=%-old.log)" "$(<)" || true) | tee "$(@)"
|
||||||
|
|
||||||
|
# Locate modules that are candidates for naively converting `unicode` -> `str`.
|
||||||
|
# List all Python source files that reference `unicode` but don't reference `str`
|
||||||
|
../../.tox/py3-unicode-no-str.ls:
|
||||||
|
cd "../../"
|
||||||
|
find src -type f -iname '*.py' -exec grep -l -E '\Wunicode\W' '{}' ';' | \
|
||||||
|
xargs grep -L '\Wstr\W' | xargs ls -ld | tee "./misc/python3/$(@)"
|
Loading…
Reference in New Issue
Block a user