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 import does not check for duplicates #1584

Closed
1 task done
quassy opened this issue Dec 27, 2022 · 2 comments
Closed
1 task done

pdm import does not check for duplicates #1584

quassy opened this issue Dec 27, 2022 · 2 comments
Labels
🐛 bug Something isn't working 💝 good first issue Good for newcomers ❓ help wanted Extra attention is needed

Comments

@quassy
Copy link

quassy commented Dec 27, 2022

Running pdm import when you already have dependencies defined (maybe because you want to unify multiple requirements) or just by running it for the same file multiple times will result in duplicate entries.

  • 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.”; -v does not seem to change the output of pdm import.)

Steps to reproduce

Have a initialized pdm project with pyproject.toml and a simple requirements.txt file (echo sqlalchemy > requirements.txt).

Run pdm import requirements.txt -f requirements multiple times.

Actual behavior

You get duplicate dependencies:

[project]
...
dependencies = ["sqlalchemy", "sqlalchemy"]

Expected behavior

Entries already existing should not be added again.

[project]
...
dependencies = ["sqlalchemy"]

Environment Information

$ pdm info && pdm info --env
PDM version:
  2.3.3
Python Interpreter:
  /path/to/project/.venv/bin/python (3.10)
Project Root:
  /path/to/project
Project Packages:
  None
{
  "implementation_name": "cpython",
  "implementation_version": "3.10.9",
  "os_name": "posix",
  "platform_machine": "arm64",
  "platform_release": "22.2.0",
  "platform_system": "Darwin",
  "platform_version": "Darwin Kernel Version 22.2.0: Fri Nov 11 02:06:26 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T8112",
  "python_full_version": "3.10.9",
  "platform_python_implementation": "CPython",
  "python_version": "3.10",
  "sys_platform": "darwin"
}
@quassy quassy added the 🐛 bug Something isn't working label Dec 27, 2022
@frostming frostming added ❓ help wanted Extra attention is needed 💝 good first issue Good for newcomers labels Dec 27, 2022
@frostming
Copy link
Collaborator

I will mark it as first-time contribution-friendly since it is not urgent nor breaking anything.

@frostming
Copy link
Collaborator

Closed by #1627

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 💝 good first issue Good for newcomers ❓ help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants