-
-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove non-version metadata hack (#1268)
* Remove non-version metadata hack As per our deprecation policy. * Add news fragment * It’s a pkg
- Loading branch information
Showing
3 changed files
with
9 additions
and
124 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
All packaging metadata except from `__version__` and `__version_info__` has been removed from the `attr` and `attrs` modules (for example, `attrs.__url__`). | ||
|
||
Please use [`importlib.metadata`](https://docs.python.org/3/library/importlib.metadata.html) or [*importlib_metadata*](https://pypi.org/project/importlib-metadata/) instead. |
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 |
---|---|---|
|
@@ -20,30 +20,6 @@ def _mod(request): | |
|
||
|
||
class TestLegacyMetadataHack: | ||
def test_title(self, mod): | ||
""" | ||
__title__ returns attrs. | ||
""" | ||
with pytest.deprecated_call() as ws: | ||
assert "attrs" == mod.__title__ | ||
|
||
assert ( | ||
f"Accessing {mod.__name__}.__title__ is deprecated" | ||
in ws.list[0].message.args[0] | ||
) | ||
|
||
def test_copyright(self, mod): | ||
""" | ||
__copyright__ returns the correct blurp. | ||
""" | ||
with pytest.deprecated_call() as ws: | ||
assert "Copyright (c) 2015 Hynek Schlawack" == mod.__copyright__ | ||
|
||
assert ( | ||
f"Accessing {mod.__name__}.__copyright__ is deprecated" | ||
in ws.list[0].message.args[0] | ||
) | ||
|
||
def test_version(self, mod, recwarn): | ||
""" | ||
__version__ returns the correct version and doesn't warn. | ||
|
@@ -52,67 +28,6 @@ def test_version(self, mod, recwarn): | |
|
||
assert [] == recwarn.list | ||
|
||
def test_description(self, mod): | ||
""" | ||
__description__ returns the correct description. | ||
""" | ||
with pytest.deprecated_call() as ws: | ||
assert "Classes Without Boilerplate" == mod.__description__ | ||
|
||
assert ( | ||
f"Accessing {mod.__name__}.__description__ is deprecated" | ||
in ws.list[0].message.args[0] | ||
) | ||
|
||
@pytest.mark.parametrize("name", ["__uri__", "__url__"]) | ||
def test_uri(self, mod, name): | ||
""" | ||
__uri__ & __url__ returns the correct project URL. | ||
""" | ||
with pytest.deprecated_call() as ws: | ||
assert "https://www.attrs.org/" == getattr(mod, name) | ||
|
||
assert ( | ||
f"Accessing {mod.__name__}.{name} is deprecated" | ||
in ws.list[0].message.args[0] | ||
) | ||
|
||
def test_author(self, mod): | ||
""" | ||
__author__ returns Hynek. | ||
""" | ||
with pytest.deprecated_call() as ws: | ||
assert "Hynek Schlawack" == mod.__author__ | ||
|
||
assert ( | ||
f"Accessing {mod.__name__}.__author__ is deprecated" | ||
in ws.list[0].message.args[0] | ||
) | ||
|
||
def test_email(self, mod): | ||
""" | ||
__email__ returns Hynek's email address. | ||
""" | ||
with pytest.deprecated_call() as ws: | ||
assert "[email protected]" == mod.__email__ | ||
|
||
assert ( | ||
f"Accessing {mod.__name__}.__email__ is deprecated" | ||
in ws.list[0].message.args[0] | ||
) | ||
|
||
def test_license(self, mod): | ||
""" | ||
__license__ returns MIT. | ||
""" | ||
with pytest.deprecated_call() as ws: | ||
assert "MIT" == mod.__license__ | ||
|
||
assert ( | ||
f"Accessing {mod.__name__}.__license__ is deprecated" | ||
in ws.list[0].message.args[0] | ||
) | ||
|
||
def test_does_not_exist(self, mod): | ||
""" | ||
Asking for unsupported dunders raises an AttributeError. | ||
|