Commit 1e2ab5d9 by Sébastien Eustace

Merge branch 'fix-warnings' of https://github.com/BoboTiG/poetry into BoboTiG-fix-warnings

parents 81834732 35ab0821
...@@ -132,13 +132,13 @@ class Installer: ...@@ -132,13 +132,13 @@ class Installer:
CURRENT_PYTHON = sys.executable CURRENT_PYTHON = sys.executable
METADATA_URL = "https://pypi.org/pypi/poetry/json" METADATA_URL = "https://pypi.org/pypi/poetry/json"
VERSION_REGEX = re.compile( VERSION_REGEX = re.compile(
"v?(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:\.(\d+))?" r"v?(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:\.(\d+))?"
"(" "("
"[._-]?" "[._-]?"
"(?:(stable|beta|b|RC|alpha|a|patch|pl|p)((?:[.-]?\d+)*)?)?" r"(?:(stable|beta|b|RC|alpha|a|patch|pl|p)((?:[.-]?\d+)*)?)?"
"([.-]?dev)?" "([.-]?dev)?"
")?" ")?"
"(?:\+[^\s]+)?" r"(?:\+[^\s]+)?"
) )
def __init__(self, version=None, preview=False): def __init__(self, version=None, preview=False):
......
...@@ -148,12 +148,12 @@ class Application(BaseApplication): ...@@ -148,12 +148,12 @@ class Application(BaseApplication):
formatter = o.get_formatter() formatter = o.get_formatter()
lines = [] lines = []
for line in re.split("\r?\n", str(e)): for line in re.split(r"\r?\n", str(e)):
for splitline in [ for splitline in [
line[x : x + (width - 4)] for x in range(0, len(line), width - 4) line[x : x + (width - 4)] for x in range(0, len(line), width - 4)
]: ]:
line_length = ( line_length = (
len(re.sub(r"\[[^m]*m", "", formatter.format(splitline))) + 4 len(re.sub(r"\[[^m]*m", "", formatter.format(splitline))) + 4
) )
lines.append((splitline, line_length)) lines.append((splitline, line_length))
......
...@@ -6,7 +6,7 @@ from .constraint import Constraint ...@@ -6,7 +6,7 @@ from .constraint import Constraint
class WilcardConstraint(Constraint): class WilcardConstraint(Constraint):
def __init__(self, constraint): # type: (str) -> None def __init__(self, constraint): # type: (str) -> None
m = re.match( m = re.match(
"^(!= ?|==)?v?(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:\.[xX*])+$", constraint r"^(!= ?|==)?v?(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:\.[xX*])+$", constraint
) )
if not m: if not m:
raise ValueError("Invalid value for wildcard constraint") raise ValueError("Invalid value for wildcard constraint")
......
...@@ -84,8 +84,8 @@ def user_data_dir(appname, roaming=False): ...@@ -84,8 +84,8 @@ def user_data_dir(appname, roaming=False):
...Application Data\<AppName> ...Application Data\<AppName>
Win XP (roaming): C:\Documents and Settings\<username>\Local ... Win XP (roaming): C:\Documents and Settings\<username>\Local ...
...Settings\Application Data\<AppName> ...Settings\Application Data\<AppName>
Win 7 (not roaming): C:\\Users\<username>\AppData\Local\<AppName> Win 7 (not roaming): C:\Users\<username>\AppData\Local\<AppName>
Win 7 (roaming): C:\\Users\<username>\AppData\Roaming\<AppName> Win 7 (roaming): C:\Users\<username>\AppData\Roaming\<AppName>
For Unix, we follow the XDG spec and support $XDG_DATA_HOME. For Unix, we follow the XDG spec and support $XDG_DATA_HOME.
That means, by default "~/.local/share/<AppName>". That means, by default "~/.local/share/<AppName>".
......
...@@ -73,7 +73,7 @@ def test_wheel_c_extension(): ...@@ -73,7 +73,7 @@ def test_wheel_c_extension():
Wheel-Version: 1.0 Wheel-Version: 1.0
Generator: poetry {} Generator: poetry {}
Root-Is-Purelib: false Root-Is-Purelib: false
Tag: cp[23]\d-cp[23]\dmu?-.+ Tag: cp[23]\\d-cp[23]\\dmu?-.+
$""".format( $""".format(
__version__ __version__
), ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment