You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to compile a simple program using mypyc, I experience a crash (at least on macOS):
$ python -m mypyc t.py
Traceback (most recent call last):
File "/Users/jukka/src/mypy/build/setup.py", line 4, in <module>
setup(name='mypyc_output',
~~~~~^^^^^^^^^^^^^^^^^^^^^
ext_modules=mypycify(['t/t.py'], opt_level="3", debug_level="1", strict_dunder_typing=False),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/Users/jukka/venv/mypy/lib/python3.13/site-packages/setuptools/__init__.py", line 117, in setup
return distutils.core.setup(**attrs)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/Users/jukka/venv/mypy/lib/python3.13/site-packages/setuptools/_distutils/core.py", line 157, in setup
dist.parse_config_files()
~~~~~~~~~~~~~~~~~~~~~~~^^
File "/Users/jukka/venv/mypy/lib/python3.13/site-packages/setuptools/dist.py", line 608, in parse_config_files
pyprojecttoml.apply_configuration(self, filename, ignore_option_errors)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/jukka/venv/mypy/lib/python3.13/site-packages/setuptools/config/pyprojecttoml.py", line 71, in apply_configuration
config = read_configuration(filepath, True, ignore_option_errors, dist)
File "/Users/jukka/venv/mypy/lib/python3.13/site-packages/setuptools/config/pyprojecttoml.py", line 143, in read_configuration
return expand_configuration(asdict, root_dir, ignore_option_errors, dist)
File "/Users/jukka/venv/mypy/lib/python3.13/site-packages/setuptools/config/pyprojecttoml.py", line 168, in expand_configuration
return _ConfigExpander(config, root_dir, ignore_option_errors, dist).expand()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/Users/jukka/venv/mypy/lib/python3.13/site-packages/setuptools/config/pyprojecttoml.py", line 216, in expand
self._expand_all_dynamic(dist, package_dir)
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
File "/Users/jukka/venv/mypy/lib/python3.13/site-packages/setuptools/config/pyprojecttoml.py", line 262, in _expand_all_dynamic
readme=self._obtain_readme(dist),
~~~~~~~~~~~~~~~~~~~^^^^^^
File "/Users/jukka/venv/mypy/lib/python3.13/site-packages/setuptools/config/pyprojecttoml.py", line 328, in _obtain_readme
self._ensure_previously_set(dist, "readme")
~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
File "/Users/jukka/venv/mypy/lib/python3.13/site-packages/setuptools/config/pyprojecttoml.py", line 280, in _ensure_previously_set
raise InvalidConfigError(msg)
setuptools.errors.InvalidConfigError: No configuration found for dynamic 'readme'.
Some dynamic fields need to be specified via `tool.setuptools.dynamic`
The program t.py that I compiled is trivial:
print('hello')
This appears to be a regression that bisects to #18146. cc @cdce8p
The text was updated successfully, but these errors were encountered:
This appears to only happen when running mypyc from the root directory with mypy's pyproject.toml. Running mypyc from a different directory (without pyproject.toml) seems to work as expected.
I think what's happening is that 1) setuptools looks at the pyproject.toml file in the working directory, 2) mypy's pyproject.toml declares dynamic = ["readme"], meaning that setup.py needs to define long_description, 3) the setup.py generated by mypyc doesn't define long_description, hence setuptools complains.
When I try to compile a simple program using mypyc, I experience a crash (at least on macOS):
The program
t.py
that I compiled is trivial:This appears to be a regression that bisects to #18146. cc @cdce8p
The text was updated successfully, but these errors were encountered: