Open AAriam opened 2 weeks ago
I am able to reproduce on master (3b00002ac), ~though only when using an editable install. It seems that include-package-data = true
isn't enough to make setuptools include the data directory in the installed package for me.~ (edit: nevermind, this was due to the files being in a .gitignore
'd directory, which caused setuptools to exclude them)
/home/brian/Projects/open-contrib/mypy/temp_build/src/src/test_package/data: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
If this issue continues with mypy master, please report a bug at https://github.com/python/mypy/issues
version: 1.14.0+dev.3b00002acdf098e7241df8f2e1843f8b8260b168
Traceback (most recent call last):
File "/home/brian/Projects/open-contrib/mypy/.venv313/bin/mypy", line 8, in <module>
sys.exit(console_entry())
~~~~~~~~~~~~~^^
File "/home/brian/Projects/open-contrib/mypy/mypy/__main__.py", line 15, in console_entry
main()
~~~~^^
File "/home/brian/Projects/open-contrib/mypy/mypy/main.py", line 109, in main
res, messages, blockers = run_build(sources, options, fscache, t0, stdout, stderr)
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/brian/Projects/open-contrib/mypy/mypy/main.py", line 193, in run_build
res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)
File "/home/brian/Projects/open-contrib/mypy/mypy/build.py", line 194, in build
result = _build(
sources, options, alt_lib_path, flush_errors, fscache, stdout, stderr, extra_plugins
)
File "/home/brian/Projects/open-contrib/mypy/mypy/build.py", line 269, in _build
graph = dispatch(sources, manager, stdout)
File "/home/brian/Projects/open-contrib/mypy/mypy/build.py", line 2940, in dispatch
process_graph(graph, manager)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
File "/home/brian/Projects/open-contrib/mypy/mypy/build.py", line 3338, in process_graph
process_stale_scc(graph, scc, manager)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
File "/home/brian/Projects/open-contrib/mypy/mypy/build.py", line 3443, in process_stale_scc
graph[id].finish_passes()
~~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/brian/Projects/open-contrib/mypy/mypy/build.py", line 2402, in finish_passes
manager.report_file(self.tree, self.type_map(), self.options)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/brian/Projects/open-contrib/mypy/mypy/build.py", line 873, in report_file
self.reports.file(file, self.modules, type_map, options)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/brian/Projects/open-contrib/mypy/mypy/report.py", line 91, in file
reporter.on_file(tree, modules, type_map, options)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/brian/Projects/open-contrib/mypy/mypy/report.py", line 426, in on_file
with open(tree.path) as f:
~~~~^^^^^^^^^^^
IsADirectoryError: [Errno 21] Is a directory: '/home/brian/Projects/open-contrib/mypy/temp_build/src/src/test_package/data'
Crash Report
This is similar to #15979:
For namespace packages, e.g., when a package contains a data directory without any Python files,
IsADirectoryError
is raised when using the--linecoverage-report
option. This happens when using the--package
option, but not when passing the directory path.Traceback
To Reproduce
with
pyproject.toml
:[build-system] requires = ["setuptools >= 72.1.0"] build-backend = "setuptools.build_meta"
[tool] [tool.setuptools] include-package-data = true
[tool.setuptools.packages.find] where = ["src"] namespaces = true