root/trunk/setup.py

Revision 804, 4.0 kB (checked in by schwa, 3 days ago)
Re-added `_test_with_statement.py` to `MANIFEST` file but changed
`setup.py` to not byte-compile the test under Python < 2.5.
  • Property svn:mime-type set to text/x-python
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Id
Line 
1 #! /usr/bin/env python
2
3 # Copyright (C) 2003-2006, Stefan Schwarzer
4 # All rights reserved.
5 #
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions are
8 # met:
9 #
10 # - Redistributions of source code must retain the above copyright
11 #   notice, this list of conditions and the following disclaimer.
12 #
13 # - Redistributions in binary form must reproduce the above copyright
14 #   notice, this list of conditions and the following disclaimer in the
15 #   documentation and/or other materials provided with the distribution.
16 #
17 # - Neither the name of the above author nor the names of the
18 #   contributors to the software may be used to endorse or promote
19 #   products derived from this software without specific prior written
20 #   permission.
21 #
22 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
26 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27 # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29 # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30 # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31 # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
34 # $Id$
35
36 """
37 setup.py - installation script for Python distutils
38 """
39
40 import os
41 import sys
42
43 from distutils import core
44 from distutils import sysconfig
45 from distutils.command import install_lib as install_lib_module
46
47
48 _name = "ftputil"
49 _package = "ftputil"
50 _version = open("VERSION").read().strip()
51 _data_target = "%s/%s" % (sysconfig.get_python_lib(), _package)
52
53
54 # avoid byte-compiling `_test_with_statement.py` for Python < 2.5; see
55 #  http://mail.python.org/pipermail/distutils-sig/2002-June/002894.html
56 class FtputilInstallLib(install_lib_module.install_lib):
57     def byte_compile(self, files):
58         if sys.version_info < (2, 5):
59             files = [f for f in files
60                        if os.path.basename(f) != "_test_with_statement.py"]
61         # `super` doesn't work with classic classes
62         return install_lib_module.install_lib.byte_compile(self, files)
63
64
65 core.setup(
66   # installation data
67   name=_name,
68   version=_version,
69   packages=[_package],
70   package_dir={_package: ""},
71   data_files=[(_data_target, ["ftputil.txt", "ftputil.html",
72                               "README.txt", "README.html"])],
73   cmdclass={'install_lib': FtputilInstallLib},
74
75   # metadata
76   author="Stefan Schwarzer",
77   author_email="sschwarzer@sschwarzer.net",
78   url="http://ftputil.sschwarzer.net/",
79   description="High-level FTP client library (virtual filesystem and more)",
80   keywords="FTP, client, virtual file system",
81   license="Open source (revised BSD license)",
82   platforms=["Pure Python (Python version >= 2.3)"],
83   long_description="""\
84 ftputil is a high-level FTP client library for the Python programming
85 language. ftputil implements a virtual file system for accessing FTP servers,
86 that is, it can generate file-like objects for remote files. The library
87 supports many functions similar to those in the os, os.path and
88 shutil modules. ftputil has convenience functions for conditional uploads
89 and downloads, and handles FTP clients and servers in different timezones.""",
90   download_url=
91     "http://ftputil.sschwarzer.net/trac/attachment/wiki/Download/%s-%s.tar.gz?format=raw" %
92     (_name, _version),
93   classifiers=[
94     "Development Status :: 6 - Mature",
95     "Environment :: Other Environment",
96     "Intended Audience :: Developers",
97     "License :: OSI Approved :: BSD License",
98     "Operating System :: OS Independent",
99     "Programming Language :: Python",
100     "Topic :: Internet :: File Transfer Protocol (FTP)",
101     "Topic :: Software Development :: Libraries :: Python Modules",
102     "Topic :: System :: Filesystems",
103     ]
104   )
105
Note: See TracBrowser for help on using the browser.