Skip to content

Commit

Permalink
Fix tests; add subdirectory simple parsing test
Browse files Browse the repository at this point in the history
  • Loading branch information
romain-intel committed Sep 27, 2024
1 parent df2b806 commit 247d1cb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion conda_lock/src_parser/pyproject_toml.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,15 @@ def parse_python_requirement(
... ) # doctest: +NORMALIZE_WHITESPACE
VCSDependency(name='conda-lock', manager='conda', category='main', extras=[],
markers=None, source='https://github.com/conda/conda-lock.git', vcs='git',
rev='v2.4.1')
rev='v2.4.1', subdirectory=None)
>>> parse_python_requirement(
... "conda-lock @ git+https://github.com/conda/conda-lock.git@v2.4.1#subdirectory=src",
... mapping_url=DEFAULT_MAPPING_URL,
... ) # doctest: +NORMALIZE_WHITESPACE
VCSDependency(name='conda-lock', manager='conda', category='main', extras=[],
markers=None, source='https://github.com/conda/conda-lock.git', vcs='git',
rev='v2.4.1', subdirectory='src')
>>> parse_python_requirement(
... "some-package @ https://some-repository.org/some-package-1.2.3.tar.gz",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_conda_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ def test_parse_poetry_path(poetry_pyproject_toml_path: Path):
specs = {dep.name: dep for dep in res.dependencies["linux-64"]}

assert isinstance(specs["fake-private-package"], PathDependency)
assert specs["fake-private-package"].path == "./fake-private-package-1.0.0"
assert specs["fake-private-package"].path == "fake-private-package-1.0.0"


def test_parse_poetry_no_pypi(poetry_pyproject_toml_no_pypi: Path):
Expand Down

0 comments on commit 247d1cb

Please sign in to comment.