Attempt to fix setup script when numpy isn't present

* pip appears to be brokes; numpy can't be automatically installed as a dependency
* added instructions to README
This commit is contained in:
Rob McMullen 2016-02-10 11:26:17 -08:00
parent 76c7028c0a
commit 463aa15479
3 changed files with 19 additions and 5 deletions

View File

@ -1,4 +1,4 @@
ATRCopy
atrcopy
=======
Utilities to list files on and extract files from Atari 8-bit emulator disk
@ -7,7 +7,13 @@ images. Eventually, I hope to add support for these images to pyfilesystem.
Prerequisites
-------------
Starting with ATRcopy 2.0, numpy is required.
Starting with atrcopy 2.0, numpy is required.
The standard python install tool, pip, does not seem to be able to handle the
automatic installation of numpy, so to install atrcopy, use::
pip install numpy
pip install atrcopy
References

View File

@ -5,7 +5,10 @@ __version__ = "2.1.0"
import types
import numpy as np
try:
import numpy as np
except ImportError:
raise RuntimeError("atrcopy %s requires numpy" % __version__)
class AtrError(RuntimeError):

View File

@ -5,7 +5,12 @@ try:
except ImportError:
from distutils.core import setup
import atrcopy
try:
import atrcopy
version = atrcopy.__version__
except RuntimeError, e:
# If numpy isn't present, pull the version number from the error string
version = str(e).split()[1]
classifiers = [
"Programming Language :: Python :: 2",
@ -19,7 +24,7 @@ with open("README.rst", "r") as fp:
long_description = fp.read()
setup(name="atrcopy",
version=atrcopy.__version__,
version=version,
author="Rob McMullen",
author_email="feedback@playermissile.com>",
url="https://github.com/robmcmullen/atrcopy",