Skip to content

Commit 0c981d3

Browse files
fix and update packaging
* drop empty setup.py which "breaks" on incomplete build envs * use the build package to build the dist * update the gh workflow to use it fixup noise from pre-commit
1 parent 31e80c8 commit 0c981d3

File tree

8 files changed

+10
-14
lines changed

8 files changed

+10
-14
lines changed

.github/workflows/main.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ jobs:
7070
- name: Install wheel
7171
run: |
7272
python -m pip install --upgrade pip
73-
pip install wheel
73+
pip install build
7474
- name: Build package
7575
run: |
76-
python setup.py sdist bdist_wheel
76+
python -m build
7777
- name: Publish package to PyPI
78-
uses: pypa/gh-action-pypi-publish@master
78+
uses: pypa/gh-action-pypi-publish@release/v1
7979
with:
8080
user: __token__
8181
password: ${{ secrets.pypi_token }}

changelog/812.feature

-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ the fixture, the fixture was created only once.
1919
So restore the old behavior for typical cases where the number of tests is
2020
much greater than the number of workers (or, strictly speaking, when there
2121
are at least 2 tests for every node).
22-

pyproject.toml

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[build-system]
22
requires = [
3-
# sync with setup.py until we discard non-pep-517/518
43
"setuptools>=45.0",
54
"setuptools-scm[toml]>=6.2.3",
65
"wheel",

setup.cfg

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ python_requires = >=3.6
4444
install_requires =
4545
execnet>=1.1
4646
pytest>=6.2.0
47-
setup_requires = # left empty, enforce using isolated build system
4847

4948
[options.packages.find]
5049
where = src

setup.py

-4
This file was deleted.

src/xdist/plugin.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ def pytest_xdist_auto_num_workers(config):
1818
try:
1919
return int(env_var)
2020
except ValueError:
21-
warnings.warn("PYTEST_XDIST_AUTO_NUM_WORKERS is not a number: {env_var!r}. Ignoring it.")
21+
warnings.warn(
22+
"PYTEST_XDIST_AUTO_NUM_WORKERS is not a number: {env_var!r}. Ignoring it."
23+
)
2224

2325
try:
2426
import psutil

src/xdist/remote.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class Producer:
2828
"""
2929
Simplified implementation of the same interface as py.log, for backward compatibility
3030
since we dropped the dependency on pylib.
31-
Note: this is defined here because this module can't depend on xdist, so we need
32-
to have the other way around.
31+
Note: this is defined here because this module can't depend on xdist, so we need
32+
to have the other way around.
3333
"""
3434

3535
def __init__(self, name: str, *, enabled: bool = True):

testing/test_plugin.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
@pytest.fixture
1313
def monkeypatch_3_cpus(monkeypatch: pytest.MonkeyPatch):
1414
"""Make pytest-xdist believe the system has 3 CPUs"""
15-
monkeypatch.setitem(sys.modules, "psutil", None) # block import
15+
# block import
16+
monkeypatch.setitem(sys.modules, "psutil", None) # type: ignore
1617
monkeypatch.delattr(os, "sched_getaffinity", raising=False)
1718
monkeypatch.setattr(os, "cpu_count", lambda: 3)
1819

0 commit comments

Comments
 (0)