mirror of
https://github.com/QingdaoU/Spirit.git
synced 2024-12-28 07:22:07 +00:00
install python-magic-bin in win32 and macOS
This commit is contained in:
parent
5addf36d6a
commit
e00e4f0311
8
setup.py
8
setup.py
@ -3,6 +3,7 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import sys
|
||||
import os
|
||||
import io
|
||||
from setuptools import setup, find_packages
|
||||
@ -18,6 +19,11 @@ VERSION = __import__('spirit').__version__
|
||||
with io.open(os.path.join(BASE_DIR, 'requirements.txt'), encoding='utf-8') as fh:
|
||||
REQUIREMENTS = fh.read()
|
||||
|
||||
if sys.platform.startswith(('win32', 'darwin')):
|
||||
PYTHON_MAGIC_DEP = ['python-magic-bin==0.4.14']
|
||||
else: # Linux?
|
||||
PYTHON_MAGIC_DEP = ['python-magic==0.4.15']
|
||||
|
||||
# allow setup.py to be run from any path
|
||||
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
|
||||
|
||||
@ -39,7 +45,7 @@ spirit=spirit.extra.bin.spirit:main
|
||||
zip_safe=False,
|
||||
install_requires=REQUIREMENTS,
|
||||
extras_require={
|
||||
'files': ['python-magic==0.4.15']},
|
||||
'files': PYTHON_MAGIC_DEP},
|
||||
license='MIT License',
|
||||
classifiers=[
|
||||
'Development Status :: 5 - Production/Stable',
|
||||
|
@ -67,6 +67,8 @@ ST_ALLOWED_UPLOAD_IMAGE_FORMAT = ('jpeg', 'jpg', 'gif')
|
||||
ST_UPLOAD_FILE_ENABLED = True
|
||||
#: Uploaded files will be validated against these formats.
|
||||
#: This is a map of extension and media-type. Both are used for validation.
|
||||
#: Requires running ``pip install django-spirit[files]`` to install
|
||||
#: `python-magic <https://github.com/ahupp/python-magic#installation>`_
|
||||
#:
|
||||
#: .. Note::
|
||||
#: To find a media-type just add an extension and an empty media-type,
|
||||
|
Loading…
Reference in New Issue
Block a user