Update dependencies - pyxdg, pytest, black (#1076)

* Update version pin on pyxdg and run poetry update
* Update pytest pin and rerun poetry update
* Update black pin to latest version, poetry update, and make format
This commit is contained in:
Micah Jerome Ellison 2020-11-14 11:29:51 -08:00 committed by Jonathan Wren
parent 7a465eabeb
commit c38c39efee
No known key found for this signature in database
GPG key ID: 43D5FF8722E7F68A
10 changed files with 435 additions and 319 deletions

View file

@ -50,7 +50,7 @@ def check_output_field_key(context, field, key):
@then("the json output should contain {path}") @then("the json output should contain {path}")
@then('the json output should contain {path} = "{value}"') @then('the json output should contain {path} = "{value}"')
def check_json_output_path(context, path, value=None): def check_json_output_path(context, path, value=None):
""" E.g. """E.g.
the json output should contain entries.0.title = "hello" the json output should contain entries.0.title = "hello"
""" """
out = context.stdout_capture.getvalue() out = context.stdout_capture.getvalue()

View file

@ -248,7 +248,10 @@ class Journal:
to_delete = [] to_delete = []
def ask_delete(entry): def ask_delete(entry):
return yesno(f"Delete entry '{entry.pprint(short=True)}'?", default=False,) return yesno(
f"Delete entry '{entry.pprint(short=True)}'?",
default=False,
)
for entry in self.entries: for entry in self.entries:
if ask_delete(entry): if ask_delete(entry):

View file

@ -276,10 +276,15 @@ def parse_args(args=[]):
help="Show only titles or line containing the search tags", help="Show only titles or line containing the search tags",
) )
exporting.add_argument( exporting.add_argument(
"-s", dest="short", action="store_true", help=argparse.SUPPRESS, "-s",
dest="short",
action="store_true",
help=argparse.SUPPRESS,
) )
exporting.add_argument( exporting.add_argument(
"-o", dest="filename", help=argparse.SUPPRESS, "-o",
dest="filename",
help=argparse.SUPPRESS,
) )
# Handle '-123' as a shortcut for '-n 123' # Handle '-123' as a shortcut for '-n 123'

View file

@ -29,7 +29,8 @@ def configure_logger(debug=False):
return return
logging.basicConfig( logging.basicConfig(
level=logging.DEBUG, format="%(levelname)-8s %(name)-12s %(message)s", level=logging.DEBUG,
format="%(levelname)-8s %(name)-12s %(message)s",
) )
logging.getLogger("parsedatetime").setLevel(logging.INFO) logging.getLogger("parsedatetime").setLevel(logging.INFO)
logging.getLogger("keyring.backend").setLevel(logging.ERROR) logging.getLogger("keyring.backend").setLevel(logging.ERROR)

View file

@ -48,7 +48,12 @@ default_config = {
"highlight": True, "highlight": True,
"linewrap": 79, "linewrap": 79,
"indent_character": "|", "indent_character": "|",
"colors": {"date": "none", "title": "none", "body": "none", "tags": "none",}, "colors": {
"date": "none",
"title": "none",
"body": "none",
"tags": "none",
},
} }

View file

@ -182,7 +182,8 @@ def _get_editor_template(config, **kwargs):
except OSError: except OSError:
logging.error("Write mode: template not loaded") logging.error("Write mode: template not loaded")
print( print(
f"[Could not read template at '{config['template']}']", file=sys.stderr, f"[Could not read template at '{config['template']}']",
file=sys.stderr,
) )
sys.exit(1) sys.exit(1)

696
poetry.lock generated

File diff suppressed because it is too large Load diff

View file

@ -17,7 +17,7 @@ repository = "https://github.com/jrnl-org/jrnl"
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = ">=3.7.0, <3.10.0" python = ">=3.7.0, <3.10.0"
pyxdg = "^0.26.0" pyxdg = "^0.27.0"
cryptography = "^3.0" cryptography = "^3.0"
passlib = "^1.7" passlib = "^1.7"
parsedatetime = "^2.4" parsedatetime = "^2.4"
@ -34,10 +34,10 @@ packaging = "^20.4"
[tool.poetry.dev-dependencies] [tool.poetry.dev-dependencies]
behave = "^1.2" behave = "^1.2"
mkdocs = "^1.0" mkdocs = "^1.0"
black = {version = "^19.10b0",allow-prereleases = true} black = {version = "^20.8b1",allow-prereleases = true}
toml = "^0.10.0" toml = "^0.10.0"
pyflakes = "^2.2.0" pyflakes = "^2.2.0"
pytest = "^5.4.3" pytest = "^6.1.2"
yq = "^2.11.1" yq = "^2.11.1"
[tool.poetry.scripts] [tool.poetry.scripts]

View file

@ -94,7 +94,11 @@ def test_not_multiple_alone():
@pytest.mark.parametrize( @pytest.mark.parametrize(
"cli", "cli",
["two -not one -not three", "-not one two -not three", "-not one -not three two",], [
"two -not one -not three",
"-not one two -not three",
"-not one -not three two",
],
) )
def test_not_mixed(cli): def test_not_mixed(cli):
result = expected_args(excluded=["one", "three"], text=["two"]) result = expected_args(excluded=["one", "three"], text=["two"])

View file

@ -10,10 +10,13 @@ def test_default_hour_is_added():
def test_default_minute_is_added(): def test_default_minute_is_added():
assert time.parse( assert (
"2020-06-20", time.parse(
inclusive=False, "2020-06-20",
default_hour=0, inclusive=False,
default_minute=30, default_hour=0,
bracketed=False, default_minute=30,
) == datetime.datetime(2020, 6, 20, 0, 30) bracketed=False,
)
== datetime.datetime(2020, 6, 20, 0, 30)
)