Skip to content

Commit

Permalink
Merge pull request #28 from jayqi/27-fix-filenotfounderror-hatchling
Browse files Browse the repository at this point in the history
Import dependencies_in_sync from hatchling
  • Loading branch information
OldGrumpyViking authored May 14, 2024
2 parents 5cdeccc + 8c40665 commit 1fe58f1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
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

0 comments on commit 1fe58f1

Please sign in to comment.