diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ed055722b64..4ebdb23aae1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -97,17 +97,18 @@ jobs: run: poetry run python -m pytest -n auto -p no:sugar -q --integration tests/integration - name: Get Plugin Version (poetry-plugin-export) + uses: sergeysova/jq-action@v2 id: poetry-plugin-export-version - run: | - echo ::set-output name=version::$(\ - poetry show poetry-plugin-export | grep version | cut -d : -f 2 | xargs) + with: + cmd: | + curl -s https://pypi.org/pypi/poetry-plugin-export/json | jq -r '.info.version' - name: Checkout Plugin Source (poetry-plugin-export) uses: actions/checkout@v2 with: path: poetry-plugin-export repository: python-poetry/poetry-plugin-export - ref: refs/tags/${{ steps.poetry-plugin-export-version.outputs.version }} + ref: refs/tags/${{ steps.poetry-plugin-export-version.outputs.value }} - name: Run pytest (poetry-plugin-export) run: poetry run python -m pytest -p no:sugar -q poetry-plugin-export/tests/ diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index d2662b8a420..7e4bc029d3c 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -14,13 +14,3 @@ language: python language_version: python3 pass_filenames: false - -- id: poetry-export - name: poetry-export - description: run poetry export to sync lock file with requirements.txt - entry: poetry export - language: python - language_version: python3 - pass_filenames: false - files: ^poetry.lock$ - args: ["-f", "requirements.txt", "-o", "requirements.txt"] diff --git a/docs/pre-commit-hooks.md b/docs/pre-commit-hooks.md index a032c10e6cd..a7cf6583a0f 100644 --- a/docs/pre-commit-hooks.md +++ b/docs/pre-commit-hooks.md @@ -53,6 +53,8 @@ The `poetry-export` hook calls the `poetry export` command to sync your `requirements.txt` file with your current dependencies. {{% note %}} +This command is provided by the [Export Poetry Plugin](https://github.com/python-poetry/poetry-plugin-export). + It is recommended to run the [`poetry-lock`](#poetry-lock) hook prior to this one. {{% /note %}} diff --git a/poetry.lock b/poetry.lock index edf1cef0041..4b6b9ebfb2b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -453,17 +453,6 @@ python-versions = ">=3.7,<4.0" [package.dependencies] importlib-metadata = {version = ">=1.7.0", markers = "python_version < \"3.8\""} -[[package]] -name = "poetry-plugin-export" -version = "1.0.4" -description = "Poetry plugin to export the dependencies to various formats" -category = "main" -optional = false -python-versions = ">=3.7,<4.0" - -[package.dependencies] -poetry = ">=1.2.0b1dev0,<2.0.0" - [[package]] name = "pre-commit" version = "2.19.0" @@ -887,7 +876,7 @@ testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest- [metadata] lock-version = "1.1" python-versions = "^3.7" -content-hash = "4c18d27808d5a637e9591ff8444ef9435ffa1fa1df5cdffd5e4fd1c5780547a4" +content-hash = "bc771ee00da6912f290de03954874850c6f0543b1ee355ae2d510de36e321a25" [metadata.files] atomicwrites = [ @@ -1241,10 +1230,6 @@ poetry-core = [ {file = "poetry-core-1.1.0b2.tar.gz", hash = "sha256:48ef71ff8a4c2f0b4eaf9c138c12feb96dbf32e65baac8ca673769d05edf142f"}, {file = "poetry_core-1.1.0b2-py3-none-any.whl", hash = "sha256:4967fe08f745291b353328d4226d378a1731de2997a25b7a0c891e302460108d"}, ] -poetry-plugin-export = [ - {file = "poetry-plugin-export-1.0.4.tar.gz", hash = "sha256:dfc8b9b12717cff24fd5f74346cf35d4acf97981d70abee85f62caea41541a1b"}, - {file = "poetry_plugin_export-1.0.4-py3-none-any.whl", hash = "sha256:f4569cfd0051cf85dfdbd1e5ccd8255930eb921c7aacbbb037a8bf43a2646ac4"}, -] pre-commit = [ {file = "pre_commit-2.19.0-py2.py3-none-any.whl", hash = "sha256:10c62741aa5704faea2ad69cb550ca78082efe5697d6f04e5710c3c229afdd10"}, {file = "pre_commit-2.19.0.tar.gz", hash = "sha256:4233a1e38621c87d9dda9808c6606d7e7ba0e087cd56d3fe03202a01d2919615"}, diff --git a/pyproject.toml b/pyproject.toml index 6570cae5d69..97d826ad190 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,7 +45,6 @@ generate-setup-file = false python = "^3.7" poetry-core = "^1.1.0b2" -poetry-plugin-export = "^1.0.4" cachecontrol = { version = "^0.12.9", extras = ["filecache"] } cachy = "^0.3.0" cleo = "^1.0.0a5" diff --git a/src/poetry/factory.py b/src/poetry/factory.py index fb4b60c5b8e..e70659a522b 100644 --- a/src/poetry/factory.py +++ b/src/poetry/factory.py @@ -3,7 +3,6 @@ import contextlib import logging import re -import warnings from typing import TYPE_CHECKING from typing import Any @@ -59,12 +58,7 @@ def create_poetry( ) # Loading global configuration - with warnings.catch_warnings(): - # this is preserved to ensure export plugin tests pass in ci, - # once poetry-plugin-export version is updated to use one that do not - # use Factory.create_config(), this can be safely removed. - warnings.filterwarnings("ignore", category=DeprecationWarning) - config = self.create_config() + config = Config.create() # Loading local configuration local_config_file = TOMLFile(base_poetry.file.parent / "poetry.toml") @@ -113,16 +107,6 @@ def create_poetry( def get_package(cls, name: str, version: str) -> ProjectPackage: return ProjectPackage(name, version, version) - @classmethod - def create_config(cls, io: IO | None = None) -> Config: - if io is not None: - logger.debug("Ignoring provided io when creating config.") - warnings.warn( - "Use of Factory.create_config() is deprecated, use Config.create() instead", - DeprecationWarning, - ) - return Config.create() - @classmethod def configure_sources( cls,