Skip to content

Remove redundant dependencies and enforce exact pinning#1265

Merged
anderdc merged 2 commits into
entrius:testfrom
seroperson:deps-enh
May 22, 2026
Merged

Remove redundant dependencies and enforce exact pinning#1265
anderdc merged 2 commits into
entrius:testfrom
seroperson:deps-enh

Conversation

@seroperson
Copy link
Copy Markdown
Contributor

Closes #1264

Summary

Audited pyproject.toml against the actual import graph and tightened both the dep list and the pinning policy.

Eight redundant packages dropped:

  • bittensor-cli, bittensor-commit-reveal: zero direct imports anywhere, and neither is a transitive of bittensor 10.0.1
  • bittensor-wallet: already a transitive of bittensor; explicit pin only risked fighting the resolver
  • levenshtein, python-dotenv: zero direct imports; env vars are already read via os.environ
  • fastapi, uvicorn from [debug]: already transitives of bittensor; the explicit pins were downgrading what bittensor wanted
  • pytz: only consumer was CHICAGO_TZ + parse_github_timestamp_to_cst in gittensor/validator/utils/datetime_utils.py, which chore: integrate pre-push vulture dead-code scanner #1253 found is dead code

Every remaining direct dep is now exact-pinned (==), replacing the previous mix of ==, >=, and bare names. The lockfile and pyproject.toml now agree on a single resolution by construction.

Held bittensor at 10.0.1: bumping needs more involved changes and is better addressed in a separate PR to avoid widening scope. The same for tree-sitter and tree-sitter-language-pack.

Removed Why
bittensor-cli==9.17.0 (runtime) No import bittensor_cli anywhere; not a transitive of bittensor 10.0.1
bittensor-commit-reveal==0.4.0 (runtime) No import bittensor_commit_reveal anywhere; not a transitive
bittensor-wallet==4.0.0 (runtime) Already a transitive of bittensor; the explicit pin only fought the resolver
levenshtein==0.27.3 (runtime) Zero direct imports (Levenshtein, levenshtein, rapidfuzz) anywhere
python-dotenv==1.2.1 (runtime) load_dotenv() never called; env vars read via os.environ.get already
pytz==2025.2 (runtime) Only consumer was dead code (see below)
fastapi==0.110.1 (from [debug]) Already a transitive of bittensor; explicit pin was downgrading it
uvicorn==0.32.0 (from [debug]) Already a transitive of bittensor; explicit pin was downgrading it
CHICAGO_TZ constant in gittensor/validator/utils/datetime_utils.py Only used inside parse_github_timestamp_to_cst (also dead)
parse_github_timestamp_to_cst() function Never called anywhere in gittensor/, neurons/, tests/, scripts/ (per #1253)
import pytz in datetime_utils.py No remaining consumer after CHICAGO_TZ removed

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other

Testing

  • Tests added/updated
  • Manually tested

@xiao-xiao-mao xiao-xiao-mao Bot added the refactor Code restructuring without behavior change label May 14, 2026
@anderdc
Copy link
Copy Markdown
Collaborator

anderdc commented May 19, 2026

Fix conflicts.

@seroperson
Copy link
Copy Markdown
Contributor Author

@anderdc done 🫡

Copy link
Copy Markdown
Collaborator

@anderdc anderdc left a comment

Choose a reason for hiding this comment

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

Keep bittensor-cli==9.17.0 (re-add it and regenerate uv.lock). Nothing imports bittensor_cli, but it ships the btcli command — removing it strips the tool from local venvs. It is a tool dependency, not a library dependency, so the zero-call-sites read in #1264 does not apply to it. The rest of the PR — the other dep removals, exact-pinning, the dead pytz code, and the pyrightconfig.json fix — is fine.

@anderdc
Copy link
Copy Markdown
Collaborator

anderdc commented May 22, 2026

fix conflicts

@anderdc anderdc merged commit 34d266e into entrius:test May 22, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Code restructuring without behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove redundant dependencies and enforce exact pinning

2 participants