Skip to content

Commit 859d443

Browse files
dunkmann00radoering
authored andcommitted
Update init & new commands for PEP 639 (License) (#10787)
(cherry picked from commit afb12f6)
1 parent 2ff2845 commit 859d443

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

src/poetry/layouts/layout.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
description = ""
3333
authors = [
3434
]
35-
license = {}
35+
license = ""
3636
readme = ""
3737
requires-python = ""
3838
dependencies = [
@@ -158,7 +158,7 @@ def generate_project_content(
158158
project_content["authors"].append(author)
159159

160160
if self._license:
161-
project_content["license"]["text"] = self._license
161+
project_content["license"] = self._license
162162
else:
163163
project_content.remove("license")
164164

tests/console/commands/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def init_basic_toml() -> str:
3030
authors = [
3131
{name = "Your Name",email = "[email protected]"}
3232
]
33-
license = {text = "MIT"}
33+
license = "MIT"
3434
readme = "README.md"
3535
requires-python = ">=3.6"
3636
"""
@@ -55,7 +55,7 @@ def new_basic_toml() -> str:
5555
authors = [
5656
{name = "Your Name",email = "[email protected]"}
5757
]
58-
license = {text = "MIT"}
58+
license = "MIT"
5959
readme = "README.md"
6060
requires-python = ">=3.6"
6161
dependencies = [

tests/console/commands/test_init.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def test_interactive_with_dependencies(
145145
authors = [
146146
{name = "Your Name",email = "[email protected]"}
147147
]
148-
license = {text = "MIT"}
148+
license = "MIT"
149149
requires-python = ">=3.6"
150150
dependencies = [
151151
"pendulum (>=2.0.0,<3.0.0)",
@@ -201,7 +201,7 @@ def test_interactive_with_dependencies_and_no_selection(
201201
authors = [
202202
{name = "Your Name",email = "[email protected]"}
203203
]
204-
license = {text = "MIT"}
204+
license = "MIT"
205205
requires-python = ">=3.6"
206206
"""
207207

@@ -269,7 +269,7 @@ def test_interactive_with_git_dependencies(
269269
authors = [
270270
{name = "Your Name",email = "[email protected]"}
271271
]
272-
license = {text = "MIT"}
272+
license = "MIT"
273273
requires-python = ">=3.6"
274274
dependencies = [
275275
"demo @ git+https://github.com/demo/demo.git"
@@ -364,7 +364,7 @@ def test_interactive_with_git_dependencies_with_reference(
364364
authors = [
365365
{name = "Your Name",email = "[email protected]"}
366366
]
367-
license = {text = "MIT"}
367+
license = "MIT"
368368
requires-python = ">=3.6"
369369
dependencies = [
370370
"demo @ git+https://github.com/demo/demo.git@develop"
@@ -412,7 +412,7 @@ def test_interactive_with_git_dependencies_and_other_name(
412412
authors = [
413413
{name = "Your Name",email = "[email protected]"}
414414
]
415-
license = {text = "MIT"}
415+
license = "MIT"
416416
requires-python = ">=3.6"
417417
dependencies = [
418418
"demo @ git+https://github.com/demo/pyproject-demo.git"
@@ -467,7 +467,7 @@ def test_interactive_with_directory_dependency(
467467
authors = [
468468
{{name = "Your Name",email = "[email protected]"}}
469469
]
470-
license = {{text = "MIT"}}
470+
license = "MIT"
471471
requires-python = ">=3.6"
472472
dependencies = [
473473
"demo @ {demo_uri}"
@@ -521,7 +521,7 @@ def test_interactive_with_directory_dependency_and_other_name(
521521
authors = [
522522
{{name = "Your Name",email = "[email protected]"}}
523523
]
524-
license = {{text = "MIT"}}
524+
license = "MIT"
525525
requires-python = ">=3.6"
526526
dependencies = [
527527
"demo @ {demo_uri}"
@@ -576,7 +576,7 @@ def test_interactive_with_file_dependency(
576576
authors = [
577577
{{name = "Your Name",email = "[email protected]"}}
578578
]
579-
license = {{text = "MIT"}}
579+
license = "MIT"
580580
requires-python = ">=3.6"
581581
dependencies = [
582582
"demo @ {demo_uri}"
@@ -623,7 +623,7 @@ def test_interactive_with_wrong_dependency_inputs(
623623
authors = [
624624
{name = "Your Name",email = "[email protected]"}
625625
]
626-
license = {text = "MIT"}
626+
license = "MIT"
627627
requires-python = ">=3.8"
628628
dependencies = [
629629
"foo (==1.19.2)",
@@ -660,7 +660,7 @@ def test_python_option(tester: CommandTester) -> None:
660660
authors = [
661661
{name = "Your Name",email = "[email protected]"}
662662
]
663-
license = {text = "MIT"}
663+
license = "MIT"
664664
requires-python = ">=3.6"
665665
"""
666666

@@ -691,7 +691,7 @@ def test_predefined_dependency(tester: CommandTester, repo: TestRepository) -> N
691691
authors = [
692692
{name = "Your Name",email = "[email protected]"}
693693
]
694-
license = {text = "MIT"}
694+
license = "MIT"
695695
requires-python = ">=3.6"
696696
dependencies = [
697697
"pendulum (>=2.0.0,<3.0.0)"
@@ -733,7 +733,7 @@ def test_predefined_and_interactive_dependencies(
733733
authors = [
734734
{name = "Your Name",email = "[email protected]"}
735735
]
736-
license = {text = "MIT"}
736+
license = "MIT"
737737
requires-python = ">=3.6"
738738
dependencies = [
739739
"pendulum (>=2.0.0,<3.0.0)",
@@ -768,7 +768,7 @@ def test_predefined_dev_dependency(tester: CommandTester, repo: TestRepository)
768768
authors = [
769769
{name = "Your Name",email = "[email protected]"}
770770
]
771-
license = {text = "MIT"}
771+
license = "MIT"
772772
requires-python = ">=3.6"
773773
dependencies = [
774774
]
@@ -814,7 +814,7 @@ def test_predefined_and_interactive_dev_dependencies(
814814
authors = [
815815
{name = "Your Name",email = "[email protected]"}
816816
]
817-
license = {text = "MIT"}
817+
license = "MIT"
818818
requires-python = ">=3.6"
819819
dependencies = [
820820
]
@@ -861,7 +861,7 @@ def test_predefined_all_options(tester: CommandTester, repo: TestRepository) ->
861861
authors = [
862862
{name = "Foo Bar",email = "[email protected]"}
863863
]
864-
license = {text = "MIT"}
864+
license = "MIT"
865865
requires-python = ">=3.8"
866866
dependencies = [
867867
"pendulum (>=2.0.0,<3.0.0)"

0 commit comments

Comments
 (0)