Commit 730641e3 authored by Stefan Behnel's avatar Stefan Behnel

Deprecate dotted filenames for package qualified module names.

Close #2686.
parent 531b9aa6
......@@ -163,6 +163,10 @@ Other changes
* The command line parser was rewritten and modernised using ``argparse``.
Patch by Egor Dranischnikow. (Github issue #2952, #3001)
* Dotted filenames for qualified module names (``pkg.mod.pyx``) are deprecated.
Use the normal Python package directory layout instead.
(Github issue #2686)
* Support for Python 2.6 was removed.
......
......@@ -494,6 +494,12 @@ def run_pipeline(source, options, full_module_name=None, context=None):
pipeline = Pipeline.create_pyx_pipeline(context, options, result)
context.setup_errors(options, result)
if '.' in full_module_name and '.' in os.path.splitext(os.path.basename(abs_path))[0]:
warning((source_desc, 1, 0),
"Dotted filenames ('%s') are deprecated."
" Please use the normal Python package directory layout." % os.path.basename(abs_path), level=1)
err, enddata = Pipeline.run_pipeline(pipeline, source)
context.teardown_errors(err, options, result)
return result
......@@ -650,6 +656,8 @@ def search_include_directories(dirs, qualified_name, suffix, pos, include=False)
for dirname in dirs:
path = os.path.join(dirname, dotted_filename)
if os.path.exists(path):
warning(pos, "Dotted filenames ('%s') are deprecated."
" Please use the normal Python package directory layout." % dotted_filename, level=1)
return path
# search for filename in package structure e.g. <dir>/foo/bar.pxd or <dir>/foo/bar/__init__.pxd
......
# mode: compile
# tag: warnings
_WARNINGS="""
1:0: Dotted filenames ('dotted.filename.modules.pxd') are deprecated. Please use the normal Python package directory layout.
1:0: Dotted filenames ('dotted.filename.modules.pyx') are deprecated. Please use the normal Python package directory layout.
"""
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment