Skip to content

Commit 6018c7e

Browse files
authored
Merge pull request #41 from siliconcompiler/better-python-helper
use sc_package to register python information
2 parents 0995381 + 78e785a commit 6018c7e

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

lambdalib/__init__.py

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,25 @@
11
from siliconcompiler import Chip
2-
from siliconcompiler.package import path as sc_package
2+
import siliconcompiler.package as sc_package
33
import glob
44
import os
55
import shutil
66
__version__ = "0.1.4"
77

88

99
def register_data_source(chip):
10-
# check if local
11-
root_path = os.path.dirname(os.path.dirname(__file__))
12-
test_path = os.path.join(root_path, 'lambdalib', 'iolib', 'rtl', 'la_ioanalog.v')
13-
if os.path.exists(test_path):
14-
path = root_path
15-
ref = None
16-
else:
17-
path = 'git+https://github.com/siliconcompiler/lambdalib.git'
18-
ref = f'v{__version__}'
19-
20-
chip.register_package_source(name='lambdalib',
21-
path=path,
22-
ref=ref)
10+
sc_package.register_python_data_source(
11+
chip,
12+
"lambdalib",
13+
"lambdalib",
14+
"git+https://github.com/siliconcompiler/lambdalib.git",
15+
alternative_ref=f"v{__version__}",
16+
python_module_path_append="..")
2317

2418

2519
def __get_lambdalib_dir(la_lib):
2620
path_assert = Chip('lambdalib')
2721
register_data_source(path_assert)
28-
lambdalib_path = sc_package(path_assert, 'lambdalib')
22+
lambdalib_path = sc_package.path(path_assert, 'lambdalib')
2923
return f'{lambdalib_path}/lambdalib/{la_lib}/rtl'
3024

3125

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ urls = {Homepage = "https://github.com/siliconcompiler/lambdalib"}
2020
requires-python = ">= 3.8"
2121
license = {file = "LICENSE"}
2222
dependencies = [
23-
"siliconcompiler >= 0.17.0"
23+
"siliconcompiler >= 0.20.2"
2424
]
2525
dynamic = ['version']
2626

0 commit comments

Comments
 (0)