From 8a9b62f2f9336f1267b0adcf1fb8c93327f1c229 Mon Sep 17 00:00:00 2001 From: Mircea Lungu Date: Sat, 21 Mar 2026 11:41:54 +0100 Subject: [PATCH 1/5] Fix config files not included in PyPI package config.schema.json and config.template.json were not being installed when users pip install archlens, causing FileNotFoundError on any CLI command. Move them into the src/ package directory and use package_data instead of data_files. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/python/setup.py | 8 +- src/python/src/cli_interface.py | 2 +- src/python/src/config.schema.json | 139 ++++++++++++++++++++++++++++ src/python/src/config.template.json | 20 ++++ 4 files changed, 165 insertions(+), 4 deletions(-) create mode 100644 src/python/src/config.schema.json create mode 100644 src/python/src/config.template.json diff --git a/src/python/setup.py b/src/python/setup.py index 0a848bcd..c973ed75 100644 --- a/src/python/setup.py +++ b/src/python/setup.py @@ -1,4 +1,4 @@ -from setuptools import setup, find_packages, glob +from setuptools import setup, find_packages import os # Read README for long description @@ -14,7 +14,7 @@ setup( name="ArchLens", - version="0.4.0", + version="0.4.1", description="Designed for visualizing package dependencies and highlighting differences between" " branches in GitHub pull requests. It offers customization options to tailor package views.", author="The ArchLens Team", @@ -23,8 +23,10 @@ packages=find_packages(), long_description=long_description, long_description_content_type="text/markdown", - data_files=glob.glob("src/config.**.json"), include_package_data=True, + package_data={ + "": ["*.json"], + }, install_requires=[ "plantuml", "typer", diff --git a/src/python/src/cli_interface.py b/src/python/src/cli_interface.py index cd68cb8e..901a332f 100644 --- a/src/python/src/cli_interface.py +++ b/src/python/src/cli_interface.py @@ -230,7 +230,7 @@ def read_config_file(config_path): config = json.load(f) config_schema = None - schema_path = os.path.join(os.path.dirname(__file__), "../config.schema.json") + schema_path = os.path.join(os.path.dirname(__file__), "config.schema.json") with open(schema_path) as fp: config_schema = json.load(fp) diff --git a/src/python/src/config.schema.json b/src/python/src/config.schema.json new file mode 100644 index 00000000..19894023 --- /dev/null +++ b/src/python/src/config.schema.json @@ -0,0 +1,139 @@ +{ + "$schema": "http://json-schema.org/schema", + "type": "object", + "required": [ + "name", + "rootFolder", + "views" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the project", + "minLength": 1 + }, + "rootFolder": { + "type": "string", + "description": "Point to the root package of the project", + "minLength": 1 + }, + "github": { + "type": "object", + "description": "Information about the GitHub repository for the project", + "required": [ + "url", + "branch" + ], + "properties": { + "url": { + "type": "string", + "description": "The URL of the GitHub repository for the project" + }, + "branch": { + "type": "string", + "description": "The name of the branch to use for the GitHub repository" + } + } + }, + "fileExtensions": { + "type": "array", + "items": { + "type": "string", + "pattern": "^\\.[A-Za-z]+$" + }, + "description": "Defines the file extensions to parse, i.e. '.cs'" + }, + "exclusions": { + "type": "array", + "items": { + "type": "string", + "pattern": "^[A-Za-z0-9._\\-\\/*]+$" + }, + "description": "Defines the files or folders to exclude" + }, + "snapshotDir": { + "type": "string", + "description": "The name of the folder to save the snapshot file", + "default": ".archlens" + }, + "snapshotFile": { + "type": "string", + "description": "The name of the file to save the snapshot in", + "default": "snapshot" + }, + "format": { + "type": "string", + "description": "The format to save the diagram in", + "default": "puml" + }, + "SaveLocation": { + "type": "string", + "description": "The folder to which the diagrams should be saved in. If the folder does not exists it will be created", + "default": "./diagrams/" + }, + "showDependencyCount": { + "type": "boolean", + "description": "If to showcase the number of dependencies between packages" + }, + "packageColor": { + "type": "string", + "enum": [ + "#GoldenRod", + "#Azure", + "" + ] + }, + "views": { + "type": "object", + "description": "Defines the views available", + "patternProperties": { + ".*": { + "description": "The name of the view", + "type": "object", + "properties": { + "packages": { + "description": "The packages to include in the view. Leave empty to include all packages", + "type": "array", + "items": { + "oneOf": [ + { + "type": "string", + "pattern": "^[A-Za-z0-9._-]+$" + }, + { + "type": "object", + "properties": { + "path": { + "type": "string", + "pattern": "^[A-Za-z0-9._\\-]+|[*]$" + }, + "depth": { + "type": "integer" + } + }, + "required": [ + "path", + "depth" + ] + } + ] + } + }, + "ignorePackages": { + "type": "array", + "items": { + "type": "string", + "pattern": "^[A-Za-z0-9._\\-\\/*]+$" + }, + "description": "Defines the packages to ignore" + }, + "usePackagePathAsLabel": { + "type": "boolean", + "description": "If true, paths of each package will be displayed, if false only package name will be displayed" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/python/src/config.template.json b/src/python/src/config.template.json new file mode 100644 index 00000000..2d9adcfd --- /dev/null +++ b/src/python/src/config.template.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://raw.githubusercontent.com/archlens/ArchLens/master/src/python/config.schema.json", + "name": "", + "rootFolder": "", + "github": { + "url": "", + "branch": "main" + }, + "fileExtensions": [ + ".cs" + ], + "exclusions": [], + "saveLocation": "./diagrams/", + "views": { + "completeView": { + "packages": [], + "ignorePackages": [] + } + } +} \ No newline at end of file From 08bb6605ac7a1dd7cb229c507c980b1ab074286b Mon Sep 17 00:00:00 2001 From: Mircea Lungu Date: Sat, 21 Mar 2026 11:44:43 +0100 Subject: [PATCH 2/5] Move CHANGELOG.md to repo root Co-Authored-By: Claude Opus 4.6 (1M context) --- src/python/CHANGELOG.md => CHANGELOG.md | 0 src/python/setup.py | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename src/python/CHANGELOG.md => CHANGELOG.md (100%) diff --git a/src/python/CHANGELOG.md b/CHANGELOG.md similarity index 100% rename from src/python/CHANGELOG.md rename to CHANGELOG.md diff --git a/src/python/setup.py b/src/python/setup.py index c973ed75..2023b060 100644 --- a/src/python/setup.py +++ b/src/python/setup.py @@ -6,7 +6,7 @@ try: with open(os.path.join(here, "README.md"), encoding="utf-8") as f: readme = f.read() - with open(os.path.join(here, "CHANGELOG.md"), encoding="utf-8") as f: + with open(os.path.join(here, "../../CHANGELOG.md"), encoding="utf-8") as f: changelog = f.read() long_description = f"{readme}\n\n{changelog}" except FileNotFoundError: From 773c481c115f73e0533aa793639b918329a19658 Mon Sep 17 00:00:00 2001 From: Mircea Lungu Date: Sat, 21 Mar 2026 11:47:39 +0100 Subject: [PATCH 3/5] Remove original config files from src/python (now in src/python/src) Co-Authored-By: Claude Opus 4.6 (1M context) --- src/python/config.schema.json | 139 -------------------------------- src/python/config.template.json | 20 ----- 2 files changed, 159 deletions(-) delete mode 100644 src/python/config.schema.json delete mode 100644 src/python/config.template.json diff --git a/src/python/config.schema.json b/src/python/config.schema.json deleted file mode 100644 index 19894023..00000000 --- a/src/python/config.schema.json +++ /dev/null @@ -1,139 +0,0 @@ -{ - "$schema": "http://json-schema.org/schema", - "type": "object", - "required": [ - "name", - "rootFolder", - "views" - ], - "properties": { - "name": { - "type": "string", - "description": "The name of the project", - "minLength": 1 - }, - "rootFolder": { - "type": "string", - "description": "Point to the root package of the project", - "minLength": 1 - }, - "github": { - "type": "object", - "description": "Information about the GitHub repository for the project", - "required": [ - "url", - "branch" - ], - "properties": { - "url": { - "type": "string", - "description": "The URL of the GitHub repository for the project" - }, - "branch": { - "type": "string", - "description": "The name of the branch to use for the GitHub repository" - } - } - }, - "fileExtensions": { - "type": "array", - "items": { - "type": "string", - "pattern": "^\\.[A-Za-z]+$" - }, - "description": "Defines the file extensions to parse, i.e. '.cs'" - }, - "exclusions": { - "type": "array", - "items": { - "type": "string", - "pattern": "^[A-Za-z0-9._\\-\\/*]+$" - }, - "description": "Defines the files or folders to exclude" - }, - "snapshotDir": { - "type": "string", - "description": "The name of the folder to save the snapshot file", - "default": ".archlens" - }, - "snapshotFile": { - "type": "string", - "description": "The name of the file to save the snapshot in", - "default": "snapshot" - }, - "format": { - "type": "string", - "description": "The format to save the diagram in", - "default": "puml" - }, - "SaveLocation": { - "type": "string", - "description": "The folder to which the diagrams should be saved in. If the folder does not exists it will be created", - "default": "./diagrams/" - }, - "showDependencyCount": { - "type": "boolean", - "description": "If to showcase the number of dependencies between packages" - }, - "packageColor": { - "type": "string", - "enum": [ - "#GoldenRod", - "#Azure", - "" - ] - }, - "views": { - "type": "object", - "description": "Defines the views available", - "patternProperties": { - ".*": { - "description": "The name of the view", - "type": "object", - "properties": { - "packages": { - "description": "The packages to include in the view. Leave empty to include all packages", - "type": "array", - "items": { - "oneOf": [ - { - "type": "string", - "pattern": "^[A-Za-z0-9._-]+$" - }, - { - "type": "object", - "properties": { - "path": { - "type": "string", - "pattern": "^[A-Za-z0-9._\\-]+|[*]$" - }, - "depth": { - "type": "integer" - } - }, - "required": [ - "path", - "depth" - ] - } - ] - } - }, - "ignorePackages": { - "type": "array", - "items": { - "type": "string", - "pattern": "^[A-Za-z0-9._\\-\\/*]+$" - }, - "description": "Defines the packages to ignore" - }, - "usePackagePathAsLabel": { - "type": "boolean", - "description": "If true, paths of each package will be displayed, if false only package name will be displayed" - } - } - } - } - } - } -} \ No newline at end of file diff --git a/src/python/config.template.json b/src/python/config.template.json deleted file mode 100644 index 2d9adcfd..00000000 --- a/src/python/config.template.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/archlens/ArchLens/master/src/python/config.schema.json", - "name": "", - "rootFolder": "", - "github": { - "url": "", - "branch": "main" - }, - "fileExtensions": [ - ".cs" - ], - "exclusions": [], - "saveLocation": "./diagrams/", - "views": { - "completeView": { - "packages": [], - "ignorePackages": [] - } - } -} \ No newline at end of file From 535ea78104f4d73d7ddd6aa8d77706419c8e8f7a Mon Sep 17 00:00:00 2001 From: Mircea Lungu Date: Sat, 21 Mar 2026 11:48:56 +0100 Subject: [PATCH 4/5] Update $schema URLs to new config.schema.json location Co-Authored-By: Claude Opus 4.6 (1M context) --- archlens.json | 2 +- src/python/src/config.template.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/archlens.json b/archlens.json index c3b6d5e2..71294d7b 100644 --- a/archlens.json +++ b/archlens.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/archlens/ArchLens/master/src/python/config.schema.json", + "$schema": "https://raw.githubusercontent.com/archlens/ArchLens/master/src/python/src/config.schema.json", "name": "ArchLens", "rootFolder": "src/python/src", "github": { diff --git a/src/python/src/config.template.json b/src/python/src/config.template.json index 2d9adcfd..79fd0b4b 100644 --- a/src/python/src/config.template.json +++ b/src/python/src/config.template.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/archlens/ArchLens/master/src/python/config.schema.json", + "$schema": "https://raw.githubusercontent.com/archlens/ArchLens/master/src/python/src/config.schema.json", "name": "", "rootFolder": "", "github": { From d49fb029830ce05bffbbc41c4986edcba411ef58 Mon Sep 17 00:00:00 2001 From: Mircea Lungu Date: Sat, 21 Mar 2026 11:52:24 +0100 Subject: [PATCH 5/5] Fix setup.py: scope package_data glob, fix README path - Narrow package_data from *.json to specific files - Fix README.md path to ../../README.md (lives at repo root) Co-Authored-By: Claude Opus 4.6 (1M context) --- src/python/setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/python/setup.py b/src/python/setup.py index 2023b060..41bbbc69 100644 --- a/src/python/setup.py +++ b/src/python/setup.py @@ -4,7 +4,7 @@ # Read README for long description here = os.path.abspath(os.path.dirname(__file__)) try: - with open(os.path.join(here, "README.md"), encoding="utf-8") as f: + with open(os.path.join(here, "../../README.md"), encoding="utf-8") as f: readme = f.read() with open(os.path.join(here, "../../CHANGELOG.md"), encoding="utf-8") as f: changelog = f.read() @@ -25,7 +25,7 @@ long_description_content_type="text/markdown", include_package_data=True, package_data={ - "": ["*.json"], + "src": ["config.schema.json", "config.template.json"], }, install_requires=[ "plantuml",