Skip to content

Fix installed demark-world CLI entry point#10

Open
kwyip wants to merge 1 commit into
linkedlist771:mainfrom
kwyip:main
Open

Fix installed demark-world CLI entry point#10
kwyip wants to merge 1 commit into
linkedlist771:mainfrom
kwyip:main

Conversation

@kwyip
Copy link
Copy Markdown

@kwyip kwyip commented May 30, 2026

Motivation

The installed CLI was broken for me because the console script pointed to a top-level cli:main module that is not included in the wheel, causing ModuleNotFoundError: No module named 'cli'.

Description

Moved the CLI into the packaged module at src/demark_world/cli.py and updated the console script to use demark_world.cli:main.

Added a small root-level cli.py wrapper for source-checkout usage, replaced src.demark_world.* imports with demark_world.*, and cleaned up linting/formatting issues.

Testing

Verified the CLI help command works, confirmed all modules compile, checked the pyproject.toml entry point, and ran Ruff checks successfully.

Summary by CodeRabbit

  • New Features

    • Added batch video watermark removal CLI with real-time progress tracking, comprehensive result summaries including timing and success metrics, detailed file-by-file reporting, and configurable cleaner and model options.
  • Refactor

    • Updated package import structure and module organization throughout the codebase.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 30, 2026

📝 Walkthrough

Walkthrough

This PR consolidates the package structure by removing the src. prefix from internal imports across ~130 files and introduces a complete batch video processing CLI with progress tracking and summary reporting.

Changes

Package namespace unification and CLI implementation

Layer / File(s) Summary
Root-level and top-level module imports
README.md, app.py, cli.py, pyproject.toml
README, app, and top-level CLI wrapper updated to import from demark_world instead of src.demark_world; console script entry point changed to point to demark_world.cli:main.
New batch CLI processor and progress UI
src/demark_world/cli.py
Implements batch video watermark removal with argument validation, Rich-based progress bars, per-video callbacks, and formatted summary tables reporting time, counts, success rate, and lists of successful/failed files.
Core module zip safety and callback wiring
src/demark_world/core.py
Updates imports to demark_world namespace and uses zip(..., strict=False) in batch loops; adjusts progress callback signature for per-video index handling.
Cleaner module namespace updates
src/demark_world/cleaner/*, src/demark_world/watermark_cleaner.py
Cleaner implementations and main watermark cleaner class update imports to use demark_world namespace.
IOPaint API and core plugin infrastructure
src/demark_world/iopaint/{__init__,api,batch_processing,benchmark,cli,download,helper,model_manager,runtime,schema,web_config}.py
IOPaint API layer, model manager, batch processing, and helper modules update to demark_world.iopaint namespace.
IOPaint model implementations and schemas
src/demark_world/iopaint/model/{base,controlnet,fcf,instruct_pix2pix,kandinsky,lama,ldm,manga,mat,mi_gan,opencv2,paint_by_example,power_paint/*,sd,sdxl,zits}.py
All IOPaint model classes update schema and helper imports to demark_world.iopaint namespace.
AnyText model and CLDM/LDM components
src/demark_world/iopaint/model/anytext/*, src/demark_world/iopaint/model/anytext/anytext_sd15.yaml
AnyText model pipeline and all CLDM/LDM submodules update to demark_world.iopaint namespace; YAML config target paths also updated.
IOPaint plugins and helper utilities
src/demark_world/iopaint/plugins/*, src/demark_world/iopaint/{tests/utils,helper,model/helper}
All plugin implementations and test infrastructure update to demark_world.iopaint namespace.
IOPaint test modules
src/demark_world/iopaint/tests/test_*.py
Test files for models, batch processing, plugins, and utilities update imports to use demark_world.iopaint namespace.
Model, server, and utility module imports
src/demark_world/{models,server,utils,watermark_detector}.py
Model training, server infrastructure, and utility modules complete the namespace unification.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A hop through imports, paths refactored bright,
From src. to demark_world, shining clean and light!
The CLI now batches videos with progress so grand,
With Rich-formatted tables across the land.
A namespace reborn, the structure now sound,
377 new lines of processing found! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 2.70% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'Fix installed demark-world CLI entry point' accurately and concisely describes the main change: fixing the broken CLI entry point by moving the implementation into the packaged module namespace.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/demark_world/iopaint/schema.py (1)

9-19: ⚠️ Potential issue | 🟠 Major

Fix remaining stale src.demark_world imports in top-level scripts

src/demark_world/iopaint/schema.py’s import of demark_world.iopaint.const is consistent, and src/demark_world/iopaint/const.py exists. However, start_server.py (lines 6-7) and example.py (lines 2-3) still import from src.demark_world.*; switch them to demark_world.* to avoid PYTHONPATH-dependent runtime resolution.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/demark_world/iopaint/schema.py` around lines 9 - 19, Update the stale
top-level imports that reference the package with a "src." prefix: replace any
imports like "from src.demark_world..." in start_server.py (the imports around
lines 6-7) and example.py (the imports around lines 2-3) to use "from
demark_world..." instead so they import modules such as
demark_world.iopaint.const and demark_world.iopaint.schema (referencing symbols
like ANYTEXT_NAME, INSTRUCT_PIX2PIX_NAME, KANDINSKY22_NAME, etc.) to avoid
PYTHONPATH-dependent resolution.
🧹 Nitpick comments (3)
src/demark_world/cli.py (2)

103-103: 💤 Low value

Annotate return types on new public functions/methods.

main, show_banner, process_batch, and _print_summary lack -> None return annotations. As per coding guidelines, "Always use full type annotations". Adding from __future__ import annotations at the top is also recommended for this typed module.

Also applies to: 170-170, 188-188, 274-274

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/demark_world/cli.py` at line 103, Add explicit return type annotations
and future annotations import: add "from __future__ import annotations" at the
top of the module, and annotate the public functions main, show_banner,
process_batch, and _print_summary with "-> None". Update the function signatures
for those symbols to include the return annotation and ensure any corresponding
type hints in their definitions remain consistent with the module-level future
import.

7-7: 💤 Low value

Add a return type annotation.

validate_args_and_show_help returns tuple[Path, Path, argparse.Namespace] but is unannotated. As per coding guidelines, "Always use full type annotations".

Proposed annotation
-def validate_args_and_show_help():
+def validate_args_and_show_help() -> tuple[Path, Path, argparse.Namespace]:
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/demark_world/cli.py` at line 7, Add an explicit return type to the
function validate_args_and_show_help: change its signature to return tuple[Path,
Path, argparse.Namespace] (i.e. def validate_args_and_show_help() -> tuple[Path,
Path, argparse.Namespace]:). Ensure Path is available (from pathlib import Path)
and argparse is imported in this module or referenced with the argparse name; if
forward-reference issues occur, enable from __future__ import annotations. Keep
the rest of the function logic unchanged.
src/demark_world/models/model/e2fgvi_hq.py (1)

12-12: ⚡ Quick win

Remove stale commented-out import.

This commented line appears to be a malformed artifact from the namespace refactor (duplicated demark_world.models in the path). The correct import is already active on Line 13.

🧹 Proposed fix
-# from demark_world.models.demark_world.models.model.modules.flow_comp import SPyNet
 from demark_world.models.model.modules.flow_comp import SPyNet

As per coding guidelines, avoid leaving stale commented-out code.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/demark_world/models/model/e2fgvi_hq.py` at line 12, Remove the stale
commented-out import line referencing
"demark_world.models.demark_world.models.model.modules.flow_comp import SPyNet"
in the e2fgvi_hq module; keep the existing correct active import for SPyNet (the
working import on the next line) and delete the malformed duplicate comment to
avoid leaving outdated commented code.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/demark_world/iopaint/cli.py`:
- Around line 12-14: Update the remaining imports that reference the package
with the leading "src" so they use the installed package name "demark_world"
instead of "src.demark_world"; specifically change any occurrences like "from
src.demark_world.iopaint import ..." in start_server.py (lines around the
imports at 6-7) and example.py (lines around imports at 2-3) to "from
demark_world.iopaint import ..." (and similarly for any submodules such as
iopaint.cli, iopaint.runtime, iopaint.const, etc.) so imports match the
wheel/package layout.

In `@src/demark_world/iopaint/helper.py`:
- Around line 63-64: The f-string error message that uses _md5 and model_md5
concatenates two sentences without a space (producing "...restart
demark_world.iopaint.If you..."); update the string assembly around where the
MD5 check/log message is built (the f-strings referencing _md5 and model_md5) to
ensure a space or punctuation + space separates the sentences (e.g., add a
trailing space to the first f-string or start the second with a leading space).
Apply the same fix to the identical message block later (the similar f-strings
at the second occurrence).

In `@src/demark_world/iopaint/tests/test_load_img.py`:
- Around line 1-2: The failing imports are leftover using the old namespace
string "src.demark_world"; update any import statements that reference
"src.demark_world" (e.g., lines importing modules from that namespace) to use
the new absolute package name "demark_world" instead so imports resolve
consistently—search for occurrences of the literal "from src.demark_world" in
the codebase (including start_server.py and example.py) and replace them with
"from demark_world" keeping the rest of each import path unchanged.

---

Outside diff comments:
In `@src/demark_world/iopaint/schema.py`:
- Around line 9-19: Update the stale top-level imports that reference the
package with a "src." prefix: replace any imports like "from
src.demark_world..." in start_server.py (the imports around lines 6-7) and
example.py (the imports around lines 2-3) to use "from demark_world..." instead
so they import modules such as demark_world.iopaint.const and
demark_world.iopaint.schema (referencing symbols like ANYTEXT_NAME,
INSTRUCT_PIX2PIX_NAME, KANDINSKY22_NAME, etc.) to avoid PYTHONPATH-dependent
resolution.

---

Nitpick comments:
In `@src/demark_world/cli.py`:
- Line 103: Add explicit return type annotations and future annotations import:
add "from __future__ import annotations" at the top of the module, and annotate
the public functions main, show_banner, process_batch, and _print_summary with
"-> None". Update the function signatures for those symbols to include the
return annotation and ensure any corresponding type hints in their definitions
remain consistent with the module-level future import.
- Line 7: Add an explicit return type to the function
validate_args_and_show_help: change its signature to return tuple[Path, Path,
argparse.Namespace] (i.e. def validate_args_and_show_help() -> tuple[Path, Path,
argparse.Namespace]:). Ensure Path is available (from pathlib import Path) and
argparse is imported in this module or referenced with the argparse name; if
forward-reference issues occur, enable from __future__ import annotations. Keep
the rest of the function logic unchanged.

In `@src/demark_world/models/model/e2fgvi_hq.py`:
- Line 12: Remove the stale commented-out import line referencing
"demark_world.models.demark_world.models.model.modules.flow_comp import SPyNet"
in the e2fgvi_hq module; keep the existing correct active import for SPyNet (the
working import on the next line) and delete the malformed duplicate comment to
avoid leaving outdated commented code.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b01620ee-a7d1-42af-a915-c995f81e7c1c

📥 Commits

Reviewing files that changed from the base of the PR and between 7059b4a and 7efa621.

⛔ Files ignored due to path filters (2)
  • resources/.DS_Store is excluded by !**/.DS_Store
  • src/demark_world/models/.DS_Store is excluded by !**/.DS_Store
📒 Files selected for processing (98)
  • README.md
  • app.py
  • cli.py
  • pyproject.toml
  • src/demark_world/cleaner/e2fgvi_hq_cleaner.py
  • src/demark_world/cleaner/lama_cleaner.py
  • src/demark_world/cli.py
  • src/demark_world/core.py
  • src/demark_world/iopaint/__init__.py
  • src/demark_world/iopaint/api.py
  • src/demark_world/iopaint/batch_processing.py
  • src/demark_world/iopaint/benchmark.py
  • src/demark_world/iopaint/cli.py
  • src/demark_world/iopaint/download.py
  • src/demark_world/iopaint/helper.py
  • src/demark_world/iopaint/model/anytext/anytext_model.py
  • src/demark_world/iopaint/model/anytext/anytext_pipeline.py
  • src/demark_world/iopaint/model/anytext/anytext_sd15.yaml
  • src/demark_world/iopaint/model/anytext/cldm/cldm.py
  • src/demark_world/iopaint/model/anytext/cldm/ddim_hacked.py
  • src/demark_world/iopaint/model/anytext/cldm/embedding_manager.py
  • src/demark_world/iopaint/model/anytext/cldm/hack.py
  • src/demark_world/iopaint/model/anytext/cldm/model.py
  • src/demark_world/iopaint/model/anytext/cldm/recognizer.py
  • src/demark_world/iopaint/model/anytext/ldm/models/autoencoder.py
  • src/demark_world/iopaint/model/anytext/ldm/models/diffusion/ddim.py
  • src/demark_world/iopaint/model/anytext/ldm/models/diffusion/ddpm.py
  • src/demark_world/iopaint/model/anytext/ldm/models/diffusion/plms.py
  • src/demark_world/iopaint/model/anytext/ldm/modules/attention.py
  • src/demark_world/iopaint/model/anytext/ldm/modules/diffusionmodules/openaimodel.py
  • src/demark_world/iopaint/model/anytext/ldm/modules/diffusionmodules/upscaling.py
  • src/demark_world/iopaint/model/anytext/ldm/modules/diffusionmodules/util.py
  • src/demark_world/iopaint/model/anytext/ldm/modules/encoders/modules.py
  • src/demark_world/iopaint/model/base.py
  • src/demark_world/iopaint/model/controlnet.py
  • src/demark_world/iopaint/model/fcf.py
  • src/demark_world/iopaint/model/helper/controlnet_preprocess.py
  • src/demark_world/iopaint/model/instruct_pix2pix.py
  • src/demark_world/iopaint/model/kandinsky.py
  • src/demark_world/iopaint/model/lama.py
  • src/demark_world/iopaint/model/ldm.py
  • src/demark_world/iopaint/model/manga.py
  • src/demark_world/iopaint/model/mat.py
  • src/demark_world/iopaint/model/mi_gan.py
  • src/demark_world/iopaint/model/opencv2.py
  • src/demark_world/iopaint/model/paint_by_example.py
  • src/demark_world/iopaint/model/power_paint/power_paint.py
  • src/demark_world/iopaint/model/power_paint/power_paint_v2.py
  • src/demark_world/iopaint/model/power_paint/powerpaint_tokenizer.py
  • src/demark_world/iopaint/model/sd.py
  • src/demark_world/iopaint/model/sdxl.py
  • src/demark_world/iopaint/model/utils.py
  • src/demark_world/iopaint/model/zits.py
  • src/demark_world/iopaint/model_manager.py
  • src/demark_world/iopaint/plugins/anime_seg.py
  • src/demark_world/iopaint/plugins/base_plugin.py
  • src/demark_world/iopaint/plugins/gfpgan/archs/stylegan2_clean_arch.py
  • src/demark_world/iopaint/plugins/gfpgan_plugin.py
  • src/demark_world/iopaint/plugins/interactive_seg.py
  • src/demark_world/iopaint/plugins/realesrgan.py
  • src/demark_world/iopaint/plugins/remove_bg.py
  • src/demark_world/iopaint/plugins/restoreformer.py
  • src/demark_world/iopaint/plugins/segment_anything/build_sam.py
  • src/demark_world/iopaint/runtime.py
  • src/demark_world/iopaint/schema.py
  • src/demark_world/iopaint/tests/test_adjust_mask.py
  • src/demark_world/iopaint/tests/test_anytext.py
  • src/demark_world/iopaint/tests/test_brushnet.py
  • src/demark_world/iopaint/tests/test_controlnet.py
  • src/demark_world/iopaint/tests/test_instruct_pix2pix.py
  • src/demark_world/iopaint/tests/test_load_img.py
  • src/demark_world/iopaint/tests/test_low_mem.py
  • src/demark_world/iopaint/tests/test_match_histograms.py
  • src/demark_world/iopaint/tests/test_model.py
  • src/demark_world/iopaint/tests/test_model_md5.py
  • src/demark_world/iopaint/tests/test_model_switch.py
  • src/demark_world/iopaint/tests/test_outpainting.py
  • src/demark_world/iopaint/tests/test_paint_by_example.py
  • src/demark_world/iopaint/tests/test_plugins.py
  • src/demark_world/iopaint/tests/test_save_exif.py
  • src/demark_world/iopaint/tests/test_save_quality.py
  • src/demark_world/iopaint/tests/test_sd_model.py
  • src/demark_world/iopaint/tests/test_sdxl.py
  • src/demark_world/iopaint/tests/utils.py
  • src/demark_world/iopaint/web_config.py
  • src/demark_world/models/model/e2fgvi.py
  • src/demark_world/models/model/e2fgvi_hq.py
  • src/demark_world/models/model/modules/feat_prop.py
  • src/demark_world/server/app.py
  • src/demark_world/server/db.py
  • src/demark_world/server/lifespan.py
  • src/demark_world/server/models.py
  • src/demark_world/server/router.py
  • src/demark_world/server/worker.py
  • src/demark_world/utils/download_utils.py
  • src/demark_world/utils/watermark_utls.py
  • src/demark_world/watermark_cleaner.py
  • src/demark_world/watermark_detector.py

Comment on lines +12 to +14
from demark_world.iopaint.const import *
from demark_world.iopaint.runtime import check_device, dump_environment_info, setup_model_dir
from demark_world.iopaint.schema import (
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# 1) Any remaining src.demark_world.* imports (would break under the new namespace)
rg -nP '\b(from|import)\s+src\.demark_world\b'

# 2) Confirm pyproject maps the src layout so `demark_world` is importable top-level
fd -t f 'pyproject.toml' --exec rg -nC3 'package-dir|packages|tool\.(setuptools|hatch|poetry)|where' {}

Repository: linkedlist771/DeMark-World

Length of output: 874


Fix remaining src.demark_world imports so demark_world is used consistently.

  • start_server.py:6-7 and example.py:2-3 still import from src.demark_world.*, which will fail when src is not a Python package.
  • pyproject.toml’s wheel config builds from packages = ["src/demark_world"], so the installed import should be demark_world.*; update these scripts accordingly.
🧰 Tools
🪛 Ruff (0.15.14)

[error] 12-12: from demark_world.iopaint.const import * used; unable to detect undefined names

(F403)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/demark_world/iopaint/cli.py` around lines 12 - 14, Update the remaining
imports that reference the package with the leading "src" so they use the
installed package name "demark_world" instead of "src.demark_world";
specifically change any occurrences like "from src.demark_world.iopaint import
..." in start_server.py (lines around the imports at 6-7) and example.py (lines
around imports at 2-3) to "from demark_world.iopaint import ..." (and similarly
for any submodules such as iopaint.cli, iopaint.runtime, iopaint.const, etc.) so
imports match the wheel/package layout.

Comment on lines +63 to 64
f"Model md5: {_md5}, expected md5: {model_md5}, wrong model deleted. Please restart demark_world.iopaint."
f"If you still have errors, please try download model manually first https://lama-cleaner-docs.vercel.app/install/download_model_manually.\n"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Missing space joins two sentences in the error message.

Implicit string concatenation produces ...restart demark_world.iopaint.If you still have errors... with no space. Same pattern at lines 87-88.

Proposed fix
-                        f"Model md5: {_md5}, expected md5: {model_md5}, wrong model deleted. Please restart demark_world.iopaint."
+                        f"Model md5: {_md5}, expected md5: {model_md5}, wrong model deleted. Please restart demark_world.iopaint. "
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
f"Model md5: {_md5}, expected md5: {model_md5}, wrong model deleted. Please restart demark_world.iopaint."
f"If you still have errors, please try download model manually first https://lama-cleaner-docs.vercel.app/install/download_model_manually.\n"
f"Model md5: {_md5}, expected md5: {model_md5}, wrong model deleted. Please restart demark_world.iopaint. "
f"If you still have errors, please try download model manually first https://lama-cleaner-docs.vercel.app/install/download_model_manually.\n"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/demark_world/iopaint/helper.py` around lines 63 - 64, The f-string error
message that uses _md5 and model_md5 concatenates two sentences without a space
(producing "...restart demark_world.iopaint.If you..."); update the string
assembly around where the MD5 check/log message is built (the f-strings
referencing _md5 and model_md5) to ensure a space or punctuation + space
separates the sentences (e.g., add a trailing space to the first f-string or
start the second with a leading space). Apply the same fix to the identical
message block later (the similar f-strings at the second occurrence).

Comment on lines +9 to +10
from demark_world.iopaint.plugins.base_plugin import BasePlugin
from demark_world.iopaint.schema import Device, RemoveBGModel, RunPluginRequest
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Confirm target modules exist under the new namespace
fd -t f 'briarmbg2?.py' src/demark_world/iopaint/plugins

# Ensure no leftover old-namespace imports remain anywhere
rg -nP '\b(from|import)\s+src\.demark_world\b'

Repository: linkedlist771/DeMark-World

Length of output: 414


🏁 Script executed:

#!/bin/bash
# List all remaining old-namespace `src.demark_world` imports
rg -nP '\b(from|import)\s+src\.demark_world\b' -S .

# Show the import sections for the hits we already saw
sed -n '1,80p' start_server.py
sed -n '1,120p' example.py

Repository: linkedlist771/DeMark-World

Length of output: 1717


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the lazy-import locations in remove_bg.py
nl -ba src/demark_world/iopaint/plugins/remove_bg.py | sed -n '35,80p'

# Check whether any library code still imports via `src.demark_world`
rg -nP '\b(from|import)\s+src\.demark_world\b' src/demark_world -S || true

# Confirm the target briarmbg/briarmbg2 modules exist where the new namespace expects them
ls -1 src/demark_world/iopaint/plugins/briarmbg*.py

Repository: linkedlist771/DeMark-World

Length of output: 113


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the lazy-import locations in remove_bg.py
cat -n src/demark_world/iopaint/plugins/remove_bg.py | sed -n '35,90p'

# Check whether any library code still imports via `src.demark_world`
rg -nP '\b(from|import)\s+src\.demark_world\b' src/demark_world -S || true

# Confirm the target briarmbg/briarmbg2 modules exist where the new namespace expects them
ls -1 src/demark_world/iopaint/plugins/briarmbg*.py

Repository: linkedlist771/DeMark-World

Length of output: 2597


Confirm briarmbg/briarmbg2 lazy imports + fix remaining src.demark_world imports

  • src/demark_world/iopaint/plugins/remove_bg.py lazily imports from demark_world.iopaint.plugins.briarmbg / demark_world.iopaint.plugins.briarmbg2, and both src/demark_world/iopaint/plugins/briarmbg.py and briarmbg2.py exist.
  • Remaining from src.demark_world... imports in start_server.py (6-7) and example.py (2-3) should be switched to from demark_world... to match the new namespace.

Comment on lines +1 to +2
from demark_world.iopaint.helper import load_img
from demark_world.iopaint.tests.utils import current_dir
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find any leftover `src.demark_world` references missed by the rename.
rg -nP '\bsrc\.demark_world\b' -g '*.py' -g '*.yaml'

Repository: linkedlist771/DeMark-World

Length of output: 323


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Broader scan for any remaining src.demark_world imports/usages across common text formats.
rg -nP '\bsrc\.demark_world\b' -g '*.py' -g '*.yaml' -g '*.yml' -g '*.toml' -g '*.md' -g '*.ini' -g '*.cfg' -g '*.sh' -g '*.bash' -g '*.txt' || true

# Also check for any other common "src.<pkg>" import patterns that might be part of the same rename.
rg -nP '\bsrc\.demark_world\.[A-Za-z_][A-Za-z0-9_]*\b' -g '*.py' || true

Repository: linkedlist771/DeMark-World

Length of output: 576


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Confirm there are no other occurrences anywhere in the repo (all file types).
rg -nP '\bsrc\.demark_world\b' . || true

Repository: linkedlist771/DeMark-World

Length of output: 331


Fix remaining src.demark_world imports (namespace rename incomplete).

  • start_server.py:6-7 still imports from src.demark_world...
  • example.py:2-3 still imports from src.demark_world...
    These need to be updated to the new demark_world... absolute imports so the renamed namespace resolves consistently.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/demark_world/iopaint/tests/test_load_img.py` around lines 1 - 2, The
failing imports are leftover using the old namespace string "src.demark_world";
update any import statements that reference "src.demark_world" (e.g., lines
importing modules from that namespace) to use the new absolute package name
"demark_world" instead so imports resolve consistently—search for occurrences of
the literal "from src.demark_world" in the codebase (including start_server.py
and example.py) and replace them with "from demark_world" keeping the rest of
each import path unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant