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

Warning on pre-commit hook #249

Open
dga-nagra opened this issue Dec 6, 2023 · 1 comment
Open

Warning on pre-commit hook #249

dga-nagra opened this issue Dec 6, 2023 · 1 comment

Comments

@dga-nagra
Copy link

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

@Insighttful
Copy link

Insighttful commented Dec 28, 2023

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'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants