|
13 | 13 | """ |
14 | 14 |
|
15 | 15 | import dataclasses as _dataclasses |
16 | | -import itertools as _itertools |
17 | 16 | from typing import Self, assert_never, overload |
18 | 17 |
|
19 | 18 | import nox as _nox |
@@ -147,44 +146,6 @@ def path_args( |
147 | 146 |
|
148 | 147 | return list(str(p) for p in _util.existing_paths(paths)) |
149 | 148 |
|
150 | | - def package_args(self, session: _nox.Session, /) -> list[str]: |
151 | | - """Return the package names to run the checks on. |
152 | | -
|
153 | | - If positional arguments are present in the nox session, those are used |
154 | | - as the file paths verbatim, and if not, all **existing** `source_paths` |
155 | | - are searched for python packges by looking for `__init__.py` files. |
156 | | - `extra_paths` are used as is, only converting the paths to python |
157 | | - package names (replacing `/` with `.` and removing the suffix `.pyi?` |
158 | | - if it exists. |
159 | | -
|
160 | | - Args: |
161 | | - session: The nox session to use to look for command-line arguments. |
162 | | -
|
163 | | - Returns: |
164 | | - The package names found in the `source_paths`. |
165 | | - """ |
166 | | - if session.posargs: |
167 | | - return session.posargs |
168 | | - |
169 | | - sources_package_dirs_with_roots = ( |
170 | | - (p, _util.find_toplevel_package_dirs(p)) |
171 | | - for p in _util.existing_paths(self.source_paths) |
172 | | - ) |
173 | | - |
174 | | - source_packages = ( |
175 | | - _util.path_to_package(pkg_path, root=root) |
176 | | - for root, pkg_paths in sources_package_dirs_with_roots |
177 | | - for pkg_path in pkg_paths |
178 | | - ) |
179 | | - |
180 | | - extra_packages = ( |
181 | | - _util.path_to_package(p) for p in _util.existing_paths(self.extra_paths) |
182 | | - ) |
183 | | - |
184 | | - return list( |
185 | | - _util.deduplicate(_itertools.chain(source_packages, extra_packages)) |
186 | | - ) |
187 | | - |
188 | 149 |
|
189 | 150 | _config: Config | None = None |
190 | 151 | """The global configuration object.""" |
|
0 commit comments