mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-11-09 22:33:47 +00:00
Fix __version__ handling (#6765)
This commit is contained in:
parent
5d66d040cc
commit
1c76aa07bb
@ -1,13 +1,6 @@
|
|||||||
from importlib import metadata
|
from importlib import metadata
|
||||||
|
|
||||||
# haystack is distributed as a separate package called `haystack-ai`.
|
|
||||||
# We want to keep all preview dependencies separate from the current Haystack version,
|
|
||||||
# so imports in haystack must only import from haystack.
|
|
||||||
# Since we need to access __version__ in haystack without importing from
|
|
||||||
# haystack we must set it here too.
|
|
||||||
# When installing `haystack-ai` we want to use that package version though
|
|
||||||
# as `farm-haystack` might not be installed and cause this to fail.
|
|
||||||
try:
|
try:
|
||||||
__version__ = str(metadata.version("haystack-ai"))
|
__version__ = str(metadata.version("haystack-ai"))
|
||||||
except metadata.PackageNotFoundError:
|
except metadata.PackageNotFoundError:
|
||||||
__version__ = str(metadata.version("farm-haystack"))
|
__version__ = "main"
|
||||||
|
|||||||
4
releasenotes/notes/fix-version-47afaec913788a01.yaml
Normal file
4
releasenotes/notes/fix-version-47afaec913788a01.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
Fix Haystack imports failing when using local development environment that doesn't have `haystack-ai` installed.
|
||||||
Loading…
x
Reference in New Issue
Block a user