Repository: kickingvegas/regfmt (language: python)

Issue:
Packgage regfmt
Package regfmt for pip

https://packaging.python.org/en/latest/tutorials/packaging-projects/




Discussion / hints:
https://tildegit.org/grym/modern-python-mwe


Fix patch:
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..91bb24d
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,14 @@
+Copyright © 2022 Charles Y. Choi
+
+Licensed under the Apache License, Version 2.0 (the "License"); you
+may not use this file except in compliance with the License. You may
+obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+implied. See the License for the specific language governing
+permissions and limitations under the License.
+
diff --git a/Makefile b/Makefile
index 375e5b8..40bed81 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,3 @@
-#!/usr/bin/env python3
 ##
 # Copyright 2022 Charles Y. Choi
 #
@@ -29,20 +28,21 @@ clean:
 	find . -name '*.*~' -print -exec rm {} \;
 
 install: .venv
-	source .venv/bin/activate && pip install -r requirements.txt
-	cd .venv/bin && ln -s ../../regfmt.py regfmt
+	source .venv/bin/activate && pip install -r src/regfmt/requirements.txt
+	cd .venv/bin && ln -s ../../src/regfmt/regfmt.py regfmt
 
 .venv:
 	${PYTHON_EXEC} -m venv .venv
 
 install-pip-requirements:
-	pip install -r requirements.txt
+	pip install -r src/regfmt/requirements.txt
 
 freeze-pip-requirements:
-	pip freeze > requirements.txt
+	pip freeze > src/regfmt/requirements.txt
 
-deep-clean: clean
-	find . -name '__pycache__' -not -path "./.venv/*" -print | xargs rm -rf 
+deepclean: clean
+	find . -name '__pycache__' -not -path "./.venv/*" -print | xargs rm -rf
+	rm -rf dist
 
 clean-tests:
 	make -C tests clean
@@ -52,4 +52,11 @@ readme-examples:
 	regfmt -s tests/data/github.css -o tests/control/register.svg tests/data/register.yaml
 	regfmt -s tests/data/github.css -o tests/control/register-stair-left.svg tests/data/register-stair-left.yaml
 
-.PHONY: help test clean deep-clean clean-tests install-pip-requirements freeze-pip-requirements readme-examples
+
+package:
+	${PYTHON_EXEC} -m build
+
+upload:
+	twine upload --repository pypi dist/*
+
+.PHONY: help test clean deepclean clean-tests install-pip-requirements freeze-pip-requirements readme-examples package upload
diff --git a/README-pypi.md b/README-pypi.md
new file mode 100644
index 0000000..1752cbe
--- /dev/null
+++ b/README-pypi.md
@@ -0,0 +1,30 @@
+# regfmt
+
+This project is a **work in progress**.
+
+**regfmt** is a command line utility to generate SVG diagrams for control register-style data formats. It is inspired by the *dformat* command from the *troff* family of tools, however re-imagined using contemporary file formats.
+
+# Features
+
+-   SVG output
+-   Modern configuration input file formats
+    -   YAML for register configuration
+    -   CSS for styling SVG output
+
+# Usage
+
+    usage: regfmt [-h] [-v] [-o OUTPUT] [-s STYLE] [input]
+    
+    regfmt - generate SVG diagrams of control register-style data formats
+    
+    positional arguments:
+      input                 input register format YAML file (default: input.yaml)
+    
+    optional arguments:
+      -h, --help            show this help message and exit
+      -v, --version         print version information and exit
+      -o OUTPUT, --output OUTPUT
+                            output file (default: '-' for stdout)
+      -s STYLE, --style STYLE
+                            CSS style file
+
diff --git a/README.org b/README.org
index 728ced9..15c282d 100644
--- a/README.org
+++ b/README.org
@@ -1,4 +1,4 @@
-* regfmt 0.1.0
+* regfmt
 This project is a *work in progress*.
 
 *regfmt* is a command line utility to generate SVG diagrams for control register-style data formats. It is inspired by the /dformat/ command from the /troff/ family of tools, however re-imagined using contemporary file formats.
@@ -215,7 +215,6 @@ The following CSS selectors supported by *regfmt* are described below.
 *** body
 | Property       | Type          | Default Value | Description                                                                                                                                                                                          |
 |----------------+---------------+---------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-|                |               |               | <20>                                                                                                                                                                                                 |
 | font-family    | <[[https://w3c.github.io/csswg-drafts/css-fonts/#family-name-value][family name]]> | Helvetica     | The [[https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/font-family][font-family]] attribute indicates which font family will be used to render the text, specified as a prioritized list of font family names and/or generic family names.                             |
 | font-size      | <[[https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#length][length]]>      | 12pt          | The [[https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/font-size][font-size]] attribute refers to the size of the font from baseline to baseline when multiple lines of text are set solid in a multiline layout environment. Note only 'pt' is supported by *regfmt*. |
 | font-style     | [[#FontStyle][FontStyle]]     | normal        | The [[https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/font-size][font-style]] attribute specifies whether the text is to be rendered using a normal, italic, or oblique face.                                                                                       |
@@ -228,34 +227,33 @@ The following CSS selectors supported by *regfmt* are described below.
 
 
 *** register, field
-| Property       | Type          | Default Value | Description                                                                                                                                                              |
-|----------------+---------------+---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| fill           | <[[https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#paint][paint]]>       | black         | Presentation attribute that [[https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill][defines]] the color used to paint the element.                                                                                                                             |
-| stroke         | <[[https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#paint][paint]]>       | black         | The [[https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke][stroke]] attribute is a presentation attribute defining the color (or any SVG paint servers like gradients or patterns) used to paint the outline of the shape.                                    |
-| stroke-width   | <[[https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#length][length]]>      | 1px           | The [[https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-width][stroke-width]] attribute is a presentation attribute defining the width of the stroke to be applied to the shape.                                                                                  |
-| stroke-linecap | [[#StrokeLinecap][StrokeLinecap]] | butt          | The [[https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linecap][stroke-linecap]] attribute is a presentation attribute defining the shape to be used at the end of open subpaths when they are stroked.                                                            |
+| Property       | Type          | Default Value | Description                                                                                                                                                       |
+|----------------+---------------+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| fill           | <[[https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#paint][paint]]>       | black         | Presentation attribute that [[https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill][defines]] the color used to paint the element.                                                                                          |
+| stroke         | <[[https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#paint][paint]]>       | black         | The [[https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke][stroke]] attribute is a presentation attribute defining the color (or any SVG paint servers like gradients or patterns) used to paint the outline of the shape. |
+| stroke-width   | <[[https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#length][length]]>      | 1px           | The [[https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-width][stroke-width]] attribute is a presentation attribute defining the width of the stroke to be applied to the shape.                                               |
+| stroke-linecap | [[#StrokeLinecap][StrokeLinecap]] | butt          | The [[https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linecap][stroke-linecap]] attribute is a presentation attribute defining the shape to be used at the end of open subpaths when they are stroked.                         |
 
 *** register-name, field-name, field-index
-| Property       | Type          | Default Value | Description                                                                                                                                                              |
-|----------------+---------------+---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| font-family    | <[[https://w3c.github.io/csswg-drafts/css-fonts/#family-name-value][family name]]> | Helvetica     | The [[https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/font-family][font-family]] attribute indicates which font family will be used to render the text, specified as a prioritized list of font family names and/or generic family names.                             |
-| font-size      | <[[https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#length][length]]>      | 12pt          | The [[https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/font-size][font-size]] attribute refers to the size of the font from baseline to baseline when multiple lines of text are set solid in a multiline layout environment. Note only 'pt' is supported by *regfmt*. |
-| font-style     | [[#FontStyle][FontStyle]]     | normal        | The [[https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/font-size][font-style]] attribute specifies whether the text is to be rendered using a normal, italic, or oblique face.                                                                                       |
-| font-weight    | [[#FontWeight][FontWeight]]    | normal        | The [[https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/font-weight][font-weight]] attribute refers to the boldness or lightness of the glyphs used to render the text, relative to other fonts in the same font family.                                                |
-| fill           | <[[https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#paint][paint]]>       | black         | Presentation attribute that [[https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill][defines]] the color used to paint the element.                                                                                                                             |
+| Property    | Type          | Default Value | Description                                                                                                                                                                                          |
+|-------------+---------------+---------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| font-family | <[[https://w3c.github.io/csswg-drafts/css-fonts/#family-name-value][family name]]> | Helvetica     | The [[https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/font-family][font-family]] attribute indicates which font family will be used to render the text, specified as a prioritized list of font family names and/or generic family names.                             |
+| font-size   | <[[https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#length][length]]>      | 12pt          | The [[https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/font-size][font-size]] attribute refers to the size of the font from baseline to baseline when multiple lines of text are set solid in a multiline layout environment. Note only 'pt' is supported by *regfmt*. |
+| font-style  | [[#FontStyle][FontStyle]]     | normal        | The [[https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/font-size][font-style]] attribute specifies whether the text is to be rendered using a normal, italic, or oblique face.                                                                                       |
+| font-weight | [[#FontWeight][FontWeight]]    | normal        | The [[https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/font-weight][font-weight]] attribute refers to the boldness or lightness of the glyphs used to render the text, relative to other fonts in the same font family.                                                |
+| fill        | <[[https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#paint][paint]]>       | black         | Presentation attribute that [[https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill][defines]] the color used to paint the element.                                                                                                                             |
 
 *** field-name-line
-| Property       | Type          | Default Value | Description                                                                                                                                                              |
-|----------------+---------------+---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| stroke         | <[[https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#paint][paint]]>       | black         | The [[https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke][stroke]] attribute is a presentation attribute defining the color (or any SVG paint servers like gradients or patterns) used to paint the outline of the shape.                                    |
-| stroke-width   | <[[https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#length][length]]>      | 1px           | The [[https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-width][stroke-width]] attribute is a presentation attribute defining the width of the stroke to be applied to the shape.                                                                                  |
-| stroke-linecap | [[#StrokeLinecap][StrokeLinecap]] | butt          | The [[https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linecap][stroke-linecap]] attribute is a presentation attribute defining the shape to be used at the end of open subpaths when they are stroked.                                                            |
+| Property       | Type          | Default Value | Description                                                                                                                                                       |
+|----------------+---------------+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| stroke         | <[[https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#paint][paint]]>       | black         | The [[https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke][stroke]] attribute is a presentation attribute defining the color (or any SVG paint servers like gradients or patterns) used to paint the outline of the shape. |
+| stroke-width   | <[[https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#length][length]]>      | 1px           | The [[https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-width][stroke-width]] attribute is a presentation attribute defining the width of the stroke to be applied to the shape.                                               |
+| stroke-linecap | [[#StrokeLinecap][StrokeLinecap]] | butt          | The [[https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linecap][stroke-linecap]] attribute is a presentation attribute defining the shape to be used at the end of open subpaths when they are stroked.                         |
 
 ** Enumerations
 *** StrokeLinecap
 | Value  | Description                                                                                                                                                                                             |
 |--------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-|        | <40>                                                                                                                                                                                                    |
 | butt   | The butt value indicates that the stroke for each subpath does not extend beyond its two endpoints.                                                                                                     |
 | square | The square value indicates that at the end of each subpath the stroke will be extended by a rectangle with a width equal to half the width of the stroke and a height equal to the width of the stroke. |
 | round  | The round value indicates that at the end of each subpath the stroke will be extended by a half circle with a diameter equal to the stroke width.                                                       |
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..cdb6669
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,43 @@
+[build-system]
+requires = ["setuptools>=61.0"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "regfmt"
+version = "0.1.9"
+authors = [
+  { name="Charles Choi", email="kickingvegas@gmail.com"}
+]
+
+description = "A command line utility to generate SVG diagrams for control register-style data formats."
+readme = "README-pypi.md"
+requires-python = ">=3.7"
+classifiers = [
+    "Programming Language :: Python :: 3",
+    "License :: OSI Approved :: Apache Software License",
+    "Operating System :: OS Independent",
+]
+
+dependencies = [
+    "attrs>=22.1.0",
+    "jsonschema>=4.16.0",
+    "Pillow>=9.2.0",
+    "pyrsistent>=0.18.1",
+    "PyYAML>=6.0",
+    "tinycss2>=1.1.1",
+    "webencodings>=0.5.1"
+]
+
+[project.urls]
+"Homepage" = "https://github.com/kickingvegas/regfmt"
+"Issue Tracker" = "https://github.com/kickingvegas/regfmt/issues"
+
+[project.scripts]
+regfmt = "regfmt.regfmt:main"
+
+
+#[tool.setuptools.packages.find]
+#where = ["src"]
+
+#[tool.setuptools]
+#script-files = ["src/regfmt/regfmt"]
diff --git a/regfmtlib/CommandLineParser.py b/src/regfmt/CommandLineParser.py
similarity index 100%
rename from regfmtlib/CommandLineParser.py
rename to src/regfmt/CommandLineParser.py
diff --git a/regfmtlib/Constants.py b/src/regfmt/Constants.py
similarity index 100%
rename from regfmtlib/Constants.py
rename to src/regfmt/Constants.py
diff --git a/regfmtlib/DRCChecker.py b/src/regfmt/DRCChecker.py
similarity index 96%
rename from regfmtlib/DRCChecker.py
rename to src/regfmt/DRCChecker.py
index 176cef4..d544909 100644
--- a/regfmtlib/DRCChecker.py
+++ b/src/regfmt/DRCChecker.py
@@ -13,10 +13,10 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-from regfmtlib import Register
-from regfmtlib import Field
-from regfmtlib import TopLevel
-from regfmtlib import Endian
+from regfmt import Register
+from regfmt import Field
+from regfmt import TopLevel
+from regfmt import Endian
 from operator import add
 from functools import reduce
 import sys
diff --git a/regfmtlib/Endian.py b/src/regfmt/Endian.py
similarity index 100%
rename from regfmtlib/Endian.py
rename to src/regfmt/Endian.py
diff --git a/regfmtlib/Field.py b/src/regfmt/Field.py
similarity index 100%
rename from regfmtlib/Field.py
rename to src/regfmt/Field.py
diff --git a/regfmtlib/InputLoadAndValidate.py b/src/regfmt/InputLoadAndValidate.py
similarity index 100%
rename from regfmtlib/InputLoadAndValidate.py
rename to src/regfmt/InputLoadAndValidate.py
diff --git a/regfmtlib/Register.py b/src/regfmt/Register.py
similarity index 94%
rename from regfmtlib/Register.py
rename to src/regfmt/Register.py
index 5bedc94..dc840ca 100644
--- a/regfmtlib/Register.py
+++ b/src/regfmt/Register.py
@@ -13,9 +13,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-from regfmtlib import Constants
-from regfmtlib import Endian
-from regfmtlib import Field
+from regfmt import Constants
+from regfmt import Endian
+from regfmt import Field
 
 DEFAULT_WIDTH = Constants.DEFAULT_WIDTH
 
diff --git a/regfmtlib/TopLevel.py b/src/regfmt/TopLevel.py
similarity index 95%
rename from regfmtlib/TopLevel.py
rename to src/regfmt/TopLevel.py
index b170e4c..0daec48 100644
--- a/regfmtlib/TopLevel.py
+++ b/src/regfmt/TopLevel.py
@@ -13,9 +13,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-from regfmtlib import Constants
-from regfmtlib import Register
-from regfmtlib import Endian
+from regfmt import Constants
+from regfmt import Register
+from regfmt import Endian
 from enum import Enum
 
 DEFAULT_WIDTH = Constants.DEFAULT_WIDTH
diff --git a/regfmtlib/__init__.py b/src/regfmt/__init__.py
similarity index 100%
rename from regfmtlib/__init__.py
rename to src/regfmt/__init__.py
diff --git a/regfmtlib/centeralignlayout.py b/src/regfmt/centeralignlayout.py
similarity index 98%
rename from regfmtlib/centeralignlayout.py
rename to src/regfmt/centeralignlayout.py
index 34cb78c..752dc5c 100644
--- a/regfmtlib/centeralignlayout.py
+++ b/src/regfmt/centeralignlayout.py
@@ -1,5 +1,5 @@
-from regfmtlib.svggeometry import *
-from regfmtlib import Register
+from regfmt.svggeometry import *
+from regfmt import Register
 
 
 def writeFieldNameCenterSVG(registerDB, topGroup, styleSheet, font, registerSpacing=5):
diff --git a/regfmtlib/cssparser.py b/src/regfmt/cssparser.py
similarity index 99%
rename from regfmtlib/cssparser.py
rename to src/regfmt/cssparser.py
index ca4613b..4c5cf97 100644
--- a/regfmtlib/cssparser.py
+++ b/src/regfmt/cssparser.py
@@ -18,7 +18,7 @@
 import errno
 
 import tinycss2
-from regfmtlib.cssstyles import *
+from regfmt.cssstyles import *
 
 classNameMap = {
                 'register-name': 'registerName',
diff --git a/regfmtlib/cssstyles.py b/src/regfmt/cssstyles.py
similarity index 100%
rename from regfmtlib/cssstyles.py
rename to src/regfmt/cssstyles.py
diff --git a/regfmt.py b/src/regfmt/regfmt.py
similarity index 89%
rename from regfmt.py
rename to src/regfmt/regfmt.py
index 0c702a1..d5f0a18 100755
--- a/regfmt.py
+++ b/src/regfmt/regfmt.py
@@ -16,13 +16,17 @@
 
 import os
 import sys
-from regfmtlib import CommandLineParser
-from regfmtlib import InputLoadAndValidate
-from regfmtlib import TopLevel
-from regfmtlib import DRCChecker
-from regfmtlib import SVGWriter
+from regfmt import CommandLineParser
+from regfmt import InputLoadAndValidate
+from regfmt import TopLevel
+from regfmt import DRCChecker
+from regfmt import SVGWriter
 
-VERSION = '0.1.0'
+VERSION = '0.1.9'
+
+def main():
+    app = RegisterFormat(CommandLineParser().run())
+    app.run()
 
 
 class RegisterFormat:
diff --git a/requirements.txt b/src/regfmt/requirements.txt
similarity index 100%
rename from requirements.txt
rename to src/regfmt/requirements.txt
diff --git a/regfmtlib/stairleftlayout.py b/src/regfmt/stairleftlayout.py
similarity index 98%
rename from regfmtlib/stairleftlayout.py
rename to src/regfmt/stairleftlayout.py
index 2f01a90..dca2457 100644
--- a/regfmtlib/stairleftlayout.py
+++ b/src/regfmt/stairleftlayout.py
@@ -1,5 +1,5 @@
-from regfmtlib.svggeometry import *
-from regfmtlib import Register
+from regfmt.svggeometry import *
+from regfmt import Register
 
 def writeStairLeftSVG(registerDB, topGroup, styleSheet, font, registerSpacing=5):
     bitFieldSize = getBitFieldSize(font=font)
diff --git a/regfmtlib/svggeometry.py b/src/regfmt/svggeometry.py
similarity index 99%
rename from regfmtlib/svggeometry.py
rename to src/regfmt/svggeometry.py
index 2e7acb7..795a09b 100644
--- a/regfmtlib/svggeometry.py
+++ b/src/regfmt/svggeometry.py
@@ -14,7 +14,7 @@
 # limitations under the License.
 
 import sys
-from regfmtlib.cssstyles import *
+from regfmt.cssstyles import *
 from xml.dom.minidom import parseString
 from PIL import ImageFont
 from collections import UserList
diff --git a/regfmtlib/svgwriter.py b/src/regfmt/svgwriter.py
similarity index 96%
rename from regfmtlib/svgwriter.py
rename to src/regfmt/svgwriter.py
index 2225158..50ef520 100644
--- a/regfmtlib/svgwriter.py
+++ b/src/regfmt/svgwriter.py
@@ -14,12 +14,12 @@
 # limitations under the License.
 
 from xml.dom.minidom import getDOMImplementation
-from regfmtlib import TopLevel, FieldNameAlign
-from regfmtlib import Register
-from regfmtlib.svggeometry import *
-from regfmtlib.cssparser import parseCSS, cascadeStyles
-from regfmtlib.centeralignlayout import writeFieldNameCenterSVG
-from regfmtlib.stairleftlayout import writeStairLeftSVG
+from regfmt import TopLevel, FieldNameAlign
+from regfmt import Register
+from regfmt.svggeometry import *
+from regfmt.cssparser import parseCSS, cascadeStyles
+from regfmt.centeralignlayout import writeFieldNameCenterSVG
+from regfmt.stairleftlayout import writeStairLeftSVG
 
 class SVGWriter:
     def __init__(self, registerDB: TopLevel, outfile, configFileName=None):


Test patch:
diff --git a/regfmtlib/tests/__init__.py b/src/regfmt/tests/__init__.py
similarity index 100%
rename from regfmtlib/tests/__init__.py
rename to src/regfmt/tests/__init__.py
diff --git a/regfmtlib/tests/test_endian.py b/src/regfmt/tests/test_endian.py
similarity index 100%
rename from regfmtlib/tests/test_endian.py
rename to src/regfmt/tests/test_endian.py