Skip to content

Commit

Permalink
Fix bug with dynamic entry-points
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed Dec 9, 2021
1 parent 8bafcc5 commit e23f025
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
Changelog
=========

Version 0.5.1
=============

- ``setuptools`` plugin:
- Fixed bug that was preventing ``entry-points`` to be automatically
added to the ``project.dynamic`` array.

Version 0.5
===========

Expand Down
2 changes: 1 addition & 1 deletion src/ini2toml/plugins/setuptools_pep621.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ def handle_dynamic(self, doc: R) -> R:
fields.insert(0, "version")

extras: List[str] = []
ep = options.pop("entry-points", None)
ep = metadata.pop("entry-points", options.pop("entry-points", None))
if isinstance(ep, Directive):
fields.append("entry-points")
dynamic["entry-points"] = ep
Expand Down
3 changes: 2 additions & 1 deletion tests/plugins/test_setuptools_pep621.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ def test_move_tests_require(plugin, parse, convert):
def test_directives(plugin, parse, convert):
doc = parse(example_dynamic.strip())
doc = plugin.apply_value_processing(doc)
doc = plugin.move_options_missing_in_pep621(doc)
assert isinstance(doc["metadata"]["version"], Directive)
assert doc["metadata"]["version"].kind == "attr"

Expand All @@ -578,7 +579,7 @@ def test_directives(plugin, parse, convert):
assert isinstance(doc["metadata"]["description"], Directive)
assert doc["metadata"]["description"].kind == "file"

assert isinstance(doc["options"]["entry-points"], Directive)
assert isinstance(doc["metadata"]["entry-points"], Directive)


def test_handle_dynamic(plugin, parse, convert):
Expand Down

0 comments on commit e23f025

Please sign in to comment.