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

poetry update #93

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ install:
update:
poetry update

check:
poetry check
make typecheck
make lint


test: typecheck
echo "Testing with WRITE_BUCKET=$(WRITE_BUCKET)"
poetry run pytest $(TEST_README) --cov --cov-report xml:coverage.xml
Expand All @@ -34,6 +40,10 @@ test-long:
typecheck:
poetry run mypy $(PROJECT) tests

lint:
poetry run black $(PROJECT) tests
poetry run flake8 $(PROJECT) tests

coverage:
echo "Using WRITE_BUCKET=$(WRITE_BUCKET) | SKIP_LONG_TESTS=$(SKIP_LONG_TESTS)"
poetry run pytest --cov --cov-report html:coverage_html
Expand Down
1,289 changes: 734 additions & 555 deletions poetry.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ universal-pathlib = "^0.1.1"
urllib3 = "<2"

[tool.poetry.group.dev.dependencies]
black = "^23.9.1"
flake8 = "^6.0.0"
mypy = "^1.4.1"
pytest-cov = "^4.0.0"
Expand Down
19 changes: 8 additions & 11 deletions quiltplus/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import logging
import shutil
from pathlib import Path

from quilt3 import Package # type: ignore
from quiltcore import Builder, Changes, Manifest
Expand Down Expand Up @@ -63,32 +62,32 @@ async def get(self, opts: dict = {}):
dest = self.check_dir_arg(opts)
logging.debug(f"get dest={dest}: {opts}")
man = self.remote_man()
rc = self.volume.put(man) # TODO: update self.tag
self.volume.put(man) # TODO: update self.tag
files = self.local_files()
return [f"file://{fn}" for fn in files]

#
# Create/Revise Package
#

def unchanged(self) -> bool: # pragma: no cover
def unchanged(self) -> bool: # pragma: no cover
if not hasattr(self, "changes"):
return True
if not isinstance(self.changes, Changes):
return True

return len(self.changeset()) == 0

def changeset(self) -> Changes: # pragma: no cover
def changeset(self) -> Changes: # pragma: no cover
vpath = self.volume.path
if self.unchanged():
self.changes = Changes(vpath)
if self.changes.path == vpath:
return self.changes

raise ValueError(f"{self.ERROR_VOL}: {self.changes.path} != {vpath}")

def commit(self, **kwargs) -> Manifest: # pragma: no cover
def commit(self, **kwargs) -> Manifest: # pragma: no cover
"""
Create manifest.
Store in the local registry.
Expand All @@ -111,9 +110,7 @@ async def push(self, q: Package, opts: dict):
kwargs = {
self.K_REG: self.registry,
self.K_FORCE: not opts.get(self.K_FAIL, False),
self.K_MSG: opts.get(
self.K_MSG, f"{__name__} {self.Now()} @ {opts}"
),
self.K_MSG: opts.get(self.K_MSG, f"{__name__} {self.Now()} @ {opts}"),
}
logging.debug(f"push dest={dest}: {opts}\n{kwargs}")
q.set_dir(".", dest)
Expand Down Expand Up @@ -157,7 +154,7 @@ async def local_pkg(self):

async def remote_pkg(self):
return (await self.browse()) or Package()

def delete(self): # remove local cache
return shutil.rmtree(self.last_path)

Expand Down
3 changes: 0 additions & 3 deletions quiltplus/type.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
from datetime import datetime

from quiltcore import Resource
from tzlocal import get_localzone
from un_yaml import UnUri # type: ignore


Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
max-line-length = 127
2 changes: 1 addition & 1 deletion tests/test_push.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async def test_push_patch(tmpdir: Path):


@pytest.mark.skip("Not fully implemented")
def test_push_core_commit(tmpdir: Path): # pragma: no cover
def test_push_core_commit(tmpdir: Path): # pragma: no cover
name = "test_push_core_commit"
pkg = get_unique_pkg(name)
cache = tmpdir / name
Expand Down
Loading