Skip to content

chore: add Python .gitignore - #24

Open
kilo-code-bot[bot] wants to merge 3 commits into
masterfrom
gitignore
Open

chore: add Python .gitignore#24
kilo-code-bot[bot] wants to merge 3 commits into
masterfrom
gitignore

Conversation

@kilo-code-bot

@kilo-code-bot kilo-code-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

Adds a standard Python .gitignore from the GitHub gitignore template, preventing generated files (bytecode, lookup tables, build artifacts) from being tracked.

  • Fixes M_lut.npy typo -> C_lut.npy (the file cplot.py actually loads)
  • Prevents future __pycache__ files from being committed (the Cloud Agent auto-commit recently picked these up)

Summary by CodeRabbit

  • Chores
    • Added comprehensive ignore rules for Python bytecode, build artifacts, virtual environments, test outputs, IDE files, caches, credentials, temporary files, and generated data.

endolith and others added 3 commits August 4, 2026 00:36
Not sure about `.python-version` line
The code loads C_lut.npy (complex_colormap/cplot.py:25), not M_lut.npy.
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The pull request adds 223 lines to .gitignore. The rules cover Python artifacts, environments, framework files, development-tool metadata, credentials, caches, and generated data.

Changes

Python project ignore rules

Layer / File(s) Summary
Comprehensive ignore policy
.gitignore
The file ignores Python build and test artifacts, framework outputs, package-manager environments, runtime files, IDE metadata, caches, secrets, and generated data. It preserves Pixi configuration and excludes the generated C_lut.npy lookup table.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the addition of a Python-focused .gitignore file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch gitignore

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 @.gitignore:
- Around line 222-223: Ensure the package includes or generates C_lut.npy before
complex_colormap imports cplot. Update the packaging/import flow around
complex_colormap/__init__.py, setup.py, and generation.py so clean installations
do not raise FileNotFoundError, while preserving normal cplot imports.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 13efb68c-55c7-401a-a9a3-119c15eae161

📥 Commits

Reviewing files that changed from the base of the PR and between 410aad7 and 8c3520d.

📒 Files selected for processing (1)
  • .gitignore

Comment thread .gitignore
Comment on lines +222 to +223
# Generated lookup table
C_lut.npy

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n -C 5 'C_lut\.npy|M_lut\.npy|np\.load|numpy\.load' complex_colormap/cplot.py

if git ls-files --error-unmatch -- C_lut.npy >/dev/null 2>&1; then
  echo "C_lut.npy is tracked."
else
  echo "C_lut.npy is not tracked; locate its generator or packaging path."
  rg -n -C 5 'C_lut\.npy|generate.*lut|lookup table' .
fi

Repository: endolith/complex_colormap

Length of output: 6727


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- repository files ---'
git ls-files | sed -n '1,160p'

printf '%s\n' '--- packaging and build configuration ---'
for f in setup.py setup.cfg pyproject.toml MANIFEST.in requirements.txt requirements-dev.txt; do
  if [ -f "$f" ]; then
    echo "### $f"
    cat -n "$f"
  fi
done

printf '%s\n' '--- generation entry point ---'
sed -n '115,190p' complex_colormap/generation.py

printf '%s\n' '--- package references ---'
rg -n -C 3 'generation|C_lut\.npy|package_data|data_files|include_package_data|MANIFEST' .

Repository: endolith/complex_colormap

Length of output: 6658


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
import ast
from pathlib import Path
import subprocess

tracked = subprocess.run(
    ["git", "ls-files", "--error-unmatch", "--", "C_lut.npy"],
    capture_output=True, text=True
).returncode == 0

setup = Path("setup.py").read_text()
init_tree = ast.parse(Path("complex_colormap/__init__.py").read_text())
generation_tree = ast.parse(Path("complex_colormap/generation.py").read_text())

setup_calls = [
    node for node in ast.walk(ast.parse(setup))
    if isinstance(node, ast.Call)
    and isinstance(node.func, ast.Name)
    and node.func.id == "setup"
]
setup_call = setup_calls[0]
keywords = {kw.arg: ast.unparse(kw.value) for kw in setup_call.keywords if kw.arg}
imports = [
    alias.name for node in init_tree.body
    if isinstance(node, ast.ImportFrom) and node.module == "."
    for alias in node.names
]
main_guards = [
    node for node in generation_tree.body
    if isinstance(node, ast.If)
    and ast.dump(node.test) == ast.dump(
        ast.Compare(
            left=ast.Name(id="__name__", ctx=ast.Load()),
            ops=[ast.Eq()],
            comparators=[ast.Constant(value="__main__")]
        )
    )
]

save_calls = [
    ast.unparse(node)
    for node in ast.walk(generation_tree)
    if isinstance(node, ast.Call)
    and isinstance(node.func, ast.Attribute)
    and isinstance(node.func.value, ast.Name)
    and node.func.value.id == "np"
    and node.func.attr == "save"
]

print(f"tracked_C_lut={tracked}")
print(f"setup_package_data={keywords.get('package_data', '<absent>')}")
print(f"setup_include_package_data={keywords.get('include_package_data', '<absent>')}")
print(f"init_imports={imports}")
print(f"generation_main_guard_count={len(main_guards)}")
print(f"generation_save_calls={save_calls}")
PY

printf '%s\n' '--- Makefile targets ---'
cat -n Makefile

Repository: endolith/complex_colormap

Length of output: 1397


Include or generate C_lut.npy before importing cplot.

C_lut.npy is untracked and setup.py does not package it. complex_colormap/__init__.py imports cplot before generation, while generation.py creates the file only under its __main__ block. A clean install therefore fails with FileNotFoundError.

🤖 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 @.gitignore around lines 222 - 223, Ensure the package includes or generates
C_lut.npy before complex_colormap imports cplot. Update the packaging/import
flow around complex_colormap/__init__.py, setup.py, and generation.py so clean
installations do not raise FileNotFoundError, while preserving normal cplot
imports.

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