File tree Expand file tree Collapse file tree 6 files changed +64
-3
lines changed
fixtures/project_with_included_groups_only Expand file tree Collapse file tree 6 files changed +64
-3
lines changed Original file line number Diff line number Diff line change @@ -347,7 +347,7 @@ def _configure_package_dependencies(
347347 cls ._add_package_group_dependencies (
348348 package = package ,
349349 group = group ,
350- dependencies = group_config [ "dependencies" ] ,
350+ dependencies = group_config . get ( "dependencies" , {}) ,
351351 )
352352
353353 for group_name , group_config in tool_poetry ["group" ].items ():
Original file line number Diff line number Diff line change 171171 "^[a-zA-Z-_.0-9]+$" : {
172172 "type" : " object" ,
173173 "description" : " This represents a single dependency group" ,
174- "required" : [
175- " dependencies"
174+ "anyOf" : [
175+ {
176+ "required" : [
177+ " dependencies"
178+ ]
179+ },
180+ {
181+ "required" : [
182+ " include-groups"
183+ ]
184+ }
176185 ],
177186 "properties" : {
178187 "optional" : {
Original file line number Diff line number Diff line change 1+ My Package
2+ ==========
Original file line number Diff line number Diff line change 1+ [tool .poetry ]
2+ name = " simple-project"
3+ version = " 1.2.3"
4+ description = " Some description."
5+ authors = [
6+ " Sébastien Eustace <sebastien@eustace.io>"
7+ ]
8+ license = " MIT"
9+
10+ readme = " README.rst"
11+
12+ homepage = " https://python-poetry.org"
13+ repository = " https://github.com/python-poetry/poetry"
14+ documentation = " https://python-poetry.org/docs"
15+
16+ keywords = [" packaging" , " dependency" , " poetry" ]
17+
18+ classifiers = [
19+ " Topic :: Software Development :: Build Tools" ,
20+ " Topic :: Software Development :: Libraries :: Python Modules"
21+ ]
22+
23+ # Requirements
24+ [tool .poetry .dependencies ]
25+ python = " ~2.7 || ^3.4"
26+
27+ [tool .poetry .group .lint .dependencies ]
28+ black = " *"
29+
30+ [tool .poetry .group .testing .dependencies ]
31+ pytest = " *"
32+
33+ [tool .poetry .group .all ]
34+ include-groups = [
35+ " lint" ,
36+ " testing" ,
37+ ]
Original file line number Diff line number Diff line change @@ -1094,3 +1094,16 @@ def test_create_poetry_with_unknown_nested_dependency_groups() -> None:
10941094 ValueError , match = "Group 'dev' includes group 'testing' which is not defined"
10951095 ):
10961096 _ = Factory ().create_poetry (fixtures_dir / "project_with_unknown_nested_group" )
1097+
1098+
1099+ def test_create_poetry_with_included_groups_only () -> None :
1100+ poetry = Factory ().create_poetry (fixtures_dir / "project_with_included_groups_only" )
1101+ assert len (poetry .package .all_requires ) == 4
1102+ assert [
1103+ (dep .name , "," .join (dep .groups )) for dep in poetry .package .all_requires
1104+ ] == [
1105+ ("black" , "lint" ),
1106+ ("pytest" , "testing" ),
1107+ ("black" , "all" ),
1108+ ("pytest" , "all" ),
1109+ ]
You can’t perform that action at this time.
0 commit comments