Skip to content

Conversation

@Wollaston
Copy link

This PR is twofold:

  • Convert the existing seqscore repo into a workspace with the main seqscore cli as the workspace root, and the new seqscore-lib project as the library backend for the CLI. The intention is so that this can be published/distributed separately and used as a library. This uses uv to effectively manage and package this.
  • Use pydantic instead of attrs

Note Pydantic provides automatic type validations and conversions. So, depending on configuration, some LSPs/Type Checkers may not know this and throw errors. If you run mypy and the pre-commit script, it will show that all types have been statically checked.

One notable change is with the LabeledSequence implementation. Previously, this overwrote the __iter__ dunder method to return self.tokens as an Iterable. This couldn't be done with Pydantic as it relies on __iter__ for its internal validation. There only appeared to be a few calls that expected this functionality, so those just call the tokens field of the instance to get an Iterable and the Pydantic default __iter__ is maintained for its expected internal use elsewhere.

Pydantic does not currently support opting certain fields out of __hash__ and __eq__ so for LabeledSequence again, those are manually implemented to maintain the original functionality.

@ConstantineLignos
Copy link
Member

I took a quick look and things look sane. Let's meet next week to talk over the restructuring of the library vs cli. I want to get an idea of if it's absolutely necessary and what alternatives are to the current approach.

@Wollaston Wollaston closed this Jul 28, 2025
@Wollaston
Copy link
Author

Closed in favor of not restructuring library at this time

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