Skip to content

Commit 84ec4a3

Browse files
committed
Fixing some review remarks
1 parent 8c537e9 commit 84ec4a3

File tree

5 files changed

+15
-18
lines changed

5 files changed

+15
-18
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- PYTHON=C:\\Python36\\python
4040

4141
- &linux_s390x_36
42-
name: Linux | s390x | Python 365
42+
name: Linux | s390x | Python 3.6
4343
language: python
4444
python: 3.6
4545
services: docker

CI.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
This is a summary of the Python versions and platforms covered by the different CI platforms:
22

3-
| | 3.6 | 3.7 | 3.8 |
4-
|----------|------------------------------|---------------------------------------------------|------------------|
5-
| Linux | Travis CI / CircleCI | AppVeyor / GitHub Actions | Azure Pipelines |
3+
| | 3.6 | 3.7 | 3.8 |
4+
|----------|------------------------------|----------------------------------------------------|------------------|
5+
| Linux | Travis CI / CircleCI | AppVeyor / GitHub Actions | Azure Pipelines |
66
| macOS | CircleCI | AppVeyor / Travis CI¹ / CircleCI / GitHub Actions | Azure Pipelines |
7-
| Windows | Travis CI / Azure Pipelines | AppVeyor / GitHub Actions | Azure Pipelines |
7+
| Windows | Travis CI / Azure Pipelines | AppVeyor / GitHub Actions | Azure Pipelines |
88

99
> ¹ Python version not really pinned, but dependent on the (default) version of image used.
1010

cibuildwheel/bashlex_eval.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import shlex
22
import subprocess
33

4-
from typing import Dict, List, NamedTuple, Optional
4+
from typing import Dict, NamedTuple
55

66
import bashlex # type: ignore
77

@@ -45,20 +45,20 @@ def evaluate_word_node(node: bashlex.ast.node, context: NodeExecutionContext) ->
4545
word_start = node.pos[0]
4646
word_end = node.pos[1]
4747
word_string = context.input[word_start:word_end]
48-
letters: List[Optional[str]] = list(word_string)
48+
letters = list(word_string)
4949

5050
for part in node.parts:
5151
part_start = part.pos[0] - word_start
5252
part_end = part.pos[1] - word_start
5353

5454
# Set all the characters in the part to None
5555
for i in range(part_start, part_end):
56-
letters[i] = None
56+
letters[i] = ''
5757

5858
letters[part_start] = evaluate_node(part, context=context)
5959

6060
# remove the None letters and concat
61-
value = ''.join(l for l in letters if l is not None)
61+
value = ''.join(letters)
6262

6363
# apply bash-like quotes/whitespace treatment
6464
return ' '.join(word.strip() for word in shlex.split(value))

cibuildwheel/util.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from fnmatch import fnmatch
44
from time import sleep
55

6-
from typing import Dict, List, NamedTuple, Optional, Type, TypeVar
6+
from typing import Dict, List, NamedTuple, Optional
77

88
from .environment import ParsedEnvironment
99

@@ -82,17 +82,14 @@ def download(url: str, dest: str) -> None:
8282
response.close()
8383

8484

85-
DependencyConstraints_T = TypeVar('DependencyConstraints_T', bound='DependencyConstraints')
86-
87-
8885
class DependencyConstraints:
8986
def __init__(self, base_file_path: str):
9087
assert os.path.exists(base_file_path)
9188
self.base_file_path = os.path.abspath(base_file_path)
9289

93-
@classmethod
94-
def with_defaults(cls: Type[DependencyConstraints_T]) -> DependencyConstraints_T:
95-
return cls(
90+
@staticmethod
91+
def with_defaults() -> 'DependencyConstraints':
92+
return DependencyConstraints(
9693
base_file_path=os.path.join(os.path.dirname(__file__), 'resources', 'constraints.txt')
9794
)
9895

cibuildwheel/windows.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,8 @@ def install_cpython(version: str, arch: str, nuget: str) -> str:
8282
return installation_path
8383

8484

85-
def install_pypy(version: str, arch: str, url: Optional[str]) -> str:
85+
def install_pypy(version: str, arch: str, url: str) -> str:
8686
assert arch == '32'
87-
assert url is not None
8887
# Inside the PyPy zip file is a directory with the same name
8988
zip_filename = url.rsplit('/', 1)[-1]
9089
installation_path = os.path.join('C:\\cibw', os.path.splitext(zip_filename)[0])
@@ -107,6 +106,7 @@ def setup_python(python_configuration: PythonConfiguration, dependency_constrain
107106
if python_configuration.identifier.startswith('cp'):
108107
installation_path = install_cpython(python_configuration.version, python_configuration.arch, nuget)
109108
elif python_configuration.identifier.startswith('pp'):
109+
assert python_configuration.url is not None
110110
installation_path = install_pypy(python_configuration.version, python_configuration.arch, python_configuration.url)
111111
else:
112112
raise ValueError("Unknown Python implementation")

0 commit comments

Comments
 (0)