Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (python-poetry#278)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 21.12b0 → 22.1.0](psf/black@21.12b0...22.1.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Feb 3, 2022
1 parent 3bdd0cf commit 770a0ec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ repos:
)
- repo: https://github.com/psf/black
rev: 21.12b0
rev: 22.1.0
hooks:
- id: black

Expand Down
10 changes: 5 additions & 5 deletions src/poetry/core/semver/patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
)

_COMPLETE_VERSION = (
fr"v?(?:\d+!)?(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:\.(\d+))?{MODIFIERS}(?:\+[^\s]+)?"
rf"v?(?:\d+!)?(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:\.(\d+))?{MODIFIERS}(?:\+[^\s]+)?"
)

COMPLETE_VERSION = re.compile("(?i)" + _COMPLETE_VERSION)

CARET_CONSTRAINT = re.compile(fr"(?i)^\^({_COMPLETE_VERSION})$")
TILDE_CONSTRAINT = re.compile(fr"(?i)^~(?!=)\s*({_COMPLETE_VERSION})$")
TILDE_PEP440_CONSTRAINT = re.compile(fr"(?i)^~=\s*({_COMPLETE_VERSION})$")
CARET_CONSTRAINT = re.compile(rf"(?i)^\^({_COMPLETE_VERSION})$")
TILDE_CONSTRAINT = re.compile(rf"(?i)^~(?!=)\s*({_COMPLETE_VERSION})$")
TILDE_PEP440_CONSTRAINT = re.compile(rf"(?i)^~=\s*({_COMPLETE_VERSION})$")
X_CONSTRAINT = re.compile(r"^(!=|==)?\s*v?(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:\.[xX*])+$")
BASIC_CONSTRAINT = re.compile(fr"(?i)^(<>|!=|>=?|<=?|==?)?\s*({_COMPLETE_VERSION}|dev)")
BASIC_CONSTRAINT = re.compile(rf"(?i)^(<>|!=|>=?|<=?|==?)?\s*({_COMPLETE_VERSION}|dev)")
4 changes: 2 additions & 2 deletions src/poetry/core/vcs/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,11 @@ def normalize_url(cls, url: str) -> GitUrl:

formatted = re.sub(r"^git\+", "", url)
if parsed.rev:
formatted = re.sub(fr"[#@]{parsed.rev}$", "", formatted)
formatted = re.sub(rf"[#@]{parsed.rev}$", "", formatted)

if parsed.subdirectory:
formatted = re.sub(
fr"[#&]subdirectory={parsed.subdirectory}$", "", formatted
rf"[#&]subdirectory={parsed.subdirectory}$", "", formatted
)

altered = parsed.format() != formatted
Expand Down

0 comments on commit 770a0ec

Please sign in to comment.