pytest-split 0.8.2__py3-none-any.whl → 0.9.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -51,12 +51,12 @@ def least_duration(
51
51
  items_with_durations_indexed, key=lambda tup: tup[1], reverse=True
52
52
  )
53
53
 
54
- selected: "List[List[Tuple[nodes.Item, int]]]" = [[] for _ in range(splits)]
55
- deselected: "List[List[nodes.Item]]" = [[] for _ in range(splits)]
56
- duration: "List[float]" = [0 for _ in range(splits)]
54
+ selected: List[List[Tuple[nodes.Item, int]]] = [[] for _ in range(splits)]
55
+ deselected: List[List[nodes.Item]] = [[] for _ in range(splits)]
56
+ duration: List[float] = [0 for _ in range(splits)]
57
57
 
58
58
  # create a heap of the form (summed_durations, group_index)
59
- heap: "List[Tuple[float, int]]" = [(0, i) for i in range(splits)]
59
+ heap: List[Tuple[float, int]] = [(0, i) for i in range(splits)]
60
60
  heapq.heapify(heap)
61
61
  for item, item_duration, original_index in sorted_items_with_durations:
62
62
  # get group with smallest sum
@@ -102,9 +102,9 @@ def duration_based_chunks(
102
102
  items_with_durations = _get_items_with_durations(items, durations)
103
103
  time_per_group = sum(map(itemgetter(1), items_with_durations)) / splits
104
104
 
105
- selected: "List[List[nodes.Item]]" = [[] for i in range(splits)]
106
- deselected: "List[List[nodes.Item]]" = [[] for i in range(splits)]
107
- duration: "List[float]" = [0 for i in range(splits)]
105
+ selected: List[List[nodes.Item]] = [[] for i in range(splits)]
106
+ deselected: List[List[nodes.Item]] = [[] for i in range(splits)]
107
+ duration: List[float] = [0 for i in range(splits)]
108
108
 
109
109
  group_idx = 0
110
110
  for item, item_duration in items_with_durations:
@@ -6,7 +6,7 @@ if TYPE_CHECKING:
6
6
  from pytest_split.algorithms import TestGroup
7
7
 
8
8
 
9
- def ensure_ipynb_compatibility(group: "TestGroup", items: list) -> None:
9
+ def ensure_ipynb_compatibility(group: "TestGroup", items: list) -> None: # type: ignore[type-arg]
10
10
  """
11
11
  Ensures that group doesn't contain partial IPy notebook cells.
12
12
 
pytest_split/plugin.py CHANGED
@@ -15,7 +15,7 @@ if TYPE_CHECKING:
15
15
  from _pytest import nodes
16
16
  from _pytest.config import Config
17
17
  from _pytest.config.argparsing import Parser
18
- from _pytest.main import ExitCode
18
+ from _pytest.main import ExitCode # type: ignore[attr-defined]
19
19
 
20
20
 
21
21
  # Ugly hack for freezegun compatibility: https://github.com/spulec/freezegun/issues/286
@@ -193,9 +193,9 @@ class PytestSplitCachePlugin(Base):
193
193
  https://github.com/pytest-dev/pytest/blob/main/src/_pytest/main.py#L308
194
194
  """
195
195
  terminal_reporter = self.config.pluginmanager.get_plugin("terminalreporter")
196
- test_durations: "Dict[str, float]" = {}
196
+ test_durations: Dict[str, float] = {}
197
197
 
198
- for test_reports in terminal_reporter.stats.values():
198
+ for test_reports in terminal_reporter.stats.values(): # type: ignore[union-attr]
199
199
  for test_report in test_reports:
200
200
  if isinstance(test_report, TestReport):
201
201
  # These ifs be removed after this is solved: # https://github.com/spulec/freezegun/issues/286
@@ -224,8 +224,6 @@ class PytestSplitCachePlugin(Base):
224
224
  json.dump(self.cached_durations, f, sort_keys=True, indent=4)
225
225
 
226
226
  message = self.writer.markup(
227
- "\n\n[pytest-split] Stored test durations in {}".format(
228
- self.config.option.durations_path
229
- )
227
+ f"\n\n[pytest-split] Stored test durations in {self.config.option.durations_path}"
230
228
  )
231
229
  self.writer.line(message)
@@ -1,4 +1,4 @@
1
- Copyright (c) 2021 Jerry Pussinen
1
+ Copyright (c) 2024 Jerry Pussinen
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -1,25 +1,24 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pytest-split
3
- Version: 0.8.2
3
+ Version: 0.9.0
4
4
  Summary: Pytest plugin which splits the test suite to equally sized sub suites based on test execution time.
5
5
  Home-page: https://jerry-git.github.io/pytest-split
6
6
  License: MIT
7
7
  Keywords: pytest,plugin,split,tests
8
8
  Author: Jerry Pussinen
9
9
  Author-email: jerry.pussinen@gmail.com
10
- Requires-Python: >=3.7.1,<4.0
10
+ Requires-Python: >=3.8.1,<4.0
11
11
  Classifier: Development Status :: 4 - Beta
12
12
  Classifier: Intended Audience :: Developers
13
13
  Classifier: License :: OSI Approved :: MIT License
14
14
  Classifier: Operating System :: OS Independent
15
15
  Classifier: Programming Language :: Python
16
16
  Classifier: Programming Language :: Python :: 3
17
- Classifier: Programming Language :: Python :: 3.8
18
17
  Classifier: Programming Language :: Python :: 3.9
19
18
  Classifier: Programming Language :: Python :: 3.10
20
19
  Classifier: Programming Language :: Python :: 3.11
21
20
  Classifier: Programming Language :: Python :: 3.12
22
- Classifier: Programming Language :: Python :: 3.7
21
+ Classifier: Programming Language :: Python :: 3.8
23
22
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
23
  Classifier: Typing :: Typed
25
24
  Requires-Dist: pytest (>=5,<9)
@@ -125,7 +124,7 @@ The `least_duration` algorithm walks the list of tests and assigns each test to
125
124
  * Clone this repository
126
125
  * Requirements:
127
126
  * [Poetry](https://python-poetry.org/)
128
- * Python 3.7+
127
+ * Python 3.8+
129
128
  * Create a virtual environment and install the dependencies
130
129
 
131
130
  ```sh
@@ -146,9 +145,8 @@ pytest
146
145
 
147
146
  ### Documentation
148
147
 
149
- The documentation is automatically generated from the content of the [docs directory](./docs) and from the docstrings
150
- of the public signatures of the source code. The documentation is updated and published as a [Github project page
151
- ](https://pages.github.com/) automatically as part each release.
148
+ The documentation is automatically generated from the content of the [docs directory](https://github.com/jerry-git/pytest-split/tree/master/docs) and from the docstrings
149
+ of the public signatures of the source code. The documentation is updated and published as a [Github Pages page](https://pages.github.com/) automatically as part each release.
152
150
 
153
151
  ### Releasing
154
152
 
@@ -162,7 +160,7 @@ Find the draft release from the
162
160
 
163
161
  ### Pre-commit
164
162
 
165
- Pre-commit hooks run all the auto-formatters (e.g. `black`), linters (e.g. `mypy`, `ruff`), and other quality
163
+ Pre-commit hooks run all the auto-formatting (`ruff format`), linters (e.g. `ruff` and `mypy`), and other quality
166
164
  checks to make sure the changeset is in good shape before a commit/push happens.
167
165
 
168
166
  You can install the hooks with (runs for each commit):
@@ -0,0 +1,11 @@
1
+ pytest_split/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ pytest_split/algorithms.py,sha256=4rNNyPzZskHgorFsGId_XHi2MzjkyZ1Lj8_TZD4B60k,6112
3
+ pytest_split/cli.py,sha256=_Cc3h5jwOJyX7NZT4yil_ymG0g6Rw0257gh_63VoqzE,1011
4
+ pytest_split/ipynb_compatibility.py,sha256=zBul7z3mB3UgM03IppqFpTZTdb2Vj1NrqxRC0kAgrCw,2104
5
+ pytest_split/plugin.py,sha256=z3dTS3rK0wI2bj62Yw2O3y8120UfMiWnc6CJJyig-0k,7857
6
+ pytest_split/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ pytest_split-0.9.0.dist-info/LICENSE,sha256=mMm6KABGgOUinR1qBjELBaTHOU91sKkaWnprZ0RBilU,1058
8
+ pytest_split-0.9.0.dist-info/METADATA,sha256=IieeBEBthWLh2UzL7NkPRJZp0zoP-mIXjparUiVv-gQ,9480
9
+ pytest_split-0.9.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
10
+ pytest_split-0.9.0.dist-info/entry_points.txt,sha256=TQBEnYSUICZtzsc1CUyiYrOHpEll6HBDzIFvjJyo9F8,114
11
+ pytest_split-0.9.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.8.1
2
+ Generator: poetry-core 1.9.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,11 +0,0 @@
1
- LICENCE,sha256=9Enb-O6zwCRmtxw3bGyfdFDKjy5LgMj-GIIMb1VXrRY,1058
2
- pytest_split/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- pytest_split/algorithms.py,sha256=-lLVwVQ2BqIjqzPP7U1GH5q4crytODq0LPwNewAwEcY,6126
4
- pytest_split/cli.py,sha256=_Cc3h5jwOJyX7NZT4yil_ymG0g6Rw0257gh_63VoqzE,1011
5
- pytest_split/ipynb_compatibility.py,sha256=G4TxNU7FA0vdlRaAbDJGrM4Sq3n0p2gEVad-piAjnUs,2078
6
- pytest_split/plugin.py,sha256=YSO4WTfH6o_Br0lFjIxzsmT4__iWyuQfRmAfScGrhsY,7839
7
- pytest_split/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- pytest_split-0.8.2.dist-info/METADATA,sha256=QvAaHZ3glRAHn6hoJNjg8YZBeN0_ahpraeKRMxXKmNk,9478
9
- pytest_split-0.8.2.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
10
- pytest_split-0.8.2.dist-info/entry_points.txt,sha256=TQBEnYSUICZtzsc1CUyiYrOHpEll6HBDzIFvjJyo9F8,114
11
- pytest_split-0.8.2.dist-info/RECORD,,