10000 constnats(RE_PIP_REV): git -> constants · vcs-python/libvcs@acdba10 · GitHub
[go: up one dir, main page]

Skip to content

Commit acdba10

Browse files
committed
constnats(RE_PIP_REV): git -> constants
1 parent 38eec9f commit acdba10

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

src/libvcs/url/constants.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,11 @@
1818
(?P<path>(\w[^:.]+))
1919
"""
2020
"""Regular expression for scp-style of git URLs."""
21+
22+
#
23+
# Third-party URLs, e.g. npm, pip, etc.
24+
#
25+
RE_PIP_REV = r"""
26+
(@(?P<rev>.*))
27+
"""
28+
"""Pip-style revision for branch or revision."""

src/libvcs/url/git.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from libvcs._internal.dataclasses import SkipDefaultFieldsReprMixin
2424

2525
from .base import Rule, RuleMap, URLProtocol
26-
from .constants import RE_SCP, RE_USER
26+
from .constants import RE_PIP_REV, RE_SCP, RE_USER
2727

2828
RE_PATH = r"""
2929
(?P<hostname>([^/:]+))
@@ -108,10 +108,6 @@
108108
)
109109
"""
110110

111-
RE_PIP_REV = r"""
112-
(@(?P<rev>.*))
113-
"""
114-
115111
PIP_DEFAULT_RULES: list[Rule] = [
116112
Rule(
117113
label="pip-url",

src/libvcs/url/hg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
from typing import Optional
2323

2424
from libvcs._internal.dataclasses import SkipDefaultFieldsReprMixin
25-
from libvcs.url.git import RE_PIP_REV, RE_SUFFIX
25+
from libvcs.url.git import RE_SUFFIX
2626

2727
from .base import Rule, RuleMap, URLProtocol
28-
from .constants import RE_SCP, RE_USER
28+
from .constants import RE_PIP_REV, RE_SCP, RE_USER
2929

3030
RE_PATH = r"""
3131
(?P<hostname>([^/:]+))

src/libvcs/url/svn.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@
2323
from typing import Optional
2424

2525
from libvcs._internal.dataclasses import SkipDefaultFieldsReprMixin
26-
from libvcs.url.git import RE_PIP_REV
2726

2827
from .base import Rule, RuleMap, URLProtocol
29-
from .constants import RE_SCP, RE_USER
28+
from .constants import RE_PIP_REV, RE_SCP, RE_USER
3029

3130
RE_PATH = r"""
3231
(?P<hostname>([^/:@]+))

0 commit comments

Comments
 (0)
0