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

Import dependencies_in_sync from hatchling #28

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions hatch_conda/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import pexpect
from hatch.env.plugin.interface import EnvironmentInterface
from hatch.utils.env import PythonInfo


class ShellManager:
Expand Down Expand Up @@ -213,12 +214,14 @@ def dependencies_in_sync(self):
if not self.dependencies:
return True
self.apply_env_vars()

from hatchling.dep.core import dependencies_in_sync

python_info = PythonInfo(self.platform)
with self:
process = self.platform.run_command(
" ".join(["hatchling", "dep", "synced", "-p", "python", *self.dependencies]),
capture_output=True,
return dependencies_in_sync(
self.dependencies_complex, sys_path=python_info.sys_path, environment=python_info.environment
)
return not process.returncode

def sync_dependencies(self):
self.apply_env_vars()
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ classifiers = [
]
dependencies = [
"hatch>=1.2.0",
"hatchling>=1.0.0",
"pexpect~=4.8",
]
dynamic = ["version"]
Expand Down Expand Up @@ -87,4 +88,4 @@ exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:", "r
exclude = [".direnv", ]
select = ["B","C","E","F","W","B001","B003","B006","B007","B301","B305","B306","B902","Q001","Q002","Q003"]
ignore = ["E203","E722","W503"]
max-line-length = 120
max-line-length = 120