Skip to content

Commit

Permalink
docs: PEP 563 with dataclasses fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kiyoon committed Dec 25, 2024
1 parent 79303dd commit e09a581
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/src/hatchling/version/source/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ def get_version_data(self) -> dict:

spec = spec_from_file_location(os.path.splitext(path)[0], path)
module = module_from_spec(spec) # type: ignore[arg-type]

# This fixes using PEP 563 (__future__ annotations) with dataclasses.
# https://github.com/pypa/hatch/issues/1863
sys.modules[os.path.splitext(path)[0]] = module

old_search_paths = list(sys.path)
Expand Down

0 comments on commit e09a581

Please sign in to comment.