-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update 'flit init' to use PEP 621 [project] table
- Loading branch information
Showing
3 changed files
with
63 additions
and
41 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 |
---|---|---|
|
@@ -108,8 108,7 @@ def test_init(): | |
assert_isfile(generated) | ||
with generated.open() as f: | ||
data = toml.load(f) | ||
assert data['tool']['flit']['metadata'][ | ||
'author-email'] == "[email protected]" | ||
assert data['project']['authors'][0]['email'] == "[email protected]" | ||
license = Path(td) / 'LICENSE' | ||
assert_isfile(license) | ||
with license.open() as f: | ||
|
@@ -133,11 132,10 @@ def test_init_homepage_and_license_are_optional(): | |
with Path(td, 'pyproject.toml').open() as f: | ||
data = toml.load(f) | ||
assert not Path(td, 'LICENSE').exists() | ||
metadata = data['tool']['flit']['metadata'] | ||
assert metadata == { | ||
'author': 'Test Author', | ||
'author-email': '[email protected]', | ||
'module': 'test_module_name', | ||
assert data['project'] == { | ||
'authors': [{'name': 'Test Author', 'email': '[email protected]'}], | ||
'name': 'test_module_name', | ||
'dynamic': ['version', 'description'], | ||
} | ||
|
||
def test_init_homepage_validator(): | ||
|
@@ -155,12 153,11 @@ def test_init_homepage_validator(): | |
ti.initialise() | ||
with Path(td, 'pyproject.toml').open() as f: | ||
data = toml.load(f) | ||
metadata = data['tool']['flit']['metadata'] | ||
assert metadata == { | ||
'author': 'Test Author', | ||
'author-email': '[email protected]', | ||
'home-page': 'https://www.example.org', | ||
'module': 'test_module_name', | ||
assert data['project'] == { | ||
'authors': [{'name': 'Test Author', 'email': '[email protected]'}], | ||
'name': 'test_module_name', | ||
'urls': {'Home': 'https://www.example.org'}, | ||
'dynamic': ['version', 'description'], | ||
} | ||
|
||
def test_author_email_field_is_optional(): | ||
|
@@ -178,11 175,12 @@ def test_author_email_field_is_optional(): | |
with Path(td, 'pyproject.toml').open() as f: | ||
data = toml.load(f) | ||
assert not Path(td, 'LICENSE').exists() | ||
metadata = data['tool']['flit']['metadata'] | ||
assert metadata == { | ||
'author': 'Test Author', | ||
'module': 'test_module_name', | ||
'home-page': 'https://www.example.org', | ||
|
||
assert data['project'] == { | ||
'authors': [{'name': 'Test Author'}], | ||
'name': 'test_module_name', | ||
'urls': {'Home': 'https://www.example.org'}, | ||
'dynamic': ['version', 'description'], | ||
} | ||
|
||
|
||
|
@@ -218,10 216,9 @@ def test_init_readme_found_yes_choosen(): | |
with Path(td, 'pyproject.toml').open() as f: | ||
data = toml.load(f) | ||
|
||
metadata = data['tool']['flit']['metadata'] | ||
assert metadata == { | ||
'author': 'Test Author', | ||
'author-email': '[email protected]', | ||
'module': 'test_module_name', | ||
'description-file': 'readme.md' | ||
assert data['project'] == { | ||
'authors': [{'name': 'Test Author', 'email': '[email protected]'}], | ||
'name': 'test_module_name', | ||
'readme': 'readme.md', | ||
'dynamic': ['version', 'description'], | ||
} |