Skip to content

Commit

Permalink
Deprecating import via 'peakrdl.uvm' namespace package. #14
Browse files Browse the repository at this point in the history
  • Loading branch information
amykyta3 committed Jun 8, 2022
1 parent 97e72e9 commit c11ef1a
Show file tree
Hide file tree
Showing 22 changed files with 118 additions and 114 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Run Lint
run: |
pylint --rcfile test/pylint.rc peakrdl
pylint --rcfile test/pylint.rc peakrdl_uvm
#-------------------------------------------------------------------------------
build_sdist:
Expand Down
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
recursive-include peakrdl/uvm/templates *
recursive-exclude test *
recursive-include src/peakrdl_uvm/templates *
recursive-exclude test *
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ to the exporter.
```python
import sys
from systemrdl import RDLCompiler, RDLCompileError
from peakrdl.uvm import UVMExporter
from peakrdl_uvm import UVMExporter

rdlc = RDLCompiler()

Expand Down
1 change: 0 additions & 1 deletion peakrdl/uvm/__about__.py

This file was deleted.

8 changes: 6 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
long_description = fh.read()


with open(os.path.join("peakrdl/uvm", "__about__.py"), encoding='utf-8') as f:
with open(os.path.join("src/peakrdl_uvm", "__about__.py"), encoding='utf-8') as f:
v_dict = {}
exec(f.read(), v_dict)
version = v_dict['__version__']
Expand All @@ -18,7 +18,11 @@
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/SystemRDL/PeakRDL-uvm",
packages=['peakrdl.uvm'],
package_dir={'': 'src'},
packages=[
'peakrdl_uvm',
'peakrdl.uvm', # backwards compatibility shim
],
include_package_data=True,
install_requires=[
"systemrdl-compiler>=1.12.0",
Expand Down
20 changes: 20 additions & 0 deletions src/peakrdl/uvm/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import warnings

# Load modules
from peakrdl_uvm import __about__
from peakrdl_uvm import exporter
from peakrdl_uvm import pre_export_listener

# hoist internal objects
from peakrdl_uvm.__about__ import __version__
from peakrdl_uvm.exporter import UVMExporter

warnings.warn(
"""
================================================================================
Importing via namespace package 'peakrdl.uvm' is deprecated and will be
removed in the next release.
Change your imports to load the package using 'peakrdl_uvm' instead.
For more details, see: https://github.com/SystemRDL/PeakRDL/issues/4
================================================================================
""", DeprecationWarning, stacklevel=2)
1 change: 1 addition & 0 deletions src/peakrdl_uvm/__about__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "2.1.0"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/generate_testcase_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import jinja2 as jj

from systemrdl import RDLCompiler, AddrmapNode, RegfileNode, MemNode, RegNode, FieldNode
from peakrdl.uvm import UVMExporter
from peakrdl_uvm import UVMExporter

#-------------------------------------------------------------------------------
testcase_name = sys.argv[1]
Expand Down
Loading

0 comments on commit c11ef1a

Please sign in to comment.