forked from python-poetry/poetry
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure optional dev-depends are written to extras.
* Ensures that all requirements, whether from dependencies or dev-dependencies for extra targets are written to the lockfile. * Fixes python-poetry#426
- Loading branch information
1 parent
62fc038
commit 3599cff
Showing
3 changed files
with
22 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,8 +22,7 @@ def test_poetry(): | |
assert package.authors == ["Sébastien Eustace <[email protected]>"] | ||
assert package.license.id == "MIT" | ||
assert ( | ||
package.readme.relative_to(fixtures_dir).as_posix() | ||
== "sample_project/README.rst" | ||
package.readme.relative_to(fixtures_dir).as_posix() == "sample_project/README.rst" | ||
) | ||
assert package.homepage == "https://poetry.eustace.io" | ||
assert package.repository_url == "https://github.com/sdispater/poetry" | ||
|
@@ -156,3 +155,21 @@ def test_check_fails(): | |
) | ||
|
||
assert Poetry.check(content) == {"errors": [expected], "warnings": []} | ||
|
||
|
||
def test_poetry_writes_extras_from_dev_dependencies(): | ||
poetry = Poetry.create(str(fixtures_dir / "project_with_extras")) | ||
|
||
package = poetry.package | ||
|
||
dev_dependencies = {} | ||
for dep in package.dev_requires: | ||
dev_dependencies[dep.name] = dep | ||
|
||
black = dev_dependencies["black"] | ||
assert black.is_optional() | ||
|
||
assert "extras_c" in package.extras | ||
extras_c = package.extras["extras_c"] | ||
assert len(extras_c) == 1 | ||
assert extras_c[0].name == "black" |