1 #! /usr/bin/env python3
3 from distutils
.core
import setup
5 # Futz with the path so we can import metadata.
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
17 ascii
= codecs
.lookup('ascii')
18 func
= lambda name
, enc
=ascii
: {True: enc
}.get(name
=='mbcs')
24 package_dir
={'': 'src'},
25 packages
= ['pyprimes'],
26 version
= __version__
,
28 author_email
= __author_email__
,
29 url
= 'http://code.google.com/p/pyprimes/',
30 keywords
= "prime primes primality math maths algorithm fermat miller-rabin".split(),
31 description
= "Generate and test for prime numbers.",
32 long_description
= """\
33 The pyprimes package offers a variety of algorithms for generating prime
34 numbers and fast primality test, written in pure Python.
36 Prime numbers are those positive integers which are not divisible exactly
37 by any number other than itself or one. Generating primes and testing for
38 primality has been a favourite mathematical pastime for centuries, as well
39 as of great practical importance for encrypting data.
41 ``pyprimes`` includes the following features:
43 - Produce prime numbers lazily, on demand.
44 - Effective algorithms including Sieve of Eratosthenes, Croft Spiral,
45 and Wheel Factorisation.
46 - Efficiently test whether numbers are prime, using both deterministic
47 (exact) and probabilistic primality tests.
48 - Examples of what *not* to do are provided, including naive trial
49 division, Turner's algorithm, and primality testing using a
51 - Factorise small numbers into the product of prime factors.
52 - Suitable for Python 2.4 through 3.2 from one code base.
55 license
= 'MIT', # apologies for the American spelling
57 "Development Status :: 3 - Alpha",
58 "Programming Language :: Python",
59 "Programming Language :: Python :: 2.4",
60 "Programming Language :: Python :: 2.5",
61 "Programming Language :: Python :: 2.6",
62 "Programming Language :: Python :: 2.7",
63 "Programming Language :: Python :: 3.0",
64 "Programming Language :: Python :: 3.1",
65 "Programming Language :: Python :: 3.2",
66 "Programming Language :: Python :: 3.3",
67 "Programming Language :: Python :: 3.4",
68 "Environment :: Other Environment",
69 "Intended Audience :: Developers",
70 "Operating System :: OS Independent",
71 "Topic :: Software Development :: Libraries :: Python Modules",
72 "Topic :: Scientific/Engineering :: Mathematics",
73 "License :: OSI Approved :: MIT License",