Skip to content

Commit 2133fa7

Browse files
committed
remove circular dependency on export plugin
1 parent bf885ac commit 2133fa7

File tree

6 files changed

+12
-45
lines changed

6 files changed

+12
-45
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ jobs:
7474
path: .venv
7575
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
7676

77+
- name: temp early plugin version getter
78+
uses: sergeysova/jq-action@v2
79+
id: poetry-plugin-export-version-early
80+
run: |
81+
curl -s https://pypi.org/pypi/poetry-plugin-export/json | jq -r '.info.version'
82+
7783
- name: Ensure cache is healthy
7884
if: steps.cache.outputs.cache-hit == 'true'
7985
run: timeout 10s poetry run pip --version || rm -rf .venv
@@ -97,10 +103,11 @@ jobs:
97103
run: poetry run python -m pytest -n auto -p no:sugar -q --integration tests/integration
98104

99105
- name: Get Plugin Version (poetry-plugin-export)
106+
uses: sergeysova/jq-action@v2
100107
id: poetry-plugin-export-version
101108
run: |
102109
echo ::set-output name=version::$(\
103-
poetry show poetry-plugin-export | grep version | cut -d : -f 2 | xargs)
110+
curl -s https://pypi.org/pypi/poetry-plugin-export/json | jq -r '.info.version')
104111
105112
- name: Checkout Plugin Source (poetry-plugin-export)
106113
uses: actions/checkout@v2

.pre-commit-hooks.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,3 @@
1414
language: python
1515
language_version: python3
1616
pass_filenames: false
17-
18-
- id: poetry-export
19-
name: poetry-export
20-
description: run poetry export to sync lock file with requirements.txt
21-
entry: poetry export
22-
language: python
23-
language_version: python3
24-
pass_filenames: false
25-
files: ^poetry.lock$
26-
args: ["-f", "requirements.txt", "-o", "requirements.txt"]

docs/pre-commit-hooks.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ The `poetry-export` hook calls the `poetry export` command
5353
to sync your `requirements.txt` file with your current dependencies.
5454

5555
{{% note %}}
56+
This command is provided by the [Export Poetry Plugin](https://github.com/python-poetry/poetry-plugin-export).
57+
5658
It is recommended to run the [`poetry-lock`](#poetry-lock) hook prior to this one.
5759
{{% /note %}}
5860

poetry.lock

Lines changed: 1 addition & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ generate-setup-file = false
4545
python = "^3.7"
4646

4747
poetry-core = "^1.1.0b2"
48-
poetry-plugin-export = "^1.0.4"
4948
cachecontrol = { version = "^0.12.9", extras = ["filecache"] }
5049
cachy = "^0.3.0"
5150
cleo = "^1.0.0a5"

src/poetry/factory.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import contextlib
44
import logging
55
import re
6-
import warnings
76

87
from typing import TYPE_CHECKING
98
from typing import Any
@@ -59,12 +58,7 @@ def create_poetry(
5958
)
6059

6160
# Loading global configuration
62-
with warnings.catch_warnings():
63-
# this is preserved to ensure export plugin tests pass in ci,
64-
# once poetry-plugin-export version is updated to use one that do not
65-
# use Factory.create_config(), this can be safely removed.
66-
warnings.filterwarnings("ignore", category=DeprecationWarning)
67-
config = self.create_config()
61+
config = Config.create()
6862

6963
# Loading local configuration
7064
local_config_file = TOMLFile(base_poetry.file.parent / "poetry.toml")
@@ -113,16 +107,6 @@ def create_poetry(
113107
def get_package(cls, name: str, version: str) -> ProjectPackage:
114108
return ProjectPackage(name, version, version)
115109

116-
@classmethod
117-
def create_config(cls, io: IO | None = None) -> Config:
118-
if io is not None:
119-
logger.debug("Ignoring provided io when creating config.")
120-
warnings.warn(
121-
"Use of Factory.create_config() is deprecated, use Config.create() instead",
122-
DeprecationWarning,
123-
)
124-
return Config.create()
125-
126110
@classmethod
127111
def configure_sources(
128112
cls,

0 commit comments

Comments
 (0)