Skip to content

Commit

Permalink
Merge pull request #96 from jacebrowning/handle-asdf
Browse files Browse the repository at this point in the history
Handle asdf error messages
  • Loading branch information
jacebrowning committed Sep 15, 2023
2 parents 37cc8fd + 1f57300 commit 45904b1
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 19 deletions.
61 changes: 50 additions & 11 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,53 @@
{
"files.exclude": {
".cache/": true,
".venv/": true,
"*.egg-info": true,
"pip-wheel-metadata/": true,
"**/__pycache__": true,
"**/*.pyc": true,
"**/.ipynb_checkpoints": true,
"**/tmp/": true,
"dist/": true,
"htmlcov/": true,
"notebooks/*.yml": true,
"notebooks/files/": true,
"notebooks/inventory/": true,
"prof/": true,
"site/": true,
"geckodriver.log": true,
"targets.log": true,
"bin/verchew": true
},
"python.defaultInterpreterPath": ".venv/bin/python",
"editor.formatOnSave": true,
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.linting.pylintArgs": ["--rcfile", ".pylint.ini"],
"python.linting.mypyEnabled": true,
"python.linting.mypyArgs": ["--config-file", ".mypy.ini"],
"python.linting.pydocstyleEnabled": true,
"python.formatting.provider": "black",
"python.formatting.blackPath": ".venv/bin/black",
"cSpell.words": [
"ANSICON",
"codehilite",
"DIRENV",
"embeddable",
"mkdocs",
"pipx",
"printenv",
"pyenv",
"USERPROFILE",
"verchewrc"
"asdf",
"builtins",
"codecov",
"codehilite",
"cygstart",
"cygwin",
"dataclasses",
"DIRENV",
"Graphviz",
"ipython",
"mkdocs",
"noclasses",
"pipx",
"printenv",
"pyenv",
"ruamel",
"showfspath",
"venv",
"verchew"
]
}
}
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Release Notes

## 3.4.1 (2022-06-13)
## 3.4.2 (2023-09-15)

- Fixed handling of `asdf` "not found" error messages.

## 3.4.1 (2023-06-13)

- Fixed handling of programs with no output.

Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
jinja2==3.0.3 ; python_version >= "3.8" and python_version < "4.0"
markdown==3.3.6 ; python_version >= "3.8" and python_version < "4.0"
mkdocs==1.5.1 ; python_version >= "3.8" and python_version < "4.0"
pygments==2.7.4 ; python_version >= "3.8" and python_version < "4.0"
pygments==2.15.0 ; python_version >= "3.8" and python_version < "4.0"
importlib-metadata==4.8.3 ; python_version >= "3.8" and python_version < "3.10"
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
[tool.poetry]

name = "verchew"
version = "3.4.1" # also update verchew/script.py
description = "System dependency version checker."

license = "MIT"
version = "3.4.2" # also update verchew/script.py

description = "System dependency version checker."
authors = ["Jace Browning <jacebrowning@gmail.com>"]

license = "MIT"
readme = "README.md"

homepage = "https://pypi.org/project/verchew"
Expand Down
8 changes: 6 additions & 2 deletions verchew/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import configparser
from urllib.request import urlretrieve

__version__ = "3.4.1"
__version__ = "3.4.2"

SCRIPT_URL = (
"https://raw.githubusercontent.com/jacebrowning/verchew/main/verchew/script.py"
Expand Down Expand Up @@ -308,7 +308,11 @@ def get_version(program, argument=None):

def match_version(pattern, output):
lines = output.splitlines()
if not lines or "not found" in lines[0]:
if not lines:
return False
if "not found" in lines[0]:
return False
if re.match(r"No .+ executable found", " ".join(lines)):
return False

regex = pattern.replace(".", r"\.") + r"(\b|/)"
Expand Down
5 changes: 5 additions & 0 deletions verchew/tests/test_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@ def when_mismatch_with_missing_program():
expect(match_version("", "program not found")) == False
expect(match_version("", "v1.2.3\nother not found")) == True

def when_mismatch_with_missing_program_from_asdf():
expect(
match_version("1.4.2", "No poetry executable found for poetry 1.4.2")
) == False

def when_match_with_multiple_lines():
expect(match_version("1.2", "Foobar\nVersion 1.2.3")) == True

Expand Down

0 comments on commit 45904b1

Please sign in to comment.