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 export to poetry format bug #2877

Closed
natali-avr opened this issue May 9, 2024 · 2 comments · Fixed by #2888
Closed

PDM export to poetry format bug #2877

natali-avr opened this issue May 9, 2024 · 2 comments · Fixed by #2888
Assignees
Labels
🙋 question Further information is requested

Comments

@natali-avr
Copy link

When running the command pdm export --format poetry -v
It throws an NotImplementedError error.

STATUS: Resolving packages from lockfile...
STATUS: Fetching hashes for resolved packages...
Traceback (most recent call last):
File "/opt/homebrew/bin/pdm", line 8, in
sys.exit(main())
^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/pdm/core.py", line 358, in main
return core.main(args or sys.argv[1:])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/pdm/core.py", line 276, in main
raise cast(Exception, err).with_traceback(traceback) from None
File "/opt/homebrew/lib/python3.11/site-packages/pdm/core.py", line 271, in main
self.handle(project, options)
File "/opt/homebrew/lib/python3.11/site-packages/pdm/core.py", line 207, in handle
command.handle(project, options)
File "/opt/homebrew/lib/python3.11/site-packages/pdm/cli/commands/export.py", line 80, in handle
content = FORMATS[options.format].export(project, packages, options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/pdm/formats/poetry.py", line 238, in export
raise NotImplementedError()
NotImplementedError

PDM version installed:
PDM, version 2.15.2

@natali-avr natali-avr added the 🐛 bug Something isn't working label May 9, 2024
@frostming
Copy link
Collaborator

frostming commented May 9, 2024

Haha, not a bug. No export now. Or are you interested in contributing this?

@frostming frostming added 🙋 question Further information is requested and removed 🐛 bug Something isn't working labels May 9, 2024
@natali-avr
Copy link
Author

This is a bit confusing.. If there is no export supported, so why is this command available and pdm export --help make it looks like it's supported.
If that option does not work, seems to me better not to show this option at all...

pdm export --help
Usage: pdm export [-h] [-v | -q] [-g] [-p PROJECT_PATH] [-L LOCKFILE]
[-f {pipfile,poetry,flit,setuppy,requirements}] [-G GROUP]
[--without] [--no-default] [-d | --prod] [--no-hashes]
[--no-markers] [-o OUTPUT] [--pyproject] [--expandvars]
[--self | --editable-self]

Export the locked packages set to other formats

Options:
-h, --help Show this help message and exit.
-v, --verbose Use -v for detailed output and -vv for more
detailed
-q, --quiet Suppress output
-g, --global Use the global project, supply the project root with
-p option
-p PROJECT_PATH, --project PROJECT_PATH
Specify another path as the project root, which
changes the base of pyproject.toml and pypackages
[env var: PDM_PROJECT]
-L LOCKFILE, --lockfile LOCKFILE
Specify another lockfile path. Default: pdm.lock. [env
var: PDM_LOCKFILE]
-f {pipfile,poetry,flit,setuppy,requirements}, --format
{pipfile,poetry,flit,setuppy,requirements}
Specify the export file format

--no-hashes, --without-hashes
Don't include artifact hashes
--no-markers Don't include platform markers
-o OUTPUT, --output OUTPUT
Write output to the given file, or print to stdout if
not given
--pyproject Read the list of packages from pyproject.toml
--expandvars Expand environment variables in requirements
--self Include the project itself
--editable-self Include the project itself as an editable dependency

Dependencies Selection:
-G GROUP, --group GROUP, --with GROUP
Select group of optional-dependencies separated by
comma or dev-dependencies (with -d). Can be supplied
multiple times, use ":all" to include all groups under
the same species.
--without Exclude groups of optional-dependencies or dev-
dependencies
--no-default Don't include dependencies from the default group
-d, --dev Select dev dependencies
--prod, --production Unselect dev dependencies

@frostming frostming self-assigned this May 17, 2024
frostming added a commit that referenced this issue May 17, 2024
Fixes #2877

Signed-off-by: Frost Ming <me@frostming.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙋 question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants