wemake-services / django-split-settings

Organize Django settings into multiple files and directories. Easily override and modify settings. Use wildcards and optional settings files.
http://django-split-settings.rtfd.io
BSD 3-Clause "New" or "Revised" License
1.11k stars 67 forks source link

Fix/507 #510

Closed SukiCZ closed 3 months ago

SukiCZ commented 11 months ago

sorry @sobolevn I've realized one thing.

Getting list of paths matching a non-existent pattern, returns empty list, which differs from getting a paths of parent folder (empty string).

>>> import glob

>>> glob.glob('/tmp/None')  # Previous behavior
[]
>>> glob.glob('/tmp/')  # Current behavior
['/tmp/']

This adds a skip to Optional empty values (+unit-test & docs)

SukiCZ commented 10 months ago

Hey @sobolevn, I rebased the PR to make latest change more visible.

If it's unclear, without skipping Optional values the code will result to IsADirectoryError as you can see when commenting out the change and running pytest

>               with open(included_file, 'rb') as to_compile:
E               IsADirectoryError: [Errno 21] Is a directory: './tests/settings/merged'

split_settings/tools.py:107: IsADirectoryError
SukiCZ commented 6 months ago

@sobolevn any update on this one?