Skip to content

Commit 794859c

Browse files
committed
Deprecating import via 'peakrdl.html' namespace package. #31
1 parent 33f2416 commit 794859c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+351
-278
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
3131
- name: Run Lint
3232
run: |
33-
pylint --rcfile test/pylint.rc peakrdl
33+
pylint --rcfile test/pylint.rc peakrdl_html
3434
3535
#-------------------------------------------------------------------------------
3636
build_sdist:

MANIFEST.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
recursive-include peakrdl/html/static *
2-
recursive-include peakrdl/html/templates *
3-
recursive-exclude test *
1+
recursive-include src/peakrdl_html/static *
2+
recursive-include src/peakrdl_html/templates *
3+
recursive-exclude test *

README.md

Lines changed: 1 addition & 1 deletion

example/generate_docs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
sys.path.insert(0, os.path.join(this_dir, "../"))
99

1010
from systemrdl import RDLCompiler, RDLCompileError
11-
from peakrdl.html import HTMLExporter
11+
from peakrdl_html import HTMLExporter
1212

1313
#===============================================================================
1414
input_files = sys.argv[1:]

peakrdl/html/__about__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

setup.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
long_description = fh.read()
66

77

8-
with open(os.path.join("peakrdl/html", "__about__.py"), encoding='utf-8') as f:
8+
with open(os.path.join("src/peakrdl_html", "__about__.py"), encoding='utf-8') as f:
99
v_dict = {}
1010
exec(f.read(), v_dict)
1111
version = v_dict['__version__']
@@ -19,7 +19,11 @@
1919
long_description=long_description,
2020
long_description_content_type="text/markdown",
2121
url="https://github.com/SystemRDL/PeakRDL-html",
22-
packages=['peakrdl.html'],
22+
package_dir={'': 'src'},
23+
packages=[
24+
'peakrdl_html',
25+
'peakrdl.html', # backwards compatibility shim
26+
],
2327
include_package_data=True,
2428
install_requires=[
2529
"systemrdl-compiler>=1.13.0",

src/peakrdl/html/__init__.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import warnings
2+
3+
# Load modules
4+
from peakrdl_html import __about__
5+
from peakrdl_html import exporter
6+
from peakrdl_html import search_indexer
7+
from peakrdl_html import stringify
8+
9+
# hoist internal objects
10+
from peakrdl_html.exporter import HTMLExporter
11+
12+
13+
warnings.warn(
14+
"""
15+
================================================================================
16+
Importing via namespace package 'peakrdl.html' is deprecated and will be
17+
removed in the next release.
18+
Change your imports to load the package using 'peakrdl_html' instead.
19+
For more details, see: https://github.com/SystemRDL/PeakRDL/issues/4
20+
================================================================================
21+
""", DeprecationWarning, stacklevel=2)

src/peakrdl_html/__about__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "2.6.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.

0 commit comments

Comments
 (0)