Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Raise consistent ValueError for invalid EntryPoint.value #518

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 27, 2025

Conversation

jaraco
Copy link
Member

@jaraco jaraco commented Apr 27, 2025

Closes #488

  • Refactored parsing and handling of EntryPoint.value.
  • Raise a ValueError if no match.
  • Also raise ValueError on construction if the value is invalid.
  • Prefer a cached property, as the property is likely to be retrieved at least 3 times (on construction and for module:attr access).

@jaraco jaraco force-pushed the bugfix/488-bad-ep-value branch from f8a7887 to 9f8af01 Compare April 27, 2025 14:10
@jaraco
Copy link
Member Author

jaraco commented Apr 27, 2025

This change does introduce some performance degradation in the entry_points performance test:

===================================== perf =====================================
exercises.py:cached distribution: 0:00:00.000713 (+-1 day, 23:59:59.999988, -2%)
exercises.py:discovery: 0:00:00.000719 (+0:00:00.000002, 0%)
exercises.py:entry_points(): 0:00:00.010800 (+0:00:00.000700, 7%)
exercises.py:entrypoint_regexp_perf: 0:00:00.000070 (+-1 day, 23:59:59.999999, -1%)
exercises.py:uncached distribution: 0:00:00.001090 (+0:00:00, 0%)

+.7 ms (7%) in this particular run. I've seen other numbers like 3% on my local machine. I saw a larger increase without the cached property.

This seems to be an acceptable cost.

@jaraco jaraco merged commit 0899235 into main Apr 27, 2025
26 checks passed
@jaraco jaraco deleted the bugfix/488-bad-ep-value branch April 27, 2025 14:15
jaraco added a commit that referenced this pull request Apr 27, 2025
Raise consistent ValueError for invalid EntryPoint.value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AttributeError changed to AssertionError for invalid identifiers
1 participant