hatch
hatch copied to clipboard
Migration from setup.py to project.toml: comments in requirements.txt are included
I ran "hatch new --init" and found the comments in the requirements files are also included in the generated project.toml file. This would fail the command python -m build.
Can you please provide an example?
See the example
The example setup.py is as follows:
"""
"""
from pathlib import Path
import setuptools
cwd = Path(__file__).absolute().parent
long_description = (cwd / "README.md").read_text(encoding="utf-8")
setuptools.setup(
name="sample",
version="0.1.0",
author="Hao WEN",
author_email="[email protected]",
license="MIT",
description="Hatch Debug.",
long_description=long_description,
long_description_content_type="text/markdown",
package_dir={"": "src"},
packages=setuptools.find_packages("src"),
classifiers=[
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires=">=3.6",
install_requires=open("requirements.txt").readlines(),
)
Another question is: I specified the version explicitly in setup.py, why did hatch still point it to a file that does not exist?
@ofek