poetry-plugin-export icon indicating copy to clipboard operation
poetry-plugin-export copied to clipboard

Warning on pre-commit hook

Open dga-nagra opened this issue 2 years ago • 1 comments

I am using the following pre-commit hook:

  - repo: https://github.com/python-poetry/poetry
    rev: '1.6.0'  # add version here
    hooks:
      - id: poetry-check
        args: [--no-cache]
        language_version: python3.9
      - id: poetry-lock
        args: [--no-cache]
        language_version: python3.9

  - repo: https://github.com/python-poetry/poetry-plugin-export
    rev: '1.6.0'  # add version here
    hooks:
      - id: poetry-export
        args: ["--no-cache", "-f", "requirements.txt", "-o", "requirements.txt"]
        language_version: python3.9

and receiving the following warning: image

It seems that it is not using the plugin and instead use the deprecated poetry export command

dga-nagra avatar Dec 06 '23 12:12 dga-nagra

Maybe be related. When running a bash script from pre-commit that includes the export command with the latest plugin installed also receiving the warning message.

# pre-commit-config.yaml
...
  - repo: local
    hooks:
      - id: generate-requirements
        name: Generate Requirements for Pip
        entry: ./scripts/script-update-pip-reqs.sh
        language: system
        always_run: true
        pass_filenames: false
#!/bin/bash

# Ensure latest poetry export plugin is installed. Required post poetry v1.7.1
# Ref: https://github.com/python-poetry/poetry-plugin-export
poetry self add poetry-plugin-export@latest

# Generate initial requirements.txt using poetry export plugin per plugin docs
poetry export -f requirements.txt --output requirements.txt --without-hashes --without dev

# Exit with success
exit 0

Warning

Using version ^1.6.0 for poetry-plugin-export

Updating dependencies
Resolving dependencies... (0.1s)

No dependencies to install or update
Warning: poetry-plugin-export will not be installed by default in a future version of Poetry.
In order to avoid a breaking change and make your automation forward-compatible, please install poetry-plugin-export explicitly. See https://python-poetry.org/docs/plugins/#using-plugins for details on how to install a plugin.
To disable this warning run 'poetry config warnings.export false'.

Insighttful avatar Dec 28 '23 17:12 Insighttful