From 557b2e7459a120b6ab15a05b7a02afde2b93add6 Mon Sep 17 00:00:00 2001 From: Eren Dogan Date: Fri, 4 Nov 2022 15:10:44 -0700 Subject: [PATCH] Reorganize library files to include everything --- MANIFEST.in | 3 +++ Makefile | 2 ++ compiler/__init__.py => __init__.py | 2 +- openram.mk | 2 +- setup.py | 10 +++++++--- 5 files changed, 14 insertions(+), 5 deletions(-) rename compiler/__init__.py => __init__.py (84%) diff --git a/MANIFEST.in b/MANIFEST.in index 194b0f80..b2d45363 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,6 @@ +include Makefile +include openram.mk +include setpaths.sh include requirements.txt include docker/* recursive-include compiler * diff --git a/Makefile b/Makefile index 6491f113..a500243e 100644 --- a/Makefile +++ b/Makefile @@ -218,6 +218,8 @@ wipe: uninstall # Build the openram library build-library: + @rm -rf dist + @rm -rf openram.egg-info @python3 -m build .PHONY: build-library diff --git a/compiler/__init__.py b/__init__.py similarity index 84% rename from compiler/__init__.py rename to __init__.py index fadee237..5eca3f7e 100644 --- a/compiler/__init__.py +++ b/__init__.py @@ -13,7 +13,7 @@ try: OPENRAM_HOME = os.path.abspath(os.environ.get("OPENRAM_HOME")) except: import openram - OPENRAM_HOME = os.path.dirname(openram.__file__) + OPENRAM_HOME = os.path.dirname(openram.__file__) + "/compiler" if not os.path.isdir(OPENRAM_HOME): assert False diff --git a/openram.mk b/openram.mk index 2f2504c6..9c131580 100644 --- a/openram.mk +++ b/openram.mk @@ -1,6 +1,6 @@ OPENRAM_HOME := $(abspath $(TOP_DIR)/compiler) OPENRAM_TECH := $(abspath $(TOP_DIR)/technology) -OPENRAM_COMPILER := $(abspath $(TOP_DIR)/openram.py) +OPENRAM_COMPILER := $(abspath $(TOP_DIR)/sram_compiler.py) PDK_ROOT ?= $(TOP_DIR) diff --git a/setup.py b/setup.py index 097bfe9b..6494baeb 100644 --- a/setup.py +++ b/setup.py @@ -9,9 +9,9 @@ from setuptools import setup, find_namespace_packages # Include these folder from the root of repo as submodules -include = ["docker", "technology"] +include = ["compiler", "docker", "technology", "macros"] # Exclude files/folders with these words -exclude = ["docs", "images", "macros"] +exclude = ["docs", "images"] # Find all modules inside the 'compiler' folder @@ -24,7 +24,7 @@ for dir in find_namespace_packages(): # Replace 'compiler' with 'openram' for package names packages = [] for dir in dirs: - packages += [dir.replace("compiler", "openram")] + packages.append(dir) # Make the included folders submodules of openram package for i in range(len(packages)): @@ -35,6 +35,10 @@ for i in range(len(packages)): for i in range(len(dirs)): dirs[i] = dirs[i].replace(".", "/") +# Insert the root as the openram module +packages.insert(0, "openram") +dirs.insert(0, "") + # Zip package names and their paths package_dir = {k: v for k, v in zip(packages, dirs)}