Skip to content

Commit 988e7cc

Browse files
Author FelixAbrahamssonJim-Holmstroem
authored andcommitted
feature: patch script for python 3.6
1 parent be68f0d commit 988e7cc

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

dev_requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
strip-hints==0.1.9

patch-python3.6.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
# ./patch-python3.6.sh
3+
set -o errexit -o nounset -o pipefail -o xtrace
4+
5+
command -v strip-hints
6+
7+
for f in $(find datastream/ -name '*.py');
8+
do
9+
sed -i 's/#.*//g' $f;
10+
strip-hints $f --to-empty --strip-nl > /tmp/.stripped_hints;
11+
mv /tmp/.stripped_hints $f;
12+
sed -i '/from __future__ import annotations/d' $f;
13+
sed -i 's/Generic\(\[[A-Z]\]\)\?\(\s*,\s*\)\?//g' $f;
14+
sed -i 's/#//g' $f;
15+
done
16+
17+
sed -i 's/Dataset\[[A-Z]\]/Dataset/g' datastream/datastream.py;
18+
19+
sed -i -E 's/(Programming *Language *:: *Python *:: *)3.7/\13.6/' setup.cfg
20+
sed -i '/Programming Language :: Python :: 3.8/d' setup.cfg
21+
22+
sed -i 's/python/python3.6/g' publish.sh
23+
sed -i -E 's/(VERSION_TAG=)(.*)(")$/\1\2+python3.6\3/' publish.sh
24+
sed -i '/test -z.*exit 2/d' publish.sh
25+
sed -i '/test -z.*exit 3/d' publish.sh

0 commit comments

Comments
 (0)