Merge tag 'upstream/0.2.2a'
[debian_python-primes.git] / setup.py
blob193e600cd82da91f5605431e8322246feda6a21e
1 #! /usr/bin/env python3
3 from distutils.core import setup
5 # Futz with the path so we can import metadata.
6 import os, sys
7 here = os.path.dirname(os.path.abspath(__file__))
8 sys.path.insert(0, os.path.join(here, 'src'))
9 from pyprimes import __version__, __author__, __author_email__
11 # Work around mbcs bug in distutils.
12 # http://bugs.python.org/issue10945
13 import codecs
14 try:
15 codecs.lookup('mbcs')
16 except LookupError:
17 ascii = codecs.lookup('ascii')
18 func = lambda name, enc=ascii: {True: enc}.get(name=='mbcs')
19 codecs.register(func)
22 setup(
23 name = "pyprimes",
24 package_dir={'': 'src'},
25 packages = ['pyprimes'],
26 version = __version__,
27 author = __author__,
28 author_email = __author_email__,
29 url = 'http://code.google.com/p/pyprimes/',
30 keywords = sorted([
31 'algorithm', 'eratosthenes', 'factors', 'fermat', 'math', 'maths',
32 'miller-rabin', 'primality', 'prime', 'primes', 'sieve',
33 ]),
34 description = "Generate and test for prime numbers.",
35 long_description = """\
36 The pyprimes package offers a variety of algorithms for generating prime
37 numbers and fast primality tests, written in pure Python.
39 Prime numbers are those positive integers which are not divisible exactly
40 by any number other than itself or one. Generating primes and testing for
41 primality has been a favourite mathematical pastime for centuries, as well
42 as of great practical importance for encrypting data.
44 ``pyprimes`` includes the following features:
46 - Produce prime numbers lazily, on demand.
47 - Effective algorithms including Sieve of Eratosthenes, Croft Spiral,
48 and Wheel Factorisation.
49 - Efficiently test whether numbers are prime, using both deterministic
50 (exact) and probabilistic primality tests.
51 - Examples of what *not* to do are provided, including naive trial
52 division, Turner's algorithm, and primality testing using a
53 regular expression.
54 - Factorise small numbers into the product of prime factors.
55 - Suitable for Python 2.4 through 3.x from one code base.
57 """,
58 license = 'MIT', # apologies for the American spelling
59 classifiers = [
60 "Development Status :: 3 - Alpha",
61 "Programming Language :: Python",
62 "Programming Language :: Python :: 2.4",
63 "Programming Language :: Python :: 2.5",
64 "Programming Language :: Python :: 2.6",
65 "Programming Language :: Python :: 2.7",
66 "Programming Language :: Python :: 3",
67 "Programming Language :: Python :: 3.0",
68 "Programming Language :: Python :: 3.1",
69 "Programming Language :: Python :: 3.2",
70 "Programming Language :: Python :: 3.3",
71 "Programming Language :: Python :: 3.4",
72 "Environment :: Other Environment",
73 "Intended Audience :: Developers",
74 "Operating System :: OS Independent",
75 "Topic :: Software Development :: Libraries :: Python Modules",
76 "Topic :: Scientific/Engineering :: Mathematics",
77 "License :: OSI Approved :: MIT License",