Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions lambdapdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,31 @@
try:
from lambdapdk._version import __base_version__ as version
from lambdapdk._version import __version__ as __version__
from lambdapdk._version import __git_commit__ as _gitcommit
except ImportError:
# This only exists in installations
version = None
__version__ = None
_gitcommit = None

Comment thread
coderabbitai[bot] marked this conversation as resolved.

class _LambdaPath(PathSchema):
def __init__(self):
super().__init__()

_version = f"v{__version__}"
url_suffix = "refs/tags/"
if _gitcommit and version != __version__:
# use git commit
_version = _gitcommit[1:] # remove leading 'g'
url_suffix = ""
Comment thread
gadfort marked this conversation as resolved.

PythonPathResolver.set_dataroot(
self,
"lambdapdk",
"lambdapdk",
"https://github.com/siliconcompiler/lambdapdk/archive/refs/tags/",
alternative_ref=f"v{__version__}",
f"https://github.com/siliconcompiler/lambdapdk/archive/{url_suffix}",
alternative_ref=_version,
python_module_path_append="..")


Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ write_to_template = '''

__version__ = "{version}"
__base_version__ = "{scm_version.tag}"
__git_commit__ = "{scm_version.node}"
'''

[project]
Expand Down