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

pdm list --resolve produces redundant spinner output #1646

Closed
1 task done
BlueGlassBlock opened this issue Jan 26, 2023 · 0 comments · Fixed by j178/pdm#1
Closed
1 task done

pdm list --resolve produces redundant spinner output #1646

BlueGlassBlock opened this issue Jan 26, 2023 · 0 comments · Fixed by j178/pdm#1
Labels
🐛 bug Something isn't working

Comments

@BlueGlassBlock
Copy link
Contributor

  • I have searched the issue tracker and believe that this is not a duplicate.

Make sure you run commands with -v flag before pasting the output.

Steps to reproduce

take pdm repo for example.
pdm list --resolve --json >> ./out.json

Actual behavior

File: out.json

The following extra lines are added to the output.

STATUS: Resolving packages from lockfile...
STATUS: Fetching hashes for resolved packages...
STATUS: Resolving packages from lockfile...
STATUS: Fetching hashes for resolved packages...
[
    {
        "name": "installer",
        "version": "0.6.0",
        "location": ""
    },
    {
        "name": "packaging",
        "version": "23.0",
        "location": ""
    },
    {
        "name": "pdm-pep517",
        "version": "1.0.6",
        "location": ""
    },
    {
        "name": "resolvelib",
        "version": "0.9.0",
        "location": ""
    },
    {
        "name": "tomlkit",
        "version": "0.11.6",
        "location": ""
    },
    {
        "name": "findpython",
        "version": "0.2.2",
        "location": ""
    },
    {
        "name": "markdown-exec",
        "version": "1.0.0",
        "location": ""
    },
    {
        "name": "markdown-include",
        "version": "0.8.0",
        "location": ""
    },
    {
        "name": "mike",
        "version": "1.1.2",
        "location": ""
    },
    {
        "name": "mkdocs",
        "version": "1.4.2",
        "location": ""
    },
    {
        "name": "mkdocs-material",
        "version": "9.0.4",
        "location": ""
    },
    {
        "name": "parver",
        "version": "0.4",
        "location": ""
    },
    {
        "name": "pycomplete",
        "version": "0.3.2",
        "location": ""
    },
    {
        "name": "pytest-rerunfailures",
        "version": "11.0",
        "location": ""
    },
    {
        "name": "pytest",
        "version": "7.2.0",
        "location": ""
    },
    {
        "name": "tomli",
        "version": "2.0.1",
        "location": ""
    },
    {
        "name": "pytest-xdist",
        "version": "3.1.0",
        "location": ""
    },
    {
        "name": "python-dotenv",
        "version": "0.21.0",
        "location": ""
    },
    {
        "name": "rich",
        "version": "13.0.1",
        "location": ""
    },
    {
        "name": "setuptools",
        "version": "65.7.0",
        "location": ""
    },
    {
        "name": "shellingham",
        "version": "1.5.0.post1",
        "location": ""
    },
    {
        "name": "towncrier",
        "version": "22.12.0",
        "location": ""
    },
    {
        "name": "tox-pdm",
        "version": "0.6.1",
        "location": ""
    },
    {
        "name": "tox",
        "version": "4.2.8",
        "location": ""
    },
    {
        "name": "virtualenv",
        "version": "20.17.1",
        "location": ""
    },
    {
        "name": "platformdirs",
        "version": "2.6.2",
        "location": ""
    },
    {
        "name": "unearth",
        "version": "0.7.2",
        "location": ""
    },
    {
        "name": "blinker",
        "version": "1.5",
        "location": ""
    },
    {
        "name": "certifi",
        "version": "2022.12.7",
        "location": ""
    },
    {
        "name": "pyproject_hooks",
        "version": "1.0.0",
        "location": ""
    },
    {
        "name": "pytest-cov",
        "version": "4.0.0",
        "location": ""
    },
    {
        "name": "pytest-mock",
        "version": "3.10.0",
        "location": ""
    },
    {
        "name": "requests-toolbelt",
        "version": "0.10.1",
        "location": ""
    },
    {
        "name": "CacheControl",
        "version": "0.12.11",
        "location": ""
    },
    {
        "name": "mkdocstrings",
        "version": "0.19.1",
        "location": ""
    },
    {
        "name": "Markdown",
        "version": "3.3.7",
        "location": ""
    },
    {
        "name": "requests",
        "version": "2.28.1",
        "location": ""
    },
    {
        "name": "colorama",
        "version": "0.4.6",
        "location": ""
    },
    {
        "name": "filelock",
        "version": "3.9.0",
        "location": ""
    },
    {
        "name": "Jinja2",
        "version": "3.1.2",
        "location": ""
    },
    {
        "name": "pluggy",
        "version": "1.0.0",
        "location": ""
    },
    {
        "name": "Pygments",
        "version": "2.14.0",
        "location": ""
    },
    {
        "name": "pymdown-extensions",
        "version": "9.9.1",
        "location": ""
    },
    {
        "name": "attrs",
        "version": "22.2.0",
        "location": ""
    },
    {
        "name": "commonmark",
        "version": "0.9.1",
        "location": ""
    },
    {
        "name": "distlib",
        "version": "0.3.6",
        "location": ""
    },
    {
        "name": "PyYAML",
        "version": "6.0",
        "location": ""
    },
    {
        "name": "Arpeggio",
        "version": "2.0.0",
        "location": ""
    },
    {
        "name": "cachetools",
        "version": "5.2.1",
        "location": ""
    },
    {
        "name": "chardet",
        "version": "5.1.0",
        "location": ""
    },
    {
        "name": "click",
        "version": "8.1.3",
        "location": ""
    },
    {
        "name": "coverage",
        "version": "7.0.5",
        "location": ""
    },
    {
        "name": "exceptiongroup",
        "version": "1.1.0",
        "location": ""
    },
    {
        "name": "execnet",
        "version": "1.9.0",
        "location": ""
    },
    {
        "name": "ghp-import",
        "version": "2.1.0",
        "location": ""
    },
    {
        "name": "lockfile",
        "version": "0.12.2",
        "location": ""
    },
    {
        "name": "mergedeep",
        "version": "1.3.4",
        "location": ""
    },
    {
        "name": "mkdocs-material-extensions",
        "version": "1.1.1",
        "location": ""
    },
    {
        "name": "mkdocstrings-python",
        "version": "0.8.3",
        "location": ""
    },
    {
        "name": "pyproject_api",
        "version": "1.4.0",
        "location": ""
    },
    {
        "name": "pyyaml_env_tag",
        "version": "0.1",
        "location": ""
    },
    {
        "name": "regex",
        "version": "2022.10.31",
        "location": ""
    },
    {
        "name": "watchdog",
        "version": "2.2.1",
        "location": ""
    },
    {
        "name": "click-default-group",
        "version": "1.2.2",
        "location": ""
    },
    {
        "name": "incremental",
        "version": "22.10.0",
        "location": ""
    },
    {
        "name": "iniconfig",
        "version": "2.0.0",
        "location": ""
    },
    {
        "name": "verspec",
        "version": "0.1.0",
        "location": ""
    },
    {
        "name": "charset-normalizer",
        "version": "2.1.1",
        "location": ""
    },
    {
        "name": "idna",
        "version": "3.4",
        "location": ""
    },
    {
        "name": "MarkupSafe",
        "version": "2.1.1",
        "location": ""
    },
    {
        "name": "urllib3",
        "version": "1.26.14",
        "location": ""
    },
    {
        "name": "griffe",
        "version": "0.25.3",
        "location": ""
    },
    {
        "name": "mkdocs-autorefs",
        "version": "0.4.1",
        "location": ""
    },
    {
        "name": "msgpack",
        "version": "1.0.4",
        "location": ""
    },
    {
        "name": "python-dateutil",
        "version": "2.8.2",
        "location": ""
    },
    {
        "name": "six",
        "version": "1.16.0",
        "location": ""
    }
]

Expected behavior

The following lines are not included in the output file.

STATUS: Resolving packages from lockfile...
STATUS: Fetching hashes for resolved packages...

Environment Information

PDM version:
  2.4.0
Python Interpreter:
  E:\PythonProjects\pdm\.venv\Scripts\python.exe (3.10)
Project Root:
  E:/PythonProjects/pdm
Project Packages:
  None
{
  "implementation_name": "cpython",
  "implementation_version": "3.10.8",
  "os_name": "nt",
  "platform_machine": "AMD64",
  "platform_release": "10",
  "platform_system": "Windows",
  "platform_version": "10.0.22621",
  "python_full_version": "3.10.8",
  "platform_python_implementation": "CPython",
  "python_version": "3.10",
  "sys_platform": "win32"
}

Patch

This bug can be solved by suppressing the spinner on stdout, opened by pdm.cli.actions.resolve_candidates_from_lockfile.

Alternatively, adding an --output option to specify target file location is also feasible.

@BlueGlassBlock BlueGlassBlock added the 🐛 bug Something isn't working label Jan 26, 2023
@BlueGlassBlock BlueGlassBlock changed the title pdm list --resolve produces invalid target file when writing to file with pipeline pdm list --resolve produces redundant output Jan 26, 2023
@BlueGlassBlock BlueGlassBlock changed the title pdm list --resolve produces redundant output pdm list --resolve produces redundant spinner output Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant