Closed Georgehu716 closed 1 day ago
6 of them require uv to installed on your machine and I have skipped them in main branch.
Can you try again and show the failure details of the remaining case?
Sure, I've installed uv with pip, and here's the one remaining error:
================================================================================================ FAILURES =================================================================================================
______________________________________________________________________________________ test_convert_setup_py_project ______________________________________________________________________________________
project = <Project '/tmp/pytest-of-huerxiong/pytest-9/test_convert_setup_py_project0'>
def test_convert_setup_py_project(project):
golden_file = FIXTURES / "projects/test-setuptools/setup.py"
assert setup_py.check_fingerprint(project, golden_file)
> result, settings = setup_py.convert(project, golden_file, ns())
tests/test_formats.py:222:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src/pdm/formats/setup_py.py:20: in convert
parsed = parse_setup_py(str(project.environment.interpreter.executable), os.path.dirname(filename))
src/pdm/models/in_process/__init__.py:42: in parse_setup_py
subprocess.check_call(cmd)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
popenargs = (['/home/huerxiong/.pyenv/versions/3.12.4/bin/python3.12', '-Es', '/home/huerxiong/code/github.com/pdm/src/pdm/models/...se_setup.py', '/home/huerxiong/code/github.com/pdm/tests/fixtures/projects/test-setuptools', '/tmp/tmp9jkfod78.json'],)
kwargs = {}, retcode = 1
cmd = ['/home/huerxiong/.pyenv/versions/3.12.4/bin/python3.12', '-Es', '/home/huerxiong/code/github.com/pdm/src/pdm/models/i...arse_setup.py', '/home/huerxiong/code/github.com/pdm/tests/fixtures/projects/test-setuptools', '/tmp/tmp9jkfod78.json']
def check_call(*popenargs, **kwargs):
"""Run command with arguments. Wait for command to complete. If
the exit code was zero then return, otherwise raise
CalledProcessError. The CalledProcessError object will have the
return code in the returncode attribute.
The arguments are the same as for the call function. Example:
check_call(["ls", "-l"])
"""
retcode = call(*popenargs, **kwargs)
if retcode:
cmd = kwargs.get("args")
if cmd is None:
cmd = popenargs[0]
> raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/home/huerxiong/.pyenv/versions/3.12.4/bin/python3.12', '-Es', '/home/huerxiong/code/github.com/pdm/src/pdm/models/in_process/parse_setup.py', '/home/huerxiong/code/github.com/pdm/tests/fixtures/projects/test-setuptools', '/tmp/tmp9jkfod78.json']' returned non-zero exit status 1.
../../../.pyenv/versions/3.12.4/lib/python3.12/subprocess.py:413: CalledProcessError
------------------------------------------------------------------------------------------ Captured stdout setup ------------------------------------------------------------------------------------------
Changes are written to pyproject.toml.
------------------------------------------------------------------------------------------ Captured stderr call -------------------------------------------------------------------------------------------
Traceback (most recent call last):
File "/home/huerxiong/code/github.com/pdm/src/pdm/models/in_process/parse_setup.py", line 219, in <module>
json.dump(parse_setup(sys.argv[1]), f, default=json_default)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/huerxiong/code/github.com/pdm/src/pdm/models/in_process/parse_setup.py", line 181, in parse_setup
raise RuntimeError(
RuntimeError: setuptools is required to convert setup.py, install it by `pdm add setuptools`
========================================================================================= short test summary info =========================================================================================
SKIPPED [1] tests/test_utils.py:171: Windows test
FAILED tests/test_formats.py::test_convert_setup_py_project - subprocess.CalledProcessError: Command '['/home/huerxiong/.pyenv/versions/3.12.4/bin/python3.12', '-Es', '/home/huerxiong/code/github.com/pdm/src/pdm/models/in_process/parse_setup.py', '/home/huerxiong/code/github.com/pdm/tests/fixtures/projects/test-setuptools', '/tmp/tmp9jkfod78.json']' returned non-zero exit status 1.
=================================================================== 1 failed, 969 passed, 1 skipped, 198 warnings in 223.58s (0:03:43) ====================================================================
And setuptools has been installed as well:
(.venv) huerxiong in george-ubuntu ~/code/github.com/pdm (main)
$ pip list | grep -i setuptools
setuptools 75.2.0
(.venv) huerxiong in george-ubuntu ~/code/github.com/pdm (main)
$ pdm list | grep -i setuptools
│ setuptools │ 75.2.0 │ │
I've updated the latest code of fix, but it still not work:
================================================================================================ FAILURES =================================================================================================
______________________________________________________________________________________ test_convert_setup_py_project ______________________________________________________________________________________
project = <Project '/tmp/pytest-of-huerxiong/pytest-11/test_convert_setup_py_project0'>, pdm = <function pdm.<locals>.caller at 0x77b9b0987b00>
@pytest.mark.usefixtures("local_finder")
def test_convert_setup_py_project(project, pdm):
golden_file = FIXTURES / "projects/test-setuptools/setup.py"
pdm(["add", "setuptools"], obj=project)
assert setup_py.check_fingerprint(project, golden_file)
> result, settings = setup_py.convert(project, golden_file, ns())
tests/test_formats.py:224:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src/pdm/formats/setup_py.py:20: in convert
parsed = parse_setup_py(str(project.environment.interpreter.executable), os.path.dirname(filename))
src/pdm/models/in_process/__init__.py:42: in parse_setup_py
subprocess.check_call(cmd)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
popenargs = (['/home/huerxiong/.pyenv/versions/3.12.4/bin/python3.12', '-Es', '/home/huerxiong/code/github.com/pdm/src/pdm/models/...se_setup.py', '/home/huerxiong/code/github.com/pdm/tests/fixtures/projects/test-setuptools', '/tmp/tmptry2al1j.json'],)
kwargs = {}, retcode = 1
cmd = ['/home/huerxiong/.pyenv/versions/3.12.4/bin/python3.12', '-Es', '/home/huerxiong/code/github.com/pdm/src/pdm/models/i...arse_setup.py', '/home/huerxiong/code/github.com/pdm/tests/fixtures/projects/test-setuptools', '/tmp/tmptry2al1j.json']
def check_call(*popenargs, **kwargs):
"""Run command with arguments. Wait for command to complete. If
the exit code was zero then return, otherwise raise
CalledProcessError. The CalledProcessError object will have the
return code in the returncode attribute.
The arguments are the same as for the call function. Example:
check_call(["ls", "-l"])
"""
retcode = call(*popenargs, **kwargs)
if retcode:
cmd = kwargs.get("args")
if cmd is None:
cmd = popenargs[0]
> raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/home/huerxiong/.pyenv/versions/3.12.4/bin/python3.12', '-Es', '/home/huerxiong/code/github.com/pdm/src/pdm/models/in_process/parse_setup.py', '/home/huerxiong/code/github.com/pdm/tests/fixtures/projects/test-setuptools', '/tmp/tmptry2al1j.json']' returned non-zero exit status 1.
../../../.pyenv/versions/3.12.4/lib/python3.12/subprocess.py:413: CalledProcessError
------------------------------------------------------------------------------------------ Captured stdout setup ------------------------------------------------------------------------------------------
Changes are written to pyproject.toml.
Changes are written to pyproject.toml.
------------------------------------------------------------------------------------------ Captured stderr call -------------------------------------------------------------------------------------------
Traceback (most recent call last):
File "/home/huerxiong/code/github.com/pdm/src/pdm/models/in_process/parse_setup.py", line 219, in <module>
json.dump(parse_setup(sys.argv[1]), f, default=json_default)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/huerxiong/code/github.com/pdm/src/pdm/models/in_process/parse_setup.py", line 181, in parse_setup
raise RuntimeError(
RuntimeError: setuptools is required to convert setup.py, install it by `pdm add setuptools`
Try again
It works! Nice job, thank you.
Describe the bug
Failed to pass the tests when I follow the steps of https://github.com/pdm-project/pdm/blob/main/CONTRIBUTING.md#local-development to setup a local development environment.
Here is the outputs:
To reproduce
Just follow the steps of https://github.com/pdm-project/pdm/blob/main/CONTRIBUTING.md#local-development.
Expected Behavior
Pass the tests.
Environment Information
pdm -v output
Additional Context
Are you willing to submit a PR to fix this bug?