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

Fix issue 93 Windows blob upload #94

Merged
merged 2 commits into from
Jul 6, 2023

Conversation

sunnycarter
Copy link
Contributor

Fix for #93

Tested on Linux by writing unit test for parse_manifest and running it before and after change.
Tested on Window by trying to upload a blob with the path C:\blah\blah.json - failed before the fix, succeeds afterwards.

@vsoch
Copy link
Contributor

vsoch commented Jul 6, 2023

Really nice job! If we get it fully working on Windows we will need to have a release for Windows for our conda recipe.

It looks like for linting, e.g.,:

python -m venv env
source env/bin/activate
pip install -r .github/dev-requirements.txt

Then

pre-commit run --all-files

Is hitting a few snags - mostly with typing if you want to adjust those.

 trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing oras/tests/test_utils.py
Fixing oras/tests/test_provider.py
Fixing oras/utils/fileio.py

mixed line ending........................................................Passed
black....................................................................Failed
- hook id: black
- files were modified by this hook

reformatted oras/utils/fileio.py

All done! ✨ 🍰 ✨
1 file reformatted, 13 files left unchanged.
All done! ✨ 🍰 ✨
13 files left unchanged.

isort....................................................................Failed
- hook id: isort
- files were modified by this hook

Fixing /home/runner/work/oras-py/oras-py/oras/tests/test_provider.py

mypy.....................................................................Failed
- hook id: mypy
- exit code: 1

oras/utils/fileio.py:364: error: Incompatible return value type (got "Tuple[str, ...]", expected "Tuple[str, Optional[str]]")
Found 1 error in 1 file (checked 14 source files)
oras/utils/fileio.py:364: error: Incompatible return value type (got "Tuple[str, ...]", expected "Tuple[str, Optional[str]]")
Found 1 error in 1 file (checked 13 source files)

flake8...................................................................Failed
- hook id: flake8
- exit code: 1

oras/utils/fileio.py:329:7: W605 invalid escape sequence '\m'
oras/utils/fileio.py:334:7: W605 invalid escape sequence '\m'

make: *** [Makefile:11: lint] Error 1
Error: Process completed with exit code 2.

Signed-off-by: Sunny Carter <[email protected]>
@sunnycarter
Copy link
Contributor Author

Thanks for the review. I had some issues with returning Tuples with Optional[str] in the type, so I've changed it to return a small class. All those checks are passing now.

@vsoch
Copy link
Contributor

vsoch commented Jul 6, 2023

Thanks for fixing that, and sorry for the trouble! I have mixed feelings about "typing" in python - it seems to add more headache often than it's worth, but at least for this project we commit so makes sense to keep trying.

@vsoch vsoch merged commit 8c1f7cc into oras-project:main Jul 6, 2023
@sunnycarter
Copy link
Contributor Author

sunnycarter commented Jul 10, 2023 via email

@vsoch
Copy link
Contributor

vsoch commented Jul 10, 2023

Thank you for the reminder! I intended to but had two full days and just didn't get to it. 😆 https://github.com/oras-project/oras-py/releases/tag/0.1.19

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