Files
copyparty/setup.py

158 lines
4.8 KiB
Python
Raw Normal View History

2021-09-19 00:41:56 +02:00
#!/usr/bin/env python3
2019-06-01 15:55:21 +00:00
# coding: utf-8
from __future__ import print_function
import os
import sys
from shutil import rmtree
2022-12-03 15:07:47 +00:00
from setuptools import setup, Command
2019-06-01 15:55:21 +00:00
_ = """
this probably still works but is no longer in use;
pyproject.toml and scripts/make-pypi-release.sh
are in charge of packaging wheels now
"""
2019-06-01 15:55:21 +00:00
NAME = "copyparty"
VERSION = None
2020-01-19 16:12:59 +01:00
data_files = [("share/doc/copyparty", ["README.md", "LICENSE"])]
2019-06-01 15:55:21 +00:00
manifest = ""
for dontcare, files in data_files:
for fn in files:
manifest += "include {0}\n".format(fn)
2020-01-19 16:12:59 +01:00
manifest += "recursive-include copyparty/res *\n"
2019-06-02 14:16:53 +00:00
manifest += "recursive-include copyparty/web *\n"
2019-06-01 15:55:21 +00:00
here = os.path.abspath(os.path.dirname(__file__))
with open(here + "/MANIFEST.in", "wb") as f:
f.write(manifest.encode("utf-8"))
2020-01-19 16:12:59 +01:00
with open(here + "/README.md", "rb") as f:
txt = f.read().decode("utf-8")
long_description = txt
2019-06-01 15:55:21 +00:00
about = {}
if not VERSION:
with open(os.path.join(here, NAME, "__version__.py"), "rb") as f:
2021-02-12 20:53:29 +01:00
exec (f.read().decode("utf-8").split("\n\n", 1)[1], about)
2019-06-01 15:55:21 +00:00
else:
about["__version__"] = VERSION
class clean2(Command):
description = "Cleans the source tree"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
os.system("{0} setup.py clean --all".format(sys.executable))
try:
rmtree("./dist")
except:
pass
try:
rmtree("./copyparty.egg-info")
except:
pass
nuke = []
2021-09-07 23:18:54 +02:00
for (dirpath, _, filenames) in os.walk("."):
2019-06-01 15:55:21 +00:00
for fn in filenames:
if (
2020-01-19 16:12:59 +01:00
fn.startswith("MANIFEST")
2019-06-01 15:55:21 +00:00
or fn.endswith(".pyc")
or fn.endswith(".pyo")
or fn.endswith(".pyd")
):
nuke.append(dirpath + "/" + fn)
for fn in nuke:
os.unlink(fn)
args = {
"name": NAME,
"version": about["__version__"],
2023-02-16 19:56:57 +00:00
"description": (
"Portable file server with accelerated resumable uploads, "
2024-02-10 18:37:21 +00:00
+ "deduplication, WebDAV, FTP, TFTP, zeroconf, media indexer, "
2023-02-16 19:56:57 +00:00
+ "video thumbnails, audio transcoding, and write-only folders"
),
2020-01-19 16:12:59 +01:00
"long_description": long_description,
"long_description_content_type": "text/markdown",
2019-06-01 15:55:21 +00:00
"author": "ed",
"author_email": "copyparty@ocv.me",
"url": "https://github.com/9001/copyparty",
"license": "MIT",
"classifiers": [
2021-09-07 23:18:54 +02:00
"Development Status :: 5 - Production/Stable",
2019-06-01 15:55:21 +00:00
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
2020-01-19 16:12:59 +01:00
"Programming Language :: Python :: 3.8",
2021-02-12 20:53:29 +01:00
"Programming Language :: Python :: 3.9",
2021-08-08 04:14:59 +02:00
"Programming Language :: Python :: 3.10",
2022-10-13 21:14:42 +02:00
"Programming Language :: Python :: 3.11",
2022-12-12 22:59:31 +00:00
"Programming Language :: Python :: 3.12",
2024-10-27 07:51:11 +00:00
"Programming Language :: Python :: 3.13",
2019-06-01 15:55:21 +00:00
"Programming Language :: Python :: Implementation :: CPython",
2021-09-07 23:18:54 +02:00
"Programming Language :: Python :: Implementation :: Jython",
2019-06-01 15:55:21 +00:00
"Programming Language :: Python :: Implementation :: PyPy",
2024-02-15 00:00:41 +00:00
"Operating System :: OS Independent",
2019-06-01 15:55:21 +00:00
"Environment :: Console",
2020-01-19 16:12:59 +01:00
"Environment :: No Input/Output (Daemon)",
2022-10-23 23:08:00 +02:00
"Intended Audience :: End Users/Desktop",
"Intended Audience :: System Administrators",
2020-01-19 16:12:59 +01:00
"Topic :: Communications :: File Sharing",
2022-10-23 23:08:00 +02:00
"Topic :: Internet :: File Transfer Protocol (FTP)",
2021-05-29 15:03:32 +02:00
"Topic :: Internet :: WWW/HTTP :: HTTP Servers",
2019-06-01 15:55:21 +00:00
],
2021-05-29 15:03:32 +02:00
"include_package_data": True,
"data_files": data_files,
2022-12-03 15:07:47 +00:00
"packages": [
"copyparty",
"copyparty.bos",
"copyparty.res",
"copyparty.stolen",
"copyparty.stolen.dnslib",
"copyparty.stolen.ifaddr",
"copyparty.web",
"copyparty.web.a",
"copyparty.web.deps",
],
2021-05-29 15:03:32 +02:00
"install_requires": ["jinja2"],
2022-02-13 03:10:53 +01:00
"extras_require": {
"all": ["argon2-cffi", "partftpy>=0.4.0", "Pillow", "pyftpdlib", "pyopenssl", "pyzmq"],
2022-02-13 03:10:53 +01:00
"thumbnails": ["Pillow"],
"thumbnails2": ["pyvips"],
2022-02-13 03:10:53 +01:00
"audiotags": ["mutagen"],
"ftpd": ["pyftpdlib"],
"ftps": ["pyftpdlib", "pyopenssl"],
"tftpd": ["partftpy>=0.4.0"],
2023-06-25 21:50:33 +00:00
"pwhash": ["argon2-cffi"],
"zeromq": ["pyzmq"],
2022-02-13 03:10:53 +01:00
},
2021-05-29 15:03:32 +02:00
"entry_points": {"console_scripts": ["copyparty = copyparty.__main__:main"]},
2023-05-07 15:35:56 +00:00
"scripts": ["bin/partyfuse.py", "bin/u2c.py"],
2020-01-19 16:12:59 +01:00
"cmdclass": {"clean2": clean2},
2019-06-01 15:55:21 +00:00
}
2023-02-04 17:35:20 +00:00
if sys.version_info < (3, 8):
args["install_requires"].append("ipaddress")
2019-06-01 15:55:21 +00:00
setup(**args)