File store operations, refactor and ruff fixes#26
Merged
Conversation
- Added `get_source_file_info` and `store_source_file` to `SubmissionFileStore` - Implemented `get_source_file_info` and `store_source_file` in `GsFileStore` - Rename `Upload` to `Workspace` - add `yarl` for `URL` - Changes `Workspace` `FileError` and `FileStatus` to pydantic instead of `NamedTuple` - Added `crc32c`, `url` and `is_versioned` to - In `FileStatus` renamed `size` to `bytes` for explicit units - In `FileStatus` renamed `file_type` to `content_type`
- Added `AddFiles`, `RemoveFiles`, and `RemoveAllFiles` events to `submit_ce/api/domain/event/file.py`. These inherit from `EventWithSideEffect` and interact with the `SubmitApi` - Added unit tests - Extracted the `SubmitFile` Protocol into a dedicated `types.py` file to resolve a circular import - Unified the `SubmissionFileStore` return types, updating `get_source_file` to return an `arxiv.files.FileObj` - Added missing abstract methods to the `SubmissionFileStore` interface. - Implemented previously missing methods in the `GsFileStore` - Added stub methods to `LegacyFileStore` to satisfy the updated abstract base class
- Changes to github workflow to standardize coverage config with pyproject - Adds test.sh to run tests similar to GHA
also fixes some ruff errors, moves
This is to fix circular import problems. The domain objects are no longer under submit_ce.api so they can successfully import and use api objects for typing. It is safe to use them just for typing since no functions are called and no classes instanciated. This is done with `annotations` and `TYPE_CHECKING` conditions. - Fixes ruff errors - Tests at get past import errors
I often don't want it run.
Tests all pass No linting errors More work on moving domain to its own packages
Also removes dome validation from submit_ce/domain/annotation.py since it is now handled by pydantic
Contributor
Author
|
Added some tests to get test coverage up. |
| current_run = '' | ||
|
|
||
| last_run = False | ||
| # last_run = False |
There was a problem hiding this comment.
I need to rewrite this module before Submit 2.0 goes live.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor to move
submit_ce.api.domaintosubmit_ce.domainto avoid circular importsThis is to avoid circular imports. Having domain under
submit_ce.apicaused circular imports due to it importing many packages for exporting as a "exposing the API" pattern.Avoiding circular imports also included using a pattern like:
fixes ruff errors
Many ruff errors are fixed.
changes to pytest config in pyproject.toml
I found the config of pytest a bit surprising and dialed back some of the configs in pyproject.toml