Compare commits

...

5 Commits

Author SHA1 Message Date
Michael Yang fc60bd74e9 Merge pull request #8 from jmorganca/brucemacd/remote-create
fix: remote create new file
2024-01-12 09:22:52 -08:00
Bruce MacDonald e3733a235d fix tests 2024-01-12 11:03:40 -05:00
Bruce MacDonald b232a6c04d fix: remote create new file 2024-01-12 10:48:59 -05:00
Michael Yang e0ee198195 Merge pull request #7 from jmorganca/mxyng/fix-publish
fix gh release upload
2024-01-11 16:53:47 -08:00
Michael Yang 99df3c3a07 fix gh release upload 2024-01-11 16:52:17 -08:00
3 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -22,6 +22,6 @@ jobs:
poetry version ${GITHUB_REF_NAME#v}
poetry build
- uses: pypa/gh-action-pypi-publish@release/v1
- run: gh release upload $GIT_REF_NAME dist/*
- run: gh release upload $GITHUB_REF_NAME dist/*
env:
GH_TOKEN: ${{ github.token }}
+3 -3
View File
@@ -262,7 +262,7 @@ class Client(BaseClient):
for line in io.StringIO(modelfile):
command, _, args = line.partition(' ')
if command.upper() in ['FROM', 'ADAPTER']:
path = Path(args).expanduser()
path = Path(args.strip()).expanduser()
path = path if path.is_absolute() else base / path
if path.exists():
args = f'@{self._create_blob(path)}'
@@ -288,7 +288,7 @@ class Client(BaseClient):
raise
with open(path, 'rb') as r:
self._request('PUT', f'/api/blobs/{digest}', content=r)
self._request('POST', f'/api/blobs/{digest}', content=r)
return digest
@@ -563,7 +563,7 @@ class AsyncClient(BaseClient):
break
yield chunk
await self._request('PUT', f'/api/blobs/{digest}', content=upload_bytes())
await self._request('POST', f'/api/blobs/{digest}', content=upload_bytes())
return digest
+2 -2
View File
@@ -418,7 +418,7 @@ def test_client_create_from_library(httpserver: HTTPServer):
def test_client_create_blob(httpserver: HTTPServer):
httpserver.expect_ordered_request(PrefixPattern('/api/blobs/'), method='HEAD').respond_with_response(Response(status=404))
httpserver.expect_ordered_request(PrefixPattern('/api/blobs/'), method='PUT').respond_with_response(Response(status=201))
httpserver.expect_ordered_request(PrefixPattern('/api/blobs/'), method='POST').respond_with_response(Response(status=201))
client = Client(httpserver.url_for('/'))
@@ -759,7 +759,7 @@ async def test_async_client_create_from_library(httpserver: HTTPServer):
@pytest.mark.asyncio
async def test_async_client_create_blob(httpserver: HTTPServer):
httpserver.expect_ordered_request(PrefixPattern('/api/blobs/'), method='HEAD').respond_with_response(Response(status=404))
httpserver.expect_ordered_request(PrefixPattern('/api/blobs/'), method='PUT').respond_with_response(Response(status=201))
httpserver.expect_ordered_request(PrefixPattern('/api/blobs/'), method='POST').respond_with_response(Response(status=201))
client = AsyncClient(httpserver.url_for('/'))