Some requirements fixes

This commit is contained in:
Nick McCullum 2022-03-16 19:25:29 -04:00
parent 80a4c05475
commit e7fd06da53
2 changed files with 45 additions and 32 deletions

View File

@ -1,7 +1,6 @@
Django>=2.2 Django>=2.2
django-bootstrap4-form django-bootstrap4-form
celery celery
-e git+ssh://git@github.com/celery/django-celery-beat.git@master#egg=django_celery_beat
email-reply-parser email-reply-parser
akismet akismet
markdown markdown

View File

@ -4,13 +4,20 @@ from distutils.util import convert_path
from fnmatch import fnmatchcase from fnmatch import fnmatchcase
from setuptools import setup, find_packages from setuptools import setup, find_packages
version = '0.3.2' version = "0.3.2"
# Provided as an attribute, so you can append to these instead # Provided as an attribute, so you can append to these instead
# of replicating them: # of replicating them:
standard_exclude = ('*.py', '*.pyc', '*$py.class', '*~', '.*', '*.bak') standard_exclude = ("*.py", "*.pyc", "*$py.class", "*~", ".*", "*.bak")
standard_exclude_directories = ('.*', 'CVS', '_darcs', './build', standard_exclude_directories = (
'./dist', 'EGG-INFO', '*.egg-info') ".*",
"CVS",
"_darcs",
"./build",
"./dist",
"EGG-INFO",
"*.egg-info",
)
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
@ -18,11 +25,13 @@ standard_exclude_directories = ('.*', 'CVS', '_darcs', './build',
# you can't import this from another package, when you don't know if # you can't import this from another package, when you don't know if
# that package is installed yet. # that package is installed yet.
def find_package_data( def find_package_data(
where='.', package='', where=".",
package="",
exclude=standard_exclude, exclude=standard_exclude,
exclude_directories=standard_exclude_directories, exclude_directories=standard_exclude_directories,
only_in_packages=True, only_in_packages=True,
show_ignored=False): show_ignored=False,
):
""" """
Return a dictionary suitable for use in ``package_data`` Return a dictionary suitable for use in ``package_data``
in a distutils ``setup.py`` file. in a distutils ``setup.py`` file.
@ -51,7 +60,7 @@ def find_package_data(
""" """
out = {} out = {}
stack = [(convert_path(where), '', package, only_in_packages)] stack = [(convert_path(where), "", package, only_in_packages)]
while stack: while stack:
where, prefix, package, only_in_packages = stack.pop(0) where, prefix, package, only_in_packages = stack.pop(0)
for name in os.listdir(where): for name in os.listdir(where):
@ -59,43 +68,40 @@ def find_package_data(
if os.path.isdir(fn): if os.path.isdir(fn):
bad_name = False bad_name = False
for pattern in exclude_directories: for pattern in exclude_directories:
if (fnmatchcase(name, pattern) if fnmatchcase(name, pattern) or fn.lower() == pattern.lower():
or fn.lower() == pattern.lower()):
bad_name = True bad_name = True
if show_ignored: if show_ignored:
print( print(
"Directory %s ignored by pattern %s" % (fn, pattern), "Directory %s ignored by pattern %s" % (fn, pattern),
file=sys.stderr file=sys.stderr,
) )
break break
if bad_name: if bad_name:
continue continue
if (os.path.isfile(os.path.join(fn, '__init__.py')) if os.path.isfile(os.path.join(fn, "__init__.py")) and not prefix:
and not prefix):
if not package: if not package:
new_package = name new_package = name
else: else:
new_package = package + '.' + name new_package = package + "." + name
stack.append((fn, '', new_package, False)) stack.append((fn, "", new_package, False))
else: else:
stack.append((fn, prefix + name + '/', package, only_in_packages)) stack.append((fn, prefix + name + "/", package, only_in_packages))
elif package or not only_in_packages: elif package or not only_in_packages:
# is a file # is a file
bad_name = False bad_name = False
for pattern in exclude: for pattern in exclude:
if (fnmatchcase(name, pattern) if fnmatchcase(name, pattern) or fn.lower() == pattern.lower():
or fn.lower() == pattern.lower()):
bad_name = True bad_name = True
if show_ignored: if show_ignored:
print( print(
"File %s ignored by pattern %s" % (fn, pattern), "File %s ignored by pattern %s" % (fn, pattern),
file=sys.stderr file=sys.stderr,
) )
break break
if bad_name: if bad_name:
continue continue
out.setdefault(package, []).append(prefix+name) out.setdefault(package, []).append(prefix + name)
return out return out
@ -116,7 +122,7 @@ def get_long_description():
setup( setup(
name='django-helpdesk', name="django-helpdesk",
version=version, version=version,
description="Django-powered ticket tracker for your helpdesk", description="Django-powered ticket tracker for your helpdesk",
long_description=get_long_description(), long_description=get_long_description(),
@ -128,7 +134,7 @@ setup(
"Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.10",
"Framework :: Django", "Framework :: Django",
'Framework :: Django :: 2.2', "Framework :: Django :: 2.2",
"Framework :: Django :: 3.2", "Framework :: Django :: 3.2",
"Environment :: Web Environment", "Environment :: Web Environment",
"Operating System :: OS Independent", "Operating System :: OS Independent",
@ -139,18 +145,26 @@ setup(
"Topic :: Office/Business", "Topic :: Office/Business",
"Natural Language :: English", "Natural Language :: English",
], ],
keywords=['django', 'helpdesk', 'django-helpdesk', 'tickets', 'incidents', keywords=[
'cases', 'bugs', 'track', 'support'], "django",
author='Ross Poulton', "helpdesk",
author_email='ross@rossp.org', "django-helpdesk",
maintainer='Garret Wassermann', "tickets",
maintainer_email='gwasser@gmail.com', "incidents",
url='https://github.com/django-helpdesk/django-helpdesk', "cases",
license='BSD', "bugs",
"track",
"support",
],
author="Ross Poulton",
author_email="ross@rossp.org",
maintainer="Garret Wassermann",
maintainer_email="gwasser@gmail.com",
url="https://github.com/django-helpdesk/django-helpdesk",
license="BSD",
packages=find_packages(), packages=find_packages(),
package_data=find_package_data("helpdesk", only_in_packages=False), package_data=find_package_data("helpdesk", only_in_packages=False),
include_package_data=True, include_package_data=True,
zip_safe=False, zip_safe=False,
install_requires=get_requirements(), install_requires=get_requirements(),
) )