FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
feast/sdk/python/feast/version.py at master · ExpediaGroup/feast · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
ExpediaGroup
/
feast
Public
forked from
feast-dev/feast
Notifications
You must be signed in to change notification settings
Fork
3
Star
1
Code
Pull requests
26
Actions
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
feast
/
sdk
/
python
/
feast
/
version.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
27 lines (22 loc) · 1.04 KB
Breadcrumbs
feast
/
sdk
/
python
/
feast
/
version.py
Copy path
File metadata and controls
27 lines (22 loc) · 1.04 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from
importlib
.
metadata
import
PackageNotFoundError
,
version
# This repo publishes its own SDK distribution as "eg-feast" (see setup.py), not
# "feast", so the installed package name differs from upstream OSS Feast. Check
# both, upstream name first for compatibility with non-fork installs.
_SDK_DISTRIBUTION_NAMES
=
(
"feast"
,
"eg-feast"
)
def
get_version
():
"""Returns version information of the Feast Python Package."""
for
candidate
in
_SDK_DISTRIBUTION_NAMES
:
try
:
return
version
(
candidate
)
except
PackageNotFoundError
:
continue
return
"unknown"
def
get_installed_version
(
package_name
:
str
)
->
str
:
"""Returns the installed version of an arbitrary package, or "not installed"
if it isn't present. Useful for opportunistically reporting the version of a
wrapper/consumer package (e.g. a materialization job image) without requiring
it to be installed for Feast to function."""
try
:
return
version
(
package_name
)
except
PackageNotFoundError
:
return
"not installed"
Back
|
FazBrowse Home
|
New Git URL