Skip to content

Commit a2d1787

Browse files
committed
release v0.2.3
1 parent e301f1a commit a2d1787

File tree

4 files changed

+47
-93
lines changed

4 files changed

+47
-93
lines changed

bin/copyparty-fuse.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,14 @@
1717
import http.client # py2: httplib
1818
import urllib.parse
1919
from datetime import datetime
20-
from fuse import FUSE, FuseOSError, Operations
2120
from urllib.parse import quote_from_bytes as quote
2221

22+
try:
23+
from fuse import FUSE, FuseOSError, Operations
24+
except:
25+
print("\n could not import fuse;\n pip install fusepy\n")
26+
raise
27+
2328

2429
"""
2530
mount a copyparty server (local or remote) as a filesystem

copyparty/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# coding: utf-8
22

3-
VERSION = (0, 2, 1)
3+
VERSION = (0, 2, 3)
44
BUILD_DT = (2020, 1, 19)
55

66
S_VERSION = ".".join(map(str, VERSION))

scripts/make-pypi-release.sh

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ which md5sum 2>/dev/null >/dev/null &&
1313

1414
mode="$1"
1515

16-
[[ "x$mode" == x ]] &&
16+
[ -z "$mode" ] &&
1717
{
18-
echo "need argument 1: (D)ry or (U)pload"
18+
echo "need argument 1: (D)ry, (T)est, (U)pload"
1919
echo
2020
exit 1
2121
}
2222

23-
[[ -e copyparty/__main__.py ]] || cd ..
24-
[[ -e copyparty/__main__.py ]] ||
23+
[ -e copyparty/__main__.py ] || cd ..
24+
[ -e copyparty/__main__.py ] ||
2525
{
2626
echo "run me from within the copyparty folder"
2727
echo
@@ -39,13 +39,14 @@ index-servers =
3939
pypitest
4040
4141
[pypi]
42-
username=qwer
43-
password=asdf
42+
repository: https://upload.pypi.org/legacy/
43+
username: qwer
44+
password: asdf
4445
4546
[pypitest]
4647
repository: https://test.pypi.org/legacy/
47-
username=qwer
48-
password=asdf
48+
username: qwer
49+
password: asdf
4950
EOF
5051

5152
# set pypi password
@@ -54,15 +55,11 @@ EOF
5455

5556
# if PY2: create build env
5657
cd ~/dev/copyparty && virtualenv buildenv
57-
(. buildenv/bin/activate && pip install m2r)
58+
(. buildenv/bin/activate && pip install twine)
5859

5960
# if PY3: create build env
6061
cd ~/dev/copyparty && python3 -m venv buildenv
61-
(. buildenv/bin/activate && pip install m2r wheel)
62-
63-
# test rst
64-
pip install docutils
65-
./setup.py --long-description | tee ~/Desktop/rst | rst2html.py > ~/Desktop/rst.html
62+
(. buildenv/bin/activate && pip install twine wheel)
6663
}
6764

6865

@@ -72,7 +69,7 @@ pydir="$(
7269
sed -r 's@[^/]*$@@'
7370
)"
7471

75-
[[ -e "$pydir/activate" ]] &&
72+
[ -e "$pydir/activate" ] &&
7673
{
7774
echo '`deactivate` your virtualenv'
7875
exit 1
@@ -85,12 +82,12 @@ function have() {
8582
. buildenv/bin/activate
8683
have setuptools
8784
have wheel
88-
have m2r
85+
have twine
8986
./setup.py clean2
90-
./setup.py rstconv
9187
./setup.py sdist bdist_wheel --universal
92-
[[ "x$mode" == "xu" ]] &&
93-
./setup.py sdist bdist_wheel upload -r pypi
88+
89+
[ "$mode" == t ] && twine upload -r pypitest dist/*
90+
[ "$mode" == u ] && twine upload -r pypi dist/*
9491

9592
cat <<EOF
9693

setup.py

Lines changed: 24 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
setuptools_available = True
1212
try:
1313
# need setuptools to build wheel
14-
from setuptools import setup, Command
14+
from setuptools import setup, Command, find_packages
1515

1616
except ImportError:
1717
# works in a pinch
@@ -25,43 +25,25 @@
2525
sys.exit(1)
2626

2727

28-
def mglob(dirname, extensions):
29-
ret = []
30-
for ext in extensions:
31-
ret.extend(glob(dirname + "/*." + ext))
32-
return ret
33-
34-
3528
NAME = "copyparty"
3629
VERSION = None
37-
data_files = [("share/doc/copyparty", ["README.rst", "README.md", "LICENSE"])]
30+
data_files = [("share/doc/copyparty", ["README.md", "LICENSE"])]
3831
manifest = ""
3932
for dontcare, files in data_files:
4033
for fn in files:
4134
manifest += "include {0}\n".format(fn)
4235

36+
manifest += "recursive-include copyparty/res *\n"
4337
manifest += "recursive-include copyparty/web *\n"
4438

4539
here = os.path.abspath(os.path.dirname(__file__))
4640

4741
with open(here + "/MANIFEST.in", "wb") as f:
4842
f.write(manifest.encode("utf-8"))
4943

50-
51-
try:
52-
LONG_DESCRIPTION = ""
53-
LDCT = ""
54-
with open(here + "/README.rst", "rb") as f:
55-
txt = f.read().decode("utf-8")
56-
txt = txt[txt.find("`") :]
57-
LONG_DESCRIPTION = txt
58-
LDCT = "text/x-rst"
59-
except:
60-
print("\n### could not open README.rst ###\n")
61-
with open(here + "/README.md", "rb") as f:
62-
txt = f.read().decode("utf-8")
63-
LONG_DESCRIPTION = txt
64-
LDCT = "text/markdown"
44+
with open(here + "/README.md", "rb") as f:
45+
txt = f.read().decode("utf-8")
46+
long_description = txt
6547

6648

6749
about = {}
@@ -99,70 +81,30 @@ def run(self):
9981
for (dirpath, dirnames, filenames) in os.walk("."):
10082
for fn in filenames:
10183
if (
102-
fn.endswith(".rst")
84+
fn.startswith("MANIFEST")
10385
or fn.endswith(".pyc")
10486
or fn.endswith(".pyo")
10587
or fn.endswith(".pyd")
106-
or fn.startswith("MANIFEST")
10788
):
10889
nuke.append(dirpath + "/" + fn)
10990

11091
for fn in nuke:
11192
os.unlink(fn)
11293

11394

114-
class rstconv(Command):
115-
description = "Converts markdown to rst"
116-
user_options = []
117-
118-
def initialize_options(self):
119-
pass
120-
121-
def finalize_options(self):
122-
pass
123-
124-
def run(self):
125-
self.proc_dir(".")
126-
self.proc_dir("docs")
127-
128-
def proc_dir(self, path):
129-
import m2r
130-
131-
for (dirpath, dirnames, filenames) in os.walk(path):
132-
133-
dirnames.sort()
134-
for fn in sorted(filenames):
135-
136-
fn = dirpath + "/" + fn
137-
if not fn.endswith(".md"):
138-
continue
139-
140-
rst_fn = fn[:-3] + ".rst"
141-
with open(fn, "rb") as f:
142-
md = f.read().decode("utf-8")
143-
144-
md = md.replace("* **[", "* [").replace(")** <-", ") <-")
145-
rst = m2r.convert(md)
146-
rst = rst.replace(":raw-html-m2r:`<del>", ":sub:`")
147-
rst = rst.replace("</del>`", "`")
148-
149-
with open(rst_fn, "wb") as f:
150-
f.write(rst.encode("utf-8"))
151-
152-
15395
args = {
15496
"name": NAME,
15597
"version": about["__version__"],
15698
"description": "http file sharing hub",
157-
"long_description": LONG_DESCRIPTION,
158-
"long_description_content_type": LDCT,
99+
"long_description": long_description,
100+
"long_description_content_type": "text/markdown",
159101
"author": "ed",
160102
"author_email": "[email protected]",
161103
"url": "https://github.com/9001/copyparty",
162104
"license": "MIT",
163105
"data_files": data_files,
164106
"classifiers": [
165-
"Development Status :: 5 - Production/Stable",
107+
"Development Status :: 3 - Alpha",
166108
"License :: OSI Approved :: MIT License",
167109
"Programming Language :: Python",
168110
"Programming Language :: Python :: 2",
@@ -174,29 +116,39 @@ def proc_dir(self, path):
174116
"Programming Language :: Python :: 3.5",
175117
"Programming Language :: Python :: 3.6",
176118
"Programming Language :: Python :: 3.7",
119+
"Programming Language :: Python :: 3.8",
177120
"Programming Language :: Python :: Implementation :: CPython",
178121
"Programming Language :: Python :: Implementation :: PyPy",
179122
"Environment :: Console",
180-
"Topic :: Communications :: Chat",
123+
"Environment :: No Input/Output (Daemon)",
124+
"Topic :: Communications :: File Sharing",
181125
],
182-
"cmdclass": {"rstconv": rstconv, "clean2": clean2},
126+
"cmdclass": {"clean2": clean2},
183127
}
184128

185129

186130
if setuptools_available:
187131
args.update(
188132
{
189-
"packages": ["copyparty"],
133+
"packages": find_packages(),
190134
"install_requires": ["jinja2"],
191135
"extras_require": {"thumbnails": ["Pillow"]},
192136
"include_package_data": True,
193137
"entry_points": {
194138
"console_scripts": ["copyparty = copyparty.__main__:main"]
195139
},
140+
"scripts": [
141+
"bin/copyparty-fuse.py"
142+
]
196143
}
197144
)
198145
else:
199-
args.update({"packages": ["copyparty"], "scripts": ["bin/copyparty"]})
146+
args.update(
147+
{
148+
"packages": ["copyparty", "copyparty.stolen"],
149+
"scripts": ["bin/copyparty", "bin/copyparty-fuse.py"]
150+
}
151+
)
200152

201153

202154
# import pprint

0 commit comments

Comments
 (0)