Skip to content

Commit

Permalink
make lint
Browse files Browse the repository at this point in the history
  • Loading branch information
drernie committed Oct 20, 2023
1 parent 060af79 commit 1077b50
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
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

0 comments on commit 1077b50

Please sign in to comment.