fix testrunner + packaging

This commit is contained in:
ed 2022-12-03 15:07:47 +00:00
parent 89ba12065c
commit 8ef4a0aa71
10 changed files with 61 additions and 29 deletions

View file

@ -1,5 +0,0 @@
cd %~dp0\..
python setup.py clean2
python setup.py rstconv
python setup.py sdist bdist_wheel --universal
REM python setup.py sdist upload -r pypi

View file

@ -55,14 +55,6 @@ EOF
# set pypi password
chmod 600 ~/.pypirc
sed -ri 's/qwer/username/;s/asdf/password/' ~/.pypirc
# if PY2: create build env
cd ~/dev/copyparty && virtualenv buildenv
(. buildenv/bin/activate && pip install twine)
# if PY3: create build env
cd ~/dev/copyparty && python3 -m venv buildenv
(. buildenv/bin/activate && pip install twine wheel)
}
@ -82,15 +74,27 @@ function have() {
python -c "import $1; $1; $1.__version__"
}
. buildenv/bin/activate
have setuptools
have wheel
have twine
function load_env() {
. buildenv/bin/activate
have setuptools
have wheel
have twine
}
load_env || {
echo creating buildenv
deactivate || true
rm -rf buildenv
python3 -m venv buildenv
(. buildenv/bin/activate && pip install twine wheel)
load_env
}
# remove type hints to support python < 3.9
rm -rf build/pypi
mkdir -p build/pypi
cp -pR setup.py README.md LICENSE copyparty tests bin scripts/strip_hints build/pypi/
tar -c docs/lics.txt scripts/genlic.sh build/*.txt | tar -xC build/pypi/
cd build/pypi
f=../strip-hints-0.1.10.tar.gz
[ -e $f ] ||

View file

@ -5,6 +5,24 @@ rm -rf unt
mkdir -p unt/srv
cp -pR copyparty tests unt/
cd unt
# resolve symlinks
set +x
find -type l |
while IFS= read -r f1; do (
cd "${f1%/*}"
f1="./${f1##*/}"
f2="$(readlink "$f1")"
[ -e "$f2" ] || f2="../$f2"
[ -e "$f2" ] || {
echo could not resolve "$f1"
exit 1
}
rm "$f1"
cp -p "$f2" "$f1"
); done
set -x
python3 ../scripts/strip_hints/a.py
pids=()
@ -12,7 +30,7 @@ for py in python{2,3}; do
[ ${1:0:6} = python ] && [ $1 != $py ] && continue
PYTHONPATH=
[ $py = python2 ] && PYTHONPATH=../scripts/py2
[ $py = python2 ] && PYTHONPATH=../scripts/py2:../sfx/py37
export PYTHONPATH
nice $py -m unittest discover -s tests >/dev/null &

View file

@ -19,8 +19,8 @@ copyparty/httpconn.py,
copyparty/httpsrv.py,
copyparty/ico.py,
copyparty/mdns.py,
copyparty/multicast.py,
copyparty/mtag.py,
copyparty/multicast.py,
copyparty/res,
copyparty/res/COPYING.txt,
copyparty/res/insecure.pem,
@ -59,6 +59,7 @@ copyparty/vend/asynchat.py,
copyparty/vend/asyncore.py,
copyparty/web,
copyparty/web/a,
copyparty/web/a/__init__.py,
copyparty/web/a/partyfuse.py,
copyparty/web/a/up2k.py,
copyparty/web/a/webdav-cfg.bat,
@ -67,21 +68,23 @@ copyparty/web/browser.css,
copyparty/web/browser.html,
copyparty/web/browser.js,
copyparty/web/browser2.html,
copyparty/web/copyparty.gif,
copyparty/web/cf.html,
copyparty/web/copyparty.gif,
copyparty/web/dd,
copyparty/web/dd/2.png,
copyparty/web/dd/3.png,
copyparty/web/dd/4.png,
copyparty/web/dd/5.png,
copyparty/web/dd/__init__.py,
copyparty/web/deps,
copyparty/web/deps/__init__.py,
copyparty/web/deps/easymde.css,
copyparty/web/deps/easymde.js,
copyparty/web/deps/marked.js,
copyparty/web/deps/mini-fa.css,
copyparty/web/deps/mini-fa.woff,
copyparty/web/deps/prism.js,
copyparty/web/deps/prism.css,
copyparty/web/deps/prism.js,
copyparty/web/deps/prismd.css,
copyparty/web/deps/scp.woff2,
copyparty/web/deps/sha512.ac.js,