Skip to content

Comments

Remove legacy v1 SDK code, tests, and documentation#208

Open
dzimine-lc wants to merge 1 commit intocli-v2from
remove-legacy-v1
Open

Remove legacy v1 SDK code, tests, and documentation#208
dzimine-lc wants to merge 1 commit intocli-v2from
remove-legacy-v1

Conversation

@dzimine-lc
Copy link
Contributor

Summary

  • Delete 32 legacy Python files (26 PascalCase domain modules + 6 utility files)
  • Rewrite __init__.py to a minimal v2-only re-export of __version__
  • Delete 17 legacy test files (9 unit + 8 integration)
  • Update test_user_agent.py to use build_user_agent() from user_agent_utils directly
  • Rename 26 integration test_v2_*.pytest_*.py
  • Remove legacy v1 SDK section and migration table from README
  • Update CLAUDE.md to reflect single-SDK architecture

Context (from implementation plan)

The cli-v2 branch is a complete rewrite of the LimaCharlie Python SDK and CLI. The v2 code (limacharlie/sdk/, limacharlie/commands/, core modules) is fully independent and does not import any legacy v1 code. However, the legacy v1 classes (Manager, Sensor, Firehose, etc.) were still bundled in the package and exported from limacharlie/__init__.py for backward compatibility. This PR makes a clean break — removing all legacy code, tests, and documentation.

Key finding

v2 has zero imports from legacy modules. The only shared files are utility modules that v2 uses directly and are kept:

  • user_agent_utils.py (used by client.py)
  • oauth_simple.py (used by client.py)
  • oauth_firebase_simple.py (used by commands/auth.py, oauth_simple.py)
  • oauth_mfa.py (used by oauth_firebase_simple.py)
  • oauth_server.py (used by oauth_firebase_simple.py)
  • signup.py (used by commands/auth.py)
  • constants.py (used by oauth_firebase_simple.py, signup.py)

Deleted legacy source files (32 files)

26 PascalCase domain modules:
Manager.py, Sensor.py, Firehose.py, Spout.py, Sync.py, Configs.py, Search.py, SearchAPI.py, Hive.py, Logs.py, Payloads.py, Replay.py, Billing.py, Extensions.py, Jobs.py, Webhook.py, WebhookSender.py, User.py, UserPreferences.py, ARL.py, DRCli.py, Query.py, Model.py, USP.py, SpotCheck.py, Replicants.py

6 legacy-only utility files:
utils.py, request_utils.py, term_utils.py, time_utils.py, versions.py, oauth.py

Rewritten __init__.py

Old: 82 lines exporting all legacy classes, defining __version__ = "4.11.3", _getEnvironmentCreds(), and GLOBAL_* variables.

New: minimal, just re-exports __version__ from client.py (5.0.0).

Deleted legacy tests (17 files)

9 unit tests: test_search_api.py, test_search_api_extended.py, test_ssl_context.py, test_query.py, test_requests_utils.py, test_term_utils.py, test_time_utils.py, test_usp.py, test_configs.py

8 integration tests: test_core.py, test_hive_validation.py, test_search_api_integration.py, test_sync.py, test_replicants.py, test_insight.py, test_artifacts.py, test_spout.py

Files NOT touched (v2 core)

  • limacharlie/cli.py, client.py, config.py, errors.py, output.py, discovery.py
  • limacharlie/ai_help.py, help_topics.py, __main__.py
  • limacharlie/user_agent_utils.py, constants.py
  • limacharlie/oauth_simple.py, oauth_firebase_simple.py, oauth_mfa.py, oauth_server.py
  • limacharlie/signup.py
  • All files in limacharlie/sdk/ (32 files)
  • All files in limacharlie/commands/ (46 files)
  • pyproject.toml

Test plan

  • python -c "import limacharlie; print(limacharlie.__version__)" → 5.0.0
  • python -c "from limacharlie.client import Client; print('OK')" → OK
  • python -c "from limacharlie.sdk.organization import Organization; print('OK')" → OK
  • limacharlie --version → 5.0.0
  • pytest tests/unit/ -v → 672 passed, 2 skipped

🤖 Generated with Claude Code

The v2 SDK and CLI are fully independent of the legacy v1 code.
This removes all legacy modules to make a clean break for the 5.0
release.

- Delete 26 legacy PascalCase domain modules (Manager.py, Sensor.py, etc.)
- Delete 6 legacy-only utility files (utils.py, request_utils.py, etc.)
- Rewrite __init__.py to only re-export __version__ from client.py
- Delete 9 legacy unit tests and 8 legacy integration tests
- Update test_user_agent.py to use build_user_agent() directly
- Rename integration test_v2_*.py → test_*.py
- Remove legacy v1 SDK section and migration table from README
- Update CLAUDE.md to reflect single-SDK architecture

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dzimine-lc
Copy link
Contributor Author

Prompt used:

Remove legacy support

Goal: remove all legacy code from the new branch.

Context

This is a rewrite of the LC CLI and SDK. The old version is on master branch. The new version is on the current cli-v2 branch. We will freeze the old version. The new version is a complete rewrite. The @NEW_CLI.md file describes the design for the rewrite. The core rewrite is already done; we are at the clean-up stage.

Problem statement

We want a complete break from the old version, per NEW_CLI.md. But currently the legacy is still supported in the new CLI.
Per README.md, section "Legacy v1 SDK"
:

Legacy v1 SDK
The v1 SDK classes (Manager, Sensor, Firehose, Sync, etc.) remain available under limacharlie.* for backward compatibility. They
are not actively developed but will continue to work.
v1 imports still work

import limacharlie
man = limacharlie.Manager(oid="...", secret_api_key="...")
sensors = man.sensors()

and we have duplicate files for everything, carrying in old code with python 2 support, which is NOT what we want.
Please redo this:

  • First, understand the legacy: check out master branch, analyze the code and know what it is.
  • Then, on the cli-v2 branch, get rid of the legacy completely. Remove implementation of the legacy support. Remove all unnessessary legacy python files. Update readme. Do other updates as you see fit.
  • Present the plan first, then proceed with implementation.

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