11
11
setuptools_available = True
12
12
try :
13
13
# need setuptools to build wheel
14
- from setuptools import setup , Command
14
+ from setuptools import setup , Command , find_packages
15
15
16
16
except ImportError :
17
17
# works in a pinch
25
25
sys .exit (1 )
26
26
27
27
28
- def mglob (dirname , extensions ):
29
- ret = []
30
- for ext in extensions :
31
- ret .extend (glob (dirname + "/*." + ext ))
32
- return ret
33
-
34
-
35
28
NAME = "copyparty"
36
29
VERSION = None
37
- data_files = [("share/doc/copyparty" , ["README.rst" , "README. md" , "LICENSE" ])]
30
+ data_files = [("share/doc/copyparty" , ["README.md" , "LICENSE" ])]
38
31
manifest = ""
39
32
for dontcare , files in data_files :
40
33
for fn in files :
41
34
manifest += "include {0}\n " .format (fn )
42
35
36
+ manifest += "recursive-include copyparty/res *\n "
43
37
manifest += "recursive-include copyparty/web *\n "
44
38
45
39
here = os .path .abspath (os .path .dirname (__file__ ))
46
40
47
41
with open (here + "/MANIFEST.in" , "wb" ) as f :
48
42
f .write (manifest .encode ("utf-8" ))
49
43
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
65
47
66
48
67
49
about = {}
@@ -99,70 +81,30 @@ def run(self):
99
81
for (dirpath , dirnames , filenames ) in os .walk ("." ):
100
82
for fn in filenames :
101
83
if (
102
- fn .endswith ( ".rst " )
84
+ fn .startswith ( "MANIFEST " )
103
85
or fn .endswith (".pyc" )
104
86
or fn .endswith (".pyo" )
105
87
or fn .endswith (".pyd" )
106
- or fn .startswith ("MANIFEST" )
107
88
):
108
89
nuke .append (dirpath + "/" + fn )
109
90
110
91
for fn in nuke :
111
92
os .unlink (fn )
112
93
113
94
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
-
153
95
args = {
154
96
"name" : NAME ,
155
97
"version" : about ["__version__" ],
156
98
"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" ,
159
101
"author" : "ed" ,
160
102
"author_email" :
"[email protected] " ,
161
103
"url" : "https://github.com/9001/copyparty" ,
162
104
"license" : "MIT" ,
163
105
"data_files" : data_files ,
164
106
"classifiers" : [
165
- "Development Status :: 5 - Production/Stable " ,
107
+ "Development Status :: 3 - Alpha " ,
166
108
"License :: OSI Approved :: MIT License" ,
167
109
"Programming Language :: Python" ,
168
110
"Programming Language :: Python :: 2" ,
@@ -174,29 +116,39 @@ def proc_dir(self, path):
174
116
"Programming Language :: Python :: 3.5" ,
175
117
"Programming Language :: Python :: 3.6" ,
176
118
"Programming Language :: Python :: 3.7" ,
119
+ "Programming Language :: Python :: 3.8" ,
177
120
"Programming Language :: Python :: Implementation :: CPython" ,
178
121
"Programming Language :: Python :: Implementation :: PyPy" ,
179
122
"Environment :: Console" ,
180
- "Topic :: Communications :: Chat" ,
123
+ "Environment :: No Input/Output (Daemon)" ,
124
+ "Topic :: Communications :: File Sharing" ,
181
125
],
182
- "cmdclass" : {"rstconv" : rstconv , " clean2" : clean2 },
126
+ "cmdclass" : {"clean2" : clean2 },
183
127
}
184
128
185
129
186
130
if setuptools_available :
187
131
args .update (
188
132
{
189
- "packages" : [ "copyparty" ] ,
133
+ "packages" : find_packages () ,
190
134
"install_requires" : ["jinja2" ],
191
135
"extras_require" : {"thumbnails" : ["Pillow" ]},
192
136
"include_package_data" : True ,
193
137
"entry_points" : {
194
138
"console_scripts" : ["copyparty = copyparty.__main__:main" ]
195
139
},
140
+ "scripts" : [
141
+ "bin/copyparty-fuse.py"
142
+ ]
196
143
}
197
144
)
198
145
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
+ )
200
152
201
153
202
154
# import pprint
0 commit comments