LoginSignup
1
0

[備忘録] Poetryからrequirements.txtを出力させる

Last updated at Posted at 2023-12-08

出力方法

[tool.poetry.dependencies]に記述しているもののみ出力させる場合

$ poetry export -f requirements.txt -o requirements.txt --without-hashes

[tool.poetry.group.dev.dependencies]のものを含める場合

$ poetry export -f requirements.txt -o requirements.txt --without-hashes --with dev

poetry exportコマンドの引数

Description:
  Exports the lock file to alternative formats.

Usage:
  export [options]

Options:
  -f, --format=FORMAT        Format to export to. Currently, only constraints.txt and requirements.txt are supported. [default: "requirements.txt"]
  -o, --output=OUTPUT        The name of the output file.
      --without-hashes       Exclude hashes from the exported file.
      --without-urls         Exclude source repository urls from the exported file.
      --dev                  Include development dependencies. (Deprecated)
      --without=WITHOUT      The dependency groups to ignore. (multiple values allowed)
      --with=WITH            The optional dependency groups to include. (multiple values allowed)
      --only=ONLY            The only dependency groups to include. (multiple values allowed)
  -E, --extras=EXTRAS        Extra sets of dependencies to include. (multiple values allowed)
      --with-credentials     Include credentials for extra indices.
  -h, --help                 Display help for the given command. When no command is given display help for the list command.
  -q, --quiet                Do not output any message.
  -V, --version              Display this application version.
      --ansi                 Force ANSI output.
      --no-ansi              Disable ANSI output.
  -n, --no-interaction       Do not ask any interactive question.
      --no-plugins           Disables plugins.
      --no-cache             Disables Poetry source caches.
  -C, --directory=DIRECTORY  The working directory for the Poetry command (defaults to the current working directory).
  -v|vv|vvv, --verbose       Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug.
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0