1 | #! /usr/bin/env python |
---|
2 | # Copyright (C) 2003-2018, Stefan Schwarzer <sschwarzer@sschwarzer.net> |
---|
3 | # See the file LICENSE for licensing terms. |
---|
4 | |
---|
5 | """ |
---|
6 | setup.py - installation script for Python distutils |
---|
7 | """ |
---|
8 | |
---|
9 | import os |
---|
10 | import sys |
---|
11 | |
---|
12 | from distutils import core |
---|
13 | |
---|
14 | |
---|
15 | _name = "ftputil" |
---|
16 | _package = "ftputil" |
---|
17 | _version = open("VERSION").read().strip() |
---|
18 | |
---|
19 | |
---|
20 | doc_files = [os.path.join("doc", name) |
---|
21 | for name in ["ftputil.txt", "ftputil.html", |
---|
22 | "whats_new_in_ftputil_3.0.txt", |
---|
23 | "whats_new_in_ftputil_3.0.html", |
---|
24 | "README.txt"]] |
---|
25 | |
---|
26 | doc_files_are_present = all((os.path.exists(doc_file) |
---|
27 | for doc_file in doc_files)) |
---|
28 | |
---|
29 | if "install" in sys.argv[1:] and not doc_files_are_present: |
---|
30 | print("One or more of the HTML documentation files are missing.") |
---|
31 | print("Please generate them with `make docs`.") |
---|
32 | sys.exit(1) |
---|
33 | |
---|
34 | core.setup( |
---|
35 | # Installation data |
---|
36 | name=_name, |
---|
37 | version=_version, |
---|
38 | packages=[_package], |
---|
39 | package_dir={_package: _package}, |
---|
40 | data_files=[("doc/ftputil", doc_files)], |
---|
41 | # Metadata |
---|
42 | author="Stefan Schwarzer", |
---|
43 | author_email="sschwarzer@sschwarzer.net", |
---|
44 | url="http://ftputil.sschwarzer.net/", |
---|
45 | description="High-level FTP client library (virtual file system and more)", |
---|
46 | keywords="FTP, client, library, virtual file system", |
---|
47 | license="Open source (revised BSD license)", |
---|
48 | platforms=["Pure Python"], |
---|
49 | long_description="""\ |
---|
50 | ftputil is a high-level FTP client library for the Python programming |
---|
51 | language. ftputil implements a virtual file system for accessing FTP servers, |
---|
52 | that is, it can generate file-like objects for remote files. The library |
---|
53 | supports many functions similar to those in the os, os.path and |
---|
54 | shutil modules. ftputil has convenience functions for conditional uploads |
---|
55 | and downloads, and handles FTP clients and servers in different timezones.""", |
---|
56 | download_url= |
---|
57 | "http://ftputil.sschwarzer.net/trac/attachment/wiki/Download/" |
---|
58 | "{}-{}.tar.gz?format=raw".format(_name, _version), |
---|
59 | classifiers=[ |
---|
60 | "Development Status :: 5 - Production/Stable", |
---|
61 | "Environment :: Other Environment", |
---|
62 | "Intended Audience :: Developers", |
---|
63 | "Intended Audience :: System Administrators", |
---|
64 | "License :: OSI Approved :: BSD License", |
---|
65 | "Operating System :: OS Independent", |
---|
66 | "Programming Language :: Python", |
---|
67 | "Programming Language :: Python :: 3", |
---|
68 | "Topic :: Internet :: File Transfer Protocol (FTP)", |
---|
69 | "Topic :: Software Development :: Libraries :: Python Modules", |
---|
70 | "Topic :: System :: Filesystems", |
---|
71 | ] |
---|
72 | ) |
---|
73 | |
---|