-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add
package-mode
option to init
and new
commands
- Loading branch information
Showing
5 changed files
with
52 additions
and
0 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 |
---|---|---|
|
@@ -47,6 +47,7 @@ class NewCommand(InitCommand): | |
"dependency", | ||
"dev-dependency", | ||
"license", | ||
"package-mode", | ||
} | ||
], | ||
] | ||
|
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 |
---|---|---|
|
@@ -629,6 +629,37 @@ def test_python_option(tester: CommandTester) -> None: | |
assert expected in tester.io.fetch_output() | ||
|
||
|
||
def test_package_mode_option(tester: CommandTester) -> None: | ||
inputs = [ | ||
"my-package", # Package name | ||
"1.2.3", # Version | ||
"This is a description", # Description | ||
"n", # Author | ||
"MIT", # License | ||
"^3.8", # Python | ||
"n", # Interactive packages | ||
"n", # Interactive dev packages | ||
"\n", # Generate | ||
] | ||
tester.execute("--package-mode false", inputs="\n".join(inputs)) | ||
|
||
expected = """\ | ||
[tool.poetry] | ||
name = "my-package" | ||
version = "1.2.3" | ||
description = "This is a description" | ||
authors = ["Your Name <[email protected]>"] | ||
license = "MIT" | ||
readme = "README.md" | ||
package-mode = false | ||
[tool.poetry.dependencies] | ||
python = "^3.8" | ||
""" | ||
|
||
assert expected in tester.io.fetch_output() | ||
|
||
|
||
def test_predefined_dependency(tester: CommandTester, repo: TestRepository) -> None: | ||
repo.add_package(get_package("pendulum", "2.0.0")) | ||
|
||
|