Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SGA 2.0 #16

Open
wants to merge 59 commits into
base: staging
Choose a base branch
from
Open

SGA 2.0 #16

wants to merge 59 commits into from

Conversation

ModernMAK
Copy link
Member

A rework for the SGA core, which lets SGA's define their own filesystems so long as they implement a few core methods.

This will reduce the dependency between plugins, while hopefully maintaining core compatibility.

Added `open_sga` and `open_sga_from_handle` to allow finer typed control and avoid using "sga://{path}"
Reformatted to make debugging entrypoints easier
Writing is unfortunately, no longer implemented, but open speeds are MUCH faster.

Perhaps at a later date, mmap could be used to avoid the multitude of seeks done to read the data lazily
Not supports nested filesystems and binary handles
Added specific hashing errors

Check / Validate separation; `check` returns True if the hash matches, `validate` raises an error if the hash does not match.
Better error when writing bytes

packing / unpacking string improvements
Refactor names of fields
Implement slicing for ToC Area
`item` to `index`
they are functionally the same (in the tool) so I wouldn't have known without modpackager
We also drop lazyio; it was refactored into core and was never dropped here
No longer used; plugins manage their own filesystem implementations
Plugins specify their own FS implementation; only require a common interface
Errors are now defined in errors

Hashtools no longer exposes 'T' typevar

Raise more specific error on validate_magic_word
- Refactor _validate_magic_word to serialization
- Fix Hashable not including bytearray
- Added protocol for specifying Hasher's hash function
- Hasher now acts as an instance instead of a class
- Test Cases for hashtools
This can't be automated without a separate script; and was mostly for me to know that I need to bump the Major SemVer
Empty Test Case
check to prevent permission error when treating a file as a folder in the path
Currently, we don't have a universal 'save' function

I could add it to the EssenceFS ABC, but until I know how to properly pack other formats; I think this is a safe bet to have packers by version specific
Cannot test issue-39 without an SGA plugin; move to SGA v2
@ModernMAK ModernMAK changed the base branch from main to staging October 31, 2023 08:25
Inching closer to a valid release

It is good to do this; as I get to see 'bugs' or issues in the codebase that look/feel like code smells
Specifying Types
Applying Black
Removing unnecessary ellipsis
Working around mypy complainingabout intended codesmells (None for non-nullable types to raise errors when classvars aren't set)
This should prevent accidentally comiting an init for the namespaces

Pycharm really likes to disrespect namespace packages
I'm still flip-flopping on defining a concrete FS in Core

On one hand; I want plugins to specify their own

On the other hand; I dont want to copy-paste the 'tree-like' thing I have in SGA-V2
I like the lazy/mem solution I have going on; its just coupling it to the plugin spec thats the problem

By making essencfs a package; I can add a lazyfs module and copy the code from SGA-V2 to here
Instead of using setup.py, setup.cfg and pyproject.toml
Add a bunch of `type:ignore` directives to allow mypy to pass. It shouldn't be too much of an issue; I believe it's more of a 'me-not understanding how to properly type' issue than a the type-checker is catching errors issue.
should make it so mypy ignores dependencies that are updated in parallel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant