diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 384426517..d939c9171 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,70 +59,70 @@ jobs: mv dist/psutil*.tar.gz wheelhouse/ # Linux + macOS + Python 2 - py2: - name: py2-${{ matrix.os }} - runs-on: ${{ matrix.os }} - timeout-minutes: 20 - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-12] - env: - CIBW_TEST_COMMAND: - PYTHONWARNINGS=always PYTHONUNBUFFERED=1 PSUTIL_DEBUG=1 python {project}/psutil/tests/runner.py && - PYTHONWARNINGS=always PYTHONUNBUFFERED=1 PSUTIL_DEBUG=1 python {project}/psutil/tests/test_memleaks.py - CIBW_TEST_EXTRAS: test - CIBW_BUILD: 'cp27-*' + # py2: + # name: py2-${{ matrix.os }} + # runs-on: ${{ matrix.os }} + # timeout-minutes: 20 + # strategy: + # fail-fast: false + # matrix: + # os: [ubuntu-latest, macos-12] + # env: + # CIBW_TEST_COMMAND: + # PYTHONWARNINGS=always PYTHONUNBUFFERED=1 PSUTIL_DEBUG=1 python {project}/psutil/tests/runner.py && + # PYTHONWARNINGS=always PYTHONUNBUFFERED=1 PSUTIL_DEBUG=1 python {project}/psutil/tests/test_memleaks.py + # CIBW_TEST_EXTRAS: test + # CIBW_BUILD: 'cp27-*' - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: 3.9 + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/setup-python@v4 + # with: + # python-version: 3.9 - - name: Create wheels + run tests - uses: pypa/cibuildwheel@v1.12.0 + # - name: Create wheels + run tests + # uses: pypa/cibuildwheel@v1.12.0 - - name: Upload wheels - uses: actions/upload-artifact@v3 - with: - name: wheels - path: wheelhouse + # - name: Upload wheels + # uses: actions/upload-artifact@v3 + # with: + # name: wheels + # path: wheelhouse - - name: Generate .tar.gz - if: matrix.os == 'ubuntu-latest' - run: | - make generate-manifest - python setup.py sdist - mv dist/psutil*.tar.gz wheelhouse/ + # - name: Generate .tar.gz + # if: matrix.os == 'ubuntu-latest' + # run: | + # make generate-manifest + # python setup.py sdist + # mv dist/psutil*.tar.gz wheelhouse/ - # Run linters - linters: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: 3.x - - name: 'Run linters' - run: | - python3 -m pip install ruff rstcheck toml-sort sphinx - make lint-all + # # Run linters + # linters: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/setup-python@v4 + # with: + # python-version: 3.x + # - name: 'Run linters' + # run: | + # python3 -m pip install ruff rstcheck toml-sort sphinx + # make lint-all - # Check sanity of .tar.gz + wheel files - check-dist: - needs: [py2, py3] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: 3.x - - uses: actions/download-artifact@v3 - with: - name: wheels - path: wheelhouse - - run: | - python scripts/internal/print_hashes.py wheelhouse/ - pipx run twine check --strict wheelhouse/* - pipx run abi3audit --verbose --strict wheelhouse/*-abi3-*.whl + # # Check sanity of .tar.gz + wheel files + # check-dist: + # needs: [py2, py3] + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/setup-python@v4 + # with: + # python-version: 3.x + # - uses: actions/download-artifact@v3 + # with: + # name: wheels + # path: wheelhouse + # - run: | + # python scripts/internal/print_hashes.py wheelhouse/ + # pipx run twine check --strict wheelhouse/* + # pipx run abi3audit --verbose --strict wheelhouse/*-abi3-*.whl diff --git a/psutil/tests/__init__.py b/psutil/tests/__init__.py index f28e13bc4..e4e123d75 100644 --- a/psutil/tests/__init__.py +++ b/psutil/tests/__init__.py @@ -748,6 +748,7 @@ def wait_for_pid(pid): if WINDOWS: # give it some more time to allow better initialization time.sleep(0.01) + print("PROCESS INITIALIZED") # noqa @retry(exception=(FileNotFoundError, AssertionError), logfun=None, diff --git a/psutil/tests/test_unicode.py b/psutil/tests/test_unicode.py index f59df8815..cf9500a3f 100755 --- a/psutil/tests/test_unicode.py +++ b/psutil/tests/test_unicode.py @@ -74,7 +74,6 @@ import os import shutil -import time import traceback import unittest import warnings @@ -194,11 +193,6 @@ def expect_exact_path_match(self): def test_proc_exe(self): subp = self.spawn_testproc(cmd=[self.funky_name]) - # XXX: sometimes fail with ProcessLookupError: [Errno 3] assume - # no such process (originated from GetExitCodeProcess != - # STILL_ACTIVE) - if WINDOWS and CI_TESTING: - time.sleep(1) p = psutil.Process(subp.pid) exe = p.exe() self.assertIsInstance(exe, str) @@ -208,11 +202,6 @@ def test_proc_exe(self): def test_proc_name(self): subp = self.spawn_testproc(cmd=[self.funky_name]) - # XXX: sometimes fail with ProcessLookupError: [Errno 3] assume - # no such process (originated from GetExitCodeProcess != - # STILL_ACTIVE) - if WINDOWS and CI_TESTING: - time.sleep(1) name = psutil.Process(subp.pid).name() self.assertIsInstance(name, str) if self.expect_exact_path_match(): diff --git a/pyproject.toml b/pyproject.toml index 6f2aeb032..b8c084949 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -169,8 +169,8 @@ trailing_comma_inline_array = true [tool.cibuildwheel] skip = ["*-musllinux*", "pp*"] test-command = [ - "env PYTHONWARNINGS=always PYTHONUNBUFFERED=1 PSUTIL_DEBUG=1 PSUTIL_SCRIPTS_DIR={project}/scripts python {project}/psutil/tests/runner.py", - "env PYTHONWARNINGS=always PYTHONUNBUFFERED=1 PSUTIL_DEBUG=1 PSUTIL_SCRIPTS_DIR={project}/scripts python {project}/psutil/tests/test_memleaks.py", + # "env PYTHONWARNINGS=always PYTHONUNBUFFERED=1 PSUTIL_DEBUG=1 PSUTIL_SCRIPTS_DIR={project}/scripts python {project}/psutil/tests/test_memleaks.py", + "env PYTHONWARNINGS=always PYTHONUNBUFFERED=1 PSUTIL_DEBUG=1 PSUTIL_SCRIPTS_DIR={project}/scripts python {project}/psutil/tests/test_unicode.py", ] test-extras = "test"