Skip to content

Refactor/deduplicate config path constants#436

Merged
anderdc merged 4 commits intoentrius:testfrom
wdeveloper16:refactor/deduplicate-config-path-constants
Apr 15, 2026
Merged

Refactor/deduplicate config path constants#436
anderdc merged 4 commits intoentrius:testfrom
wdeveloper16:refactor/deduplicate-config-path-constants

Conversation

@wdeveloper16
Copy link
Copy Markdown
Contributor

Summary

GITTENSOR_DIR and CONFIG_FILE were defined identically in two places:

  • cli/main.py:28-29
  • cli/issue_commands/helpers.py:48-49

Moves the canonical definition to gittensor/constants.py. Both files now import from there.
Also removes the now-unused from pathlib import Path import from helpers.py.

constants.py is used as the shared home to avoid a circular import -
main.py already imports from issue_commands/__init__.pyhelpers.py.

Test plan

  • pytest tests/cli/ tests/utils/, no new failures

@wdeveloper16 wdeveloper16 force-pushed the refactor/deduplicate-config-path-constants branch from 10587ea to 2f463fd Compare April 15, 2026 04:28
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.

just move it and export it from helpers, doesn't need to be moved all the way up to constants.py.

Or just keep it in cli/main.py and have helper import it from there.

Either way these are just for the CLI and not needed across the codebase

@wdeveloper16 wdeveloper16 force-pushed the refactor/deduplicate-config-path-constants branch from 2f463fd to 99cd926 Compare April 15, 2026 13:48
@wdeveloper16
Copy link
Copy Markdown
Contributor Author

Hi, @anderdc
Good point! these are CLI-only and don't belong in constants.py.

One thing worth noting: option 2 (keep in main.py, import from there in helpers.py) would create a circular import - main.py already imports from issue_commands/__init__.py, which imports helpers.py, so importing back from main.py would close the loop.

Option 1 (define in helpers.py, have main.py import from there) doesn't have that issue.
Happy to update the PR to do that instead.

@wdeveloper16 wdeveloper16 requested a review from anderdc April 15, 2026 14:00
anderdc
anderdc previously approved these changes Apr 15, 2026
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.

I see what you mean, we'll just leave it as is, simple dedup

@wdeveloper16
Copy link
Copy Markdown
Contributor Author

Thanks for your review, @anderdc
And sorry for my CI failure.
I will fix it right now.

@wdeveloper16 wdeveloper16 force-pushed the refactor/deduplicate-config-path-constants branch from 6545c71 to a071050 Compare April 15, 2026 16:20
@wdeveloper16
Copy link
Copy Markdown
Contributor Author

Hi, @anderdc
Would you please review it again? 🙏
I'm sure CI will be passed.

@anderdc anderdc merged commit a169494 into entrius:test Apr 15, 2026
4 checks passed
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.

2 participants