Skip to content

Conversation

@CyanVoxel
Copy link
Member

@CyanVoxel CyanVoxel commented Aug 28, 2025

Note

Blocked by #942, #948, and #1058 due to refactoring in overlapping areas.

Summary

While I started this with the intention to merely clean up the Pyright errors inside the core library files, I ended up falling down the rabbit hole of discovering that the entire alchemy library directory has been riddled with cyclical imports that while not causing runtime issues, apparently do cause behind the scenes issues with Pyright and other type checkers while also indicating deeper issues with the architectural layering (see Eric Traut's comment on this as well as DetachHead's comment).

image

To address these issues I've chosen to merge nearly all of the code from models.py, fields.py, joins.py, visitors.py, and default_color_groups.py into library.py. In the process I've also addressed any Pyright issues along the way but have otherwise left the code unchanged. While this increases the size of library.py by about 33%, it does end up grouping together a lot of highly related functionality that maybe shouldn't have been siloed off into their own co-dependent files to begin with. I'd be happy to break out any code that doesn't need to be in here at this point, but this file may just need to be a big boy to avoid these types of cycles...

Tasks Completed

  • Platforms Tested:
    • Windows x86
    • Windows ARM
    • macOS x86
    • macOS ARM
    • Linux x86
    • Linux ARM
  • Tested For:
    • Basic functionality
    • PyInstaller executable

@CyanVoxel CyanVoxel added the Type: Refactor Code that needs to be restructured or cleaned up label Aug 28, 2025
@CyanVoxel CyanVoxel added TagStudio: Library Relating to the TagStudio library system Priority: Medium An issue that shouldn't be be saved for last Status: Review Needed A review of this is needed labels Aug 28, 2025
@CyanVoxel CyanVoxel moved this to 🏓 Ready for Review in TagStudio Development Aug 28, 2025
@CyanVoxel CyanVoxel marked this pull request as draft August 28, 2025 07:21
@CyanVoxel CyanVoxel added the Status: Blocked This issue or pull request is awaiting the outcome of another issue or pull request label Aug 28, 2025
@CyanVoxel CyanVoxel added this to the Alpha v9.5.5 milestone Aug 28, 2025
@CyanVoxel CyanVoxel removed the Status: Blocked This issue or pull request is awaiting the outcome of another issue or pull request label Aug 29, 2025
@CyanVoxel CyanVoxel marked this pull request as ready for review August 29, 2025 23:59
@CyanVoxel CyanVoxel modified the milestones: Alpha v9.5.5, Alpha v9.5.6 Sep 3, 2025
@CyanVoxel CyanVoxel added Priority: High An important issue requiring attention and removed Priority: Medium An issue that shouldn't be be saved for last labels Sep 6, 2025
@CyanVoxel CyanVoxel removed Priority: High An important issue requiring attention Status: Review Needed A review of this is needed labels Sep 6, 2025
@CyanVoxel CyanVoxel removed this from the Alpha v9.5.6 milestone Sep 6, 2025
@CyanVoxel
Copy link
Member Author

Closed in favor of #1103.

@CyanVoxel CyanVoxel closed this Sep 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

TagStudio: Library Relating to the TagStudio library system Type: Refactor Code that needs to be restructured or cleaned up

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants