Skip to content

Commit

Permalink
Recreate doctests
Browse files Browse the repository at this point in the history
This reverts commit b5f0f59b71dfe7fba6c44fd7d6df074cc562c37c.
  • Loading branch information
maresb committed Sep 15, 2024
1 parent a612310 commit 66ab420
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions conda_lock/src_parser/pyproject_toml.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,19 @@ def parse_python_requirement(
VersionedDependency(name='my-package', manager='conda', category='main', extras=[],
markers=None, version='*', build=None, conda_channel=None, hash=None)
The PyPI name `build` will be translated to `python-build` for conda.
>>> parse_python_requirement(
... "build",
... mapping_url=DEFAULT_MAPPING_URL,
... ) # doctest: +NORMALIZE_WHITESPACE
VersionedDependency(name='python-build', manager='conda', category='main',
extras=[], markers=None, version='*', build=None, conda_channel=None, hash=None)
No translation is done for `manager="pip"`.
>>> parse_python_requirement("build", manager="pip", mapping_url=DEFAULT_MAPPING_URL) # doctest: +NORMALIZE_WHITESPACE
VersionedDependency(name='build', manager='pip', category='main',
extras=[], markers=None, version='*', build=None, conda_channel=None, hash=None)
>>> parse_python_requirement(
... "My_Package[extra]==1.23",
... mapping_url=DEFAULT_MAPPING_URL,
Expand Down

0 comments on commit 66ab420

Please sign in to comment.