mirror of
https://github.com/django/django.git
synced 2025-06-05 11:39:13 +00:00
Ensure we ignore __pycache__ PEP 3174 dirs in a few more places.
This commit is contained in:
parent
69035b0b1c
commit
2100da9dcd
@ -32,3 +32,5 @@ recursive-include django/contrib/gis/tests/geogapp/fixtures *
|
|||||||
recursive-include django/contrib/gis/tests/relatedapp/fixtures *
|
recursive-include django/contrib/gis/tests/relatedapp/fixtures *
|
||||||
recursive-include django/contrib/sitemaps/templates *
|
recursive-include django/contrib/sitemaps/templates *
|
||||||
recursive-include django/contrib/sitemaps/tests/templates *
|
recursive-include django/contrib/sitemaps/tests/templates *
|
||||||
|
recursive-exclude * __pycache__
|
||||||
|
recursive-exclude * *.py[co]
|
||||||
|
@ -138,7 +138,7 @@ class TemplateCommand(BaseCommand):
|
|||||||
os.mkdir(target_dir)
|
os.mkdir(target_dir)
|
||||||
|
|
||||||
for dirname in dirs[:]:
|
for dirname in dirs[:]:
|
||||||
if dirname.startswith('.'):
|
if dirname.startswith('.') or dirname == '__pycache__':
|
||||||
dirs.remove(dirname)
|
dirs.remove(dirname)
|
||||||
|
|
||||||
for filename in files:
|
for filename in files:
|
||||||
|
@ -30,7 +30,7 @@ def load_backend(backend_name):
|
|||||||
try:
|
try:
|
||||||
available_backends = [f for f in os.listdir(backend_dir)
|
available_backends = [f for f in os.listdir(backend_dir)
|
||||||
if os.path.isdir(os.path.join(backend_dir, f))
|
if os.path.isdir(os.path.join(backend_dir, f))
|
||||||
and not f.startswith('.')]
|
and not (f.startswith('.') or f == '__pycache__')]
|
||||||
except EnvironmentError:
|
except EnvironmentError:
|
||||||
available_backends = []
|
available_backends = []
|
||||||
full_notation = backend_name.startswith('django.db.backends.')
|
full_notation = backend_name.startswith('django.db.backends.')
|
||||||
|
@ -96,7 +96,7 @@ def fix_ampersands_filter(value):
|
|||||||
# Values for testing floatformat input against infinity and NaN representations,
|
# Values for testing floatformat input against infinity and NaN representations,
|
||||||
# which differ across platforms and Python versions. Some (i.e. old Windows
|
# which differ across platforms and Python versions. Some (i.e. old Windows
|
||||||
# ones) are not recognized by Decimal but we want to return them unchanged vs.
|
# ones) are not recognized by Decimal but we want to return them unchanged vs.
|
||||||
# returning an empty string as we do for completley invalid input. Note these
|
# returning an empty string as we do for completely invalid input. Note these
|
||||||
# need to be built up from values that are not inf/nan, since inf/nan values do
|
# need to be built up from values that are not inf/nan, since inf/nan values do
|
||||||
# not reload properly from .pyc files on Windows prior to some level of Python 2.5
|
# not reload properly from .pyc files on Windows prior to some level of Python 2.5
|
||||||
# (see Python Issue757815 and Issue1080440).
|
# (see Python Issue757815 and Issue1080440).
|
||||||
|
5
setup.py
5
setup.py
@ -67,9 +67,10 @@ if root_dir != '':
|
|||||||
django_dir = 'django'
|
django_dir = 'django'
|
||||||
|
|
||||||
for dirpath, dirnames, filenames in os.walk(django_dir):
|
for dirpath, dirnames, filenames in os.walk(django_dir):
|
||||||
# Ignore dirnames that start with '.'
|
# Ignore PEP 3147 cache dirs and those whose names start with '.'
|
||||||
for i, dirname in enumerate(dirnames):
|
for i, dirname in enumerate(dirnames):
|
||||||
if dirname.startswith('.'): del dirnames[i]
|
if dirname.startswith('.') or dirname == '__pycache__':
|
||||||
|
del dirnames[i]
|
||||||
if '__init__.py' in filenames:
|
if '__init__.py' in filenames:
|
||||||
packages.append('.'.join(fullsplit(dirpath)))
|
packages.append('.'.join(fullsplit(dirpath)))
|
||||||
elif filenames:
|
elif filenames:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user