astral-sh / rye

a Hassle-Free Python Experience
https://rye.astral.sh
MIT License
13.81k stars 467 forks source link

rye init: error: EOF while parsing a value at line 1 column 0 #953

Open pplmx opened 7 months ago

pplmx commented 7 months ago

Steps to Reproduce

# generate a python project from template
cargo generate gh:x-pt/template template/py

cd <your-new-project>
rye init

Expected Result

rye init can be successful in a existed project

Actual Result

rye init error: EOF while parsing a value at line 1 column 0

Version Info

rye 0.32.0 commit: 0.31.0+3 (153213c6a 2024-03-22) platform: windows (x86_64) self-python: cpython@3.12.2 symlink support: true uv enabled: true

Stacktrace

No response

bluss commented 7 months ago

Would it be possible to attach the pyproject.toml (or requirements.txt?), assuming that's the file having issues, and what is the encoding of that file?

pplmx commented 7 months ago

hi, @bluss

The project has no pyproject.toml or requirement.txt. I found the root cause: a empty setup.py. After delete it, the rye init can work fine.

setup.py: UTF-8, LF

pplmx commented 7 months ago

hi, @bluss

Maybe We should print some other error message when a empty setup.py exists instead of EOF while parsing a value at line 1 column 0