Skip to content
This repository has been archived by the owner on Dec 18, 2022. It is now read-only.

Commit

Permalink
Merge pull request #12 from MousaZeidBaker/regex
Browse files Browse the repository at this point in the history
Update regex pattern and compile before matching
  • Loading branch information
MousaZeidBaker authored Oct 14, 2021
2 parents 91f695c + 1615601 commit 1d5025f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "poetryup"
version = "0.3.6"
version = "0.3.7"
description = "Update dependencies and bump their version in the pyproject.toml file"
authors = ["Mousa Zeid Baker"]
packages = [
Expand Down
3 changes: 2 additions & 1 deletion src/poetryup/poetryup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ def _list_dependencies() -> List[Dependency]:

output = _run_poetry_show()

pattern = re.compile("^[a-zA-Z-]+")
dependencies: List[Dependency] = []
for line in output.split("\n"):
if re.match("^[a-zA-Z]+", line) is not None:
if pattern.match(line) is not None:
name, version, *_ = line.split()
dependency = Dependency(name=name, version=version)
dependencies.append(dependency)
Expand Down

0 comments on commit 1d5025f

Please sign in to comment.