mirror of
https://github.com/jazzband/django-admin2.git
synced 2026-03-16 22:20:24 +00:00
fix djangorestframework dependency
This commit is contained in:
parent
fa5ef8b32b
commit
da03c6769f
2 changed files with 65 additions and 13 deletions
|
|
@ -1,12 +1,8 @@
|
|||
__version__ = '0.1.1'
|
||||
|
||||
__author__ = 'Daniel Greenfeld'
|
||||
|
||||
VERSION = (0, 1, 0)
|
||||
VERSION = __version__ # synonym
|
||||
|
||||
|
||||
def get_version():
|
||||
version = '%s.%s' % (VERSION[0], VERSION[1])
|
||||
if VERSION[2]:
|
||||
version = '%s.%s' % (version, VERSION[2])
|
||||
return version
|
||||
|
||||
__version__ = get_version()
|
||||
# Default datetime input and output formats
|
||||
ISO_8601 = 'iso-8601'
|
||||
|
|
|
|||
64
setup.py
64
setup.py
|
|
@ -1,4 +1,54 @@
|
|||
from setuptools import setup, find_packages
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from setuptools import setup
|
||||
import re
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
def get_version(package):
|
||||
"""
|
||||
Return package version as listed in `__version__` in `init.py`.
|
||||
"""
|
||||
init_py = open(os.path.join(package, '__init__.py')).read()
|
||||
return re.match("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1)
|
||||
|
||||
|
||||
def get_packages(package):
|
||||
"""
|
||||
Return root package and all sub-packages.
|
||||
"""
|
||||
return [dirpath
|
||||
for dirpath, dirnames, filenames in os.walk(package)
|
||||
if os.path.exists(os.path.join(dirpath, '__init__.py'))]
|
||||
|
||||
|
||||
def get_package_data(package):
|
||||
"""
|
||||
Return all files under the root package, that are not in a
|
||||
package themselves.
|
||||
"""
|
||||
walk = [(dirpath.replace(package + os.sep, '', 1), filenames)
|
||||
for dirpath, dirnames, filenames in os.walk(package)
|
||||
if not os.path.exists(os.path.join(dirpath, '__init__.py'))]
|
||||
|
||||
filepaths = []
|
||||
for base, filenames in walk:
|
||||
filepaths.extend([os.path.join(base, filename)
|
||||
for filename in filenames])
|
||||
return {package: filepaths}
|
||||
|
||||
|
||||
version = get_version('admin2')
|
||||
|
||||
|
||||
if sys.argv[-1] == 'publish':
|
||||
os.system("python setup.py sdist upload")
|
||||
print("You probably want to also tag the version now:")
|
||||
print(" git tag -a %s -m 'version %s'" % (version, version))
|
||||
print(" git push --tags")
|
||||
sys.exit()
|
||||
|
||||
import admin2
|
||||
|
||||
|
|
@ -6,7 +56,7 @@ LONG_DESCRIPTION = open('README.rst').read()
|
|||
|
||||
setup(
|
||||
name='django-admin2',
|
||||
version=admin2.__version__,
|
||||
version=version,
|
||||
description="An introspective interface for Django's ORM.",
|
||||
long_description=LONG_DESCRIPTION,
|
||||
classifiers=[
|
||||
|
|
@ -27,12 +77,18 @@ setup(
|
|||
author_email='pydanny@gmail.com',
|
||||
url='http://github.com/pydanny/django-admin2',
|
||||
license='MIT',
|
||||
packages=find_packages(),
|
||||
packages=get_packages('admin2'),
|
||||
include_package_data=True,
|
||||
install_requires=[
|
||||
'django>=1.5.0',
|
||||
'django-braces==1.0.0',
|
||||
'django-rest-framework==2.3'
|
||||
'djangorestframework==2.3.3'
|
||||
],
|
||||
zip_safe=False,
|
||||
)
|
||||
|
||||
# (*) Please direct queries to Github issue list, rather than to me directly
|
||||
# Doing so helps ensure your question is helpful to other users.
|
||||
# Queries directly to my email are likely to receive a canned response.
|
||||
#
|
||||
# Many thanks for your understanding.
|
||||
|
|
|
|||
Loading…
Reference in a new issue