diff --git a/conda_lock/_vendor/grayskull/__init__.py b/conda_lock/_vendor/grayskull/__init__.py new file mode 100644 index 000000000..9ce1cd552 --- /dev/null +++ b/conda_lock/_vendor/grayskull/__init__.py @@ -0,0 +1,6 @@ +__all__ = ["__version__"] + +try: + from ._version import version as __version__ +except ImportError: + __version__ = "unknown" diff --git a/conda_lock/interfaces/vendored_grayskull.py b/conda_lock/interfaces/vendored_grayskull.py new file mode 100644 index 000000000..60ff1d5a3 --- /dev/null +++ b/conda_lock/interfaces/vendored_grayskull.py @@ -0,0 +1,6 @@ +from conda_lock._vendor.grayskull.strategy.parse_poetry_version import ( + encode_poetry_version, +) + + +__all__ = ["encode_poetry_version"] diff --git a/conda_lock/src_parser/pyproject_toml.py b/conda_lock/src_parser/pyproject_toml.py index a513eaed6..7d78fb383 100644 --- a/conda_lock/src_parser/pyproject_toml.py +++ b/conda_lock/src_parser/pyproject_toml.py @@ -28,10 +28,8 @@ from packaging.utils import canonicalize_name as canonicalize_pypi_name from typing_extensions import Literal -from conda_lock._vendor.grayskull.strategy.parse_poetry_version import ( - encode_poetry_version, -) from conda_lock.common import get_in +from conda_lock.interfaces.vendored_grayskull import encode_poetry_version from conda_lock.lookup import get_forward_lookup as get_lookup from conda_lock.models.lock_spec import ( Dependency, diff --git a/pyproject.toml b/pyproject.toml index 2b5b9fefe..96ac753f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -152,7 +152,11 @@ drop = [ "poetry/utils/shell.py", "poetry/core/_vendor/six.py", "poetry/core/_vendor/six.LICENSE", - '^grayskull\/(?!strategy$|strategy\/parse_poetry_version\.py$|strategy\/__init__\.py$).*$', + # Drop everything in grayskull/ except for the listed files: + # - __init__.py + # - strategy/parse_poetry_version.py + # - strategy/__init__.py + '^grayskull\/(?!__init__\.py$|strategy\/parse_poetry_version\.py$|strategy\/__init__\.py$)', ] substitute = [ # simple substitution patch to fix conda.exports