@@ -29,7 +29,7 @@ def get_version_from_arguments(session: Session) -> Optional[str]:
29
29
# https://github.com/theacodes/nox/pull/378
30
30
os .path .join (session .bin , "python" ), # type: ignore
31
31
"tools/release/check_version.py" ,
32
- version
32
+ version ,
33
33
]
34
34
not_ok = subprocess .run (cmd ).returncode
35
35
if not_ok :
@@ -47,8 +47,7 @@ def modified_files_in_git(*args: str) -> int:
47
47
48
48
49
49
def get_author_list () -> List [str ]:
50
- """Get the list of authors from Git commits.
51
- """
50
+ """Get the list of authors from Git commits."""
52
51
# subprocess because session.run doesn't give us stdout
53
52
# only use names in list of Authors
54
53
result = subprocess .run (
@@ -103,13 +102,16 @@ def update_version_file(version: str, filepath: str) -> None:
103
102
else :
104
103
f .write (line )
105
104
106
- assert file_modified , \
107
- f"Version file { filepath } did not get modified"
105
+ assert file_modified , f"Version file { filepath } did not get modified"
108
106
109
107
110
108
def create_git_tag (session : Session , tag_name : str , * , message : str ) -> None :
111
109
session .run (
112
- "git" , "tag" , "-m" , message , tag_name , external = True , silent = True ,
110
+ # fmt: off
111
+ "git" , "tag" , "-m" , message , tag_name ,
112
+ # fmt: on
113
+ external = True ,
114
+ silent = True ,
113
115
)
114
116
115
117
@@ -148,8 +150,8 @@ def have_files_in_folder(folder_name: str) -> bool:
148
150
149
151
@contextlib .contextmanager
150
152
def workdir (
151
- nox_session : Session ,
152
- dir_path : pathlib .Path ,
153
+ nox_session : Session ,
154
+ dir_path : pathlib .Path ,
153
155
) -> Iterator [pathlib .Path ]:
154
156
"""Temporarily chdir when entering CM and chdir back on exit."""
155
157
orig_dir = pathlib .Path .cwd ()
@@ -164,35 +166,42 @@ def workdir(
164
166
165
167
@contextlib .contextmanager
166
168
def isolated_temporary_checkout (
167
- nox_session : Session ,
168
- target_ref : str ,
169
+ nox_session : Session ,
170
+ target_ref : str ,
169
171
) -> Iterator [pathlib .Path ]:
170
172
"""Make a clean checkout of a given version in tmp dir."""
171
173
with tempfile .TemporaryDirectory () as tmp_dir_path :
172
174
tmp_dir = pathlib .Path (tmp_dir_path )
173
- git_checkout_dir = tmp_dir / f' pip-build-{ target_ref } '
175
+ git_checkout_dir = tmp_dir / f" pip-build-{ target_ref } "
174
176
nox_session .run (
175
- 'git' , 'worktree' , 'add' , '--force' , '--checkout' ,
177
+ # fmt: off
178
+ "git" , "worktree" , "add" , "--force" , "--checkout" ,
176
179
str (git_checkout_dir ), str (target_ref ),
177
- external = True , silent = True ,
180
+ # fmt: on
181
+ external = True ,
182
+ silent = True ,
178
183
)
179
184
180
185
try :
181
186
yield git_checkout_dir
182
187
finally :
183
188
nox_session .run (
184
- 'git' , 'worktree' , 'remove' , '--force' ,
185
- str (git_checkout_dir ),
186
- external = True , silent = True ,
189
+ # fmt: off
190
+ "git" , "worktree" , "remove" , "--force" , str (git_checkout_dir ),
191
+ # fmt: on
192
+ external = True ,
193
+ silent = True ,
187
194
)
188
195
189
196
190
197
def get_git_untracked_files () -> Iterator [str ]:
191
198
"""List all local file paths that aren't tracked by Git."""
192
199
git_ls_files_cmd = (
200
+ # fmt: off
193
201
"git" , "ls-files" ,
194
202
"--ignored" , "--exclude-standard" ,
195
203
"--others" , "--" , "." ,
204
+ # fmt: on
196
205
)
197
206
# session.run doesn't seem to return any output:
198
207
ls_files_out = subprocess .check_output (git_ls_files_cmd , text = True )
0 commit comments