Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration from setup.py to project.toml: comments in requirements.txt are included #1691

Open
wenh06 opened this issue Aug 24, 2024 · 3 comments

Comments

@wenh06
Copy link

wenh06 commented Aug 24, 2024

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.

@wenh06 wenh06 changed the title Migration from setup.py to project.toml: comments in requirements.txt is included Migration from setup.py to project.toml: comments in requirements.txt are included Aug 24, 2024
@ofek
Copy link
Sponsor Collaborator

ofek commented Aug 24, 2024

Can you please provide an example?

@wenh06
Copy link
Author

wenh06 commented Aug 25, 2024

See the example

image

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?

@wenh06
Copy link
Author

wenh06 commented Aug 26, 2024

@ofek

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants