diff --git a/bin/copyparty-fuse.py b/bin/copyparty-fuse.py index 2d81f295..09aca803 100755 --- a/bin/copyparty-fuse.py +++ b/bin/copyparty-fuse.py @@ -17,9 +17,14 @@ import threading import http.client # py2: httplib import urllib.parse from datetime import datetime -from fuse import FUSE, FuseOSError, Operations from urllib.parse import quote_from_bytes as quote +try: + from fuse import FUSE, FuseOSError, Operations +except: + print("\n could not import fuse;\n pip install fusepy\n") + raise + """ mount a copyparty server (local or remote) as a filesystem diff --git a/copyparty/__version__.py b/copyparty/__version__.py index bf6440a4..641c70e5 100644 --- a/copyparty/__version__.py +++ b/copyparty/__version__.py @@ -1,6 +1,6 @@ # coding: utf-8 -VERSION = (0, 2, 1) +VERSION = (0, 2, 3) BUILD_DT = (2020, 1, 19) S_VERSION = ".".join(map(str, VERSION)) diff --git a/scripts/make-pypi-release.sh b/scripts/make-pypi-release.sh index 26c613ff..06a39b68 100755 --- a/scripts/make-pypi-release.sh +++ b/scripts/make-pypi-release.sh @@ -13,15 +13,15 @@ which md5sum 2>/dev/null >/dev/null && mode="$1" -[[ "x$mode" == x ]] && +[ -z "$mode" ] && { - echo "need argument 1: (D)ry or (U)pload" + echo "need argument 1: (D)ry, (T)est, (U)pload" echo exit 1 } -[[ -e copyparty/__main__.py ]] || cd .. -[[ -e copyparty/__main__.py ]] || +[ -e copyparty/__main__.py ] || cd .. +[ -e copyparty/__main__.py ] || { echo "run me from within the copyparty folder" echo @@ -39,13 +39,14 @@ index-servers = pypitest [pypi] -username=qwer -password=asdf +repository: https://upload.pypi.org/legacy/ +username: qwer +password: asdf [pypitest] repository: https://test.pypi.org/legacy/ -username=qwer -password=asdf +username: qwer +password: asdf EOF # set pypi password @@ -54,15 +55,11 @@ EOF # if PY2: create build env cd ~/dev/copyparty && virtualenv buildenv - (. buildenv/bin/activate && pip install m2r) + (. buildenv/bin/activate && pip install twine) # if PY3: create build env cd ~/dev/copyparty && python3 -m venv buildenv - (. buildenv/bin/activate && pip install m2r wheel) - - # test rst - pip install docutils - ./setup.py --long-description | tee ~/Desktop/rst | rst2html.py > ~/Desktop/rst.html + (. buildenv/bin/activate && pip install twine wheel) } @@ -72,7 +69,7 @@ pydir="$( sed -r 's@[^/]*$@@' )" -[[ -e "$pydir/activate" ]] && +[ -e "$pydir/activate" ] && { echo '`deactivate` your virtualenv' exit 1 @@ -85,12 +82,12 @@ function have() { . buildenv/bin/activate have setuptools have wheel -have m2r +have twine ./setup.py clean2 -./setup.py rstconv ./setup.py sdist bdist_wheel --universal -[[ "x$mode" == "xu" ]] && - ./setup.py sdist bdist_wheel upload -r pypi + +[ "$mode" == t ] && twine upload -r pypitest dist/* +[ "$mode" == u ] && twine upload -r pypi dist/* cat <", ":sub:`") - rst = rst.replace("`", "`") - - with open(rst_fn, "wb") as f: - f.write(rst.encode("utf-8")) - - args = { "name": NAME, "version": about["__version__"], "description": "http file sharing hub", - "long_description": LONG_DESCRIPTION, - "long_description_content_type": LDCT, + "long_description": long_description, + "long_description_content_type": "text/markdown", "author": "ed", "author_email": "copyparty@ocv.me", "url": "https://github.com/9001/copyparty", "license": "MIT", "data_files": data_files, "classifiers": [ - "Development Status :: 5 - Production/Stable", + "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2", @@ -174,29 +116,39 @@ args = { "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Environment :: Console", - "Topic :: Communications :: Chat", + "Environment :: No Input/Output (Daemon)", + "Topic :: Communications :: File Sharing", ], - "cmdclass": {"rstconv": rstconv, "clean2": clean2}, + "cmdclass": {"clean2": clean2}, } if setuptools_available: args.update( { - "packages": ["copyparty"], + "packages": find_packages(), "install_requires": ["jinja2"], "extras_require": {"thumbnails": ["Pillow"]}, "include_package_data": True, "entry_points": { "console_scripts": ["copyparty = copyparty.__main__:main"] }, + "scripts": [ + "bin/copyparty-fuse.py" + ] } ) else: - args.update({"packages": ["copyparty"], "scripts": ["bin/copyparty"]}) + args.update( + { + "packages": ["copyparty", "copyparty.stolen"], + "scripts": ["bin/copyparty", "bin/copyparty-fuse.py"] + } + ) # import pprint