Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI tests / wheels / workflow #2024

Merged
merged 51 commits into from
Nov 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
ff1cdb6
try to adjust vmstat
giampaolo Nov 10, 2021
b97f309
Merge branch 'master' into fix-workflow
giampaolo Nov 14, 2021
0bc8c50
attempt to fix GH failure
giampaolo Nov 14, 2021
c4e7e72
disable py3.6
giampaolo Nov 14, 2021
3c00a2c
disable py3.6
giampaolo Nov 14, 2021
6a1b3eb
try to fix some tests
giampaolo Nov 14, 2021
27c1338
another attempt
giampaolo Nov 15, 2021
4907c7c
another attempt
giampaolo Nov 15, 2021
5a003d7
just a test
giampaolo Nov 15, 2021
4350cda
just a test
giampaolo Nov 15, 2021
9bcb892
just a test 2
giampaolo Nov 15, 2021
5cbfcd0
another attempt
giampaolo Nov 20, 2021
6deb5c4
new conf
giampaolo Nov 20, 2021
91ad21d
skip if using busybox
giampaolo Nov 20, 2021
6bf0a37
try to update coreutils
giampaolo Nov 20, 2021
9246500
try again
giampaolo Nov 20, 2021
6e8262d
another one
giampaolo Nov 20, 2021
7c2846c
and again
giampaolo Nov 20, 2021
3040c33
and again 2
giampaolo Nov 20, 2021
07878a9
and again 3
giampaolo Nov 20, 2021
faf04bf
and again 4
giampaolo Nov 20, 2021
3b902f1
yo!
giampaolo Nov 20, 2021
5967d75
try again
giampaolo Nov 20, 2021
3712bb8
and again
giampaolo Nov 20, 2021
4c13be1
print sysinfo
giampaolo Nov 20, 2021
af7dec8
another try
giampaolo Nov 21, 2021
aaa180f
another one
giampaolo Nov 21, 2021
f9b8922
try to run 2.7
giampaolo Nov 21, 2021
cb38af0
ping cbuildwheel version
giampaolo Nov 21, 2021
32b554f
just a test
giampaolo Nov 21, 2021
a80b2d6
just a test 2
giampaolo Nov 21, 2021
e065fcf
test again
giampaolo Nov 26, 2021
721b184
try again
giampaolo Nov 26, 2021
f3ab21a
yo
giampaolo Nov 26, 2021
2705d5c
yo
giampaolo Nov 26, 2021
62c9b6a
try to build 2.7 wheels
giampaolo Nov 26, 2021
b1b6f4f
try to build 2.7 wheels
giampaolo Nov 26, 2021
44e69a1
progress
giampaolo Nov 26, 2021
77d1d04
yo
giampaolo Nov 26, 2021
bcebddd
bump up ver
giampaolo Nov 26, 2021
db4e331
re-enable stuff
giampaolo Nov 26, 2021
d9d2cae
another refact
giampaolo Nov 26, 2021
b742443
fix typo
giampaolo Nov 26, 2021
ae1a975
typo again
giampaolo Nov 26, 2021
604e83a
yet another fix
giampaolo Nov 26, 2021
0183761
progress
giampaolo Nov 27, 2021
a5b6e76
fix conf
giampaolo Nov 27, 2021
2269021
yet another fix
giampaolo Nov 28, 2021
fe0bf1b
remove unused var
giampaolo Nov 28, 2021
593237b
fix scripts/internal/download_wheels_appveyor.py
giampaolo Nov 28, 2021
3953c50
bump up ver
giampaolo Nov 28, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 60 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
#
# * Linux
# * macOS
# * Windows (commented)
# * Windows (disabled)
# * FreeBSD
#
# To skip certain builds see:
# https://cibuildwheel.readthedocs.io/en/stable/options/#build-skip
#
# External GH actions:
# * https://github.com/pypa/cibuildwheel
# * https://github.com/actions/checkout
# * https://github.com/actions/setup-python
# * https://github.com/actions/upload-artifact
Expand All @@ -19,10 +20,11 @@
on: [push, pull_request]
name: build
jobs:
linux-macos-win:
name: ${{ matrix.os }}
# Linux + macOS + Python 3
linux-macos-py3:
name: ${{ matrix.os }}-py3
runs-on: ${{ matrix.os }}
timeout-minutes: 30
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
Expand All @@ -35,11 +37,12 @@ jobs:
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_SKIP: cp35-* pp*
CIBW_BUILD: 'cp37-* cp38-* cp39-* cp310-*'
CIBW_SKIP: '*-musllinux_*'

steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.6.0
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}

Expand Down Expand Up @@ -73,6 +76,57 @@ jobs:
mv dist/psutil*.tar.gz wheelhouse/
python scripts/internal/print_hashes.py wheelhouse/

# Linux + macOS + Python 2
linux-macos-py2:
name: ${{ matrix.os }}-py2
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
include:
- {name: Linux, python: '3.9', os: ubuntu-latest}
env:
CIBW_ARCHS: 'x86_64 i686'
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-*'
CIBW_SKIP: '*-musllinux_*'

steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install cibuildwheel
run: pip install cibuildwheel==1.12.0

- name: Run tests
run: cibuildwheel .

- name: Create wheels
uses: actions/upload-artifact@v2
with:
name: wheels
path: wheelhouse

- name: Print hashes
if: matrix.os == 'ubuntu-latest'
run: |
make generate-manifest
python setup.py sdist
mv dist/psutil*.tar.gz wheelhouse/
python scripts/internal/print_hashes.py wheelhouse/

freebsd:
runs-on: macos-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*Bug tracker at https://github.com/giampaolo/psutil/issues*

5.8.1 (IN DEVELOPMENT)
5.9.0 (IN DEVELOPMENT)
======================

XXXX-XX-XX
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ INSTALL_OPTS = `$(PYTHON) -c \
"import sys; print('' if hasattr(sys, 'real_prefix') else '--user')"`
TEST_PREFIX = PYTHONWARNINGS=always PSUTIL_DEBUG=1

all: test
all: help

# ===================================================================
# Install
Expand Down Expand Up @@ -214,9 +214,11 @@ install-git-hooks: ## Install GIT pre-commit hook.

download-wheels-github: ## Download latest wheels hosted on github.
$(PYTHON) scripts/internal/download_wheels_github.py --tokenfile=~/.github.token
${MAKE} print-wheels

download-wheels-appveyor: ## Download latest wheels hosted on appveyor.
$(PYTHON) scripts/internal/download_wheels_appveyor.py
${MAKE} print-wheels

print-wheels: ## Print downloaded wheels
$(PYTHON) scripts/internal/print_wheels.py
Expand Down
8 changes: 0 additions & 8 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ environment:
PYTHON_VERSION: "2.7.x"
PYTHON_ARCH: "32"

- PYTHON: "C:\\Python36"
PYTHON_VERSION: "3.6.x"
PYTHON_ARCH: "32"

- PYTHON: "C:\\Python37"
PYTHON_VERSION: "3.7.x"
PYTHON_ARCH: "32"
Expand All @@ -52,10 +48,6 @@ environment:
PYTHON_VERSION: "2.7.x"
PYTHON_ARCH: "64"

- PYTHON: "C:\\Python36-x64"
PYTHON_VERSION: "3.6.x"
PYTHON_ARCH: "64"

- PYTHON: "C:\\Python37-x64"
PYTHON_VERSION: "3.7.x"
PYTHON_ARCH: "64"
Expand Down
2 changes: 1 addition & 1 deletion psutil/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
AF_LINK = _psplatform.AF_LINK

__author__ = "Giampaolo Rodola'"
__version__ = "5.8.1"
__version__ = "5.9.0"
version_info = tuple([int(num) for num in __version__.split('.')])

_timer = getattr(time, 'monotonic', time.time)
Expand Down
2 changes: 2 additions & 0 deletions psutil/tests/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ def warn(msg):

# Used by test_*,py modules.
def run_from_name(name):
if CI_TESTING:
print_sysinfo()
suite = TestLoader().from_name(name)
runner = get_runner()
runner.run(suite)
Expand Down
2 changes: 0 additions & 2 deletions psutil/tests/test_connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import os
import socket
import sys
import textwrap
from contextlib import closing
from socket import AF_INET
Expand Down Expand Up @@ -47,7 +46,6 @@

thisproc = psutil.Process()
SOCK_SEQPACKET = getattr(socket, "SOCK_SEQPACKET", object())
PYTHON_39 = sys.version_info[:2] == (3, 9)


@serialrun
Expand Down
10 changes: 5 additions & 5 deletions psutil/tests/test_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def free_swap():
"""Parse 'free' cmd and return swap memory's s total, used and free
values.
"""
out = sh('free -b', env={"LANG": "C.UTF-8"})
out = sh(["free", "-b"], env={"LANG": "C.UTF-8"})
lines = out.split('\n')
for line in lines:
if line.startswith('Swap'):
Expand All @@ -168,7 +168,7 @@ def free_physmem():
# and 'cached' memory which may have different positions so we
# do not return them.
# https://github.com/giampaolo/psutil/issues/538#issuecomment-57059946
out = sh('free -b', env={"LANG": "C.UTF-8"})
out = sh(["free", "-b"], env={"LANG": "C.UTF-8"})
lines = out.split('\n')
for line in lines:
if line.startswith('Mem'):
Expand All @@ -182,7 +182,7 @@ def free_physmem():


def vmstat(stat):
out = sh("vmstat -s", env={"LANG": "C.UTF-8"})
out = sh(["vmstat", "-s"], env={"LANG": "C.UTF-8"})
for line in out.split("\n"):
line = line.strip()
if stat in line:
Expand All @@ -191,7 +191,7 @@ def vmstat(stat):


def get_free_version_info():
out = sh("free -V").strip()
out = sh(["free", "-V"]).strip()
if 'UNKNOWN' in out:
raise unittest.SkipTest("can't determine free version")
return tuple(map(int, out.split()[-1].split('.')))
Expand Down Expand Up @@ -312,7 +312,7 @@ def test_shared(self):
def test_available(self):
# "free" output format has changed at some point:
# https://github.com/giampaolo/psutil/issues/538#issuecomment-147192098
out = sh("free -b")
out = sh(["free", "-b"])
lines = out.split('\n')
if 'available' not in lines[0]:
raise unittest.SkipTest("free does not support 'available' column")
Expand Down
6 changes: 1 addition & 5 deletions psutil/tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import pickle
import socket
import stat
import sys

from psutil import LINUX
from psutil import POSIX
Expand Down Expand Up @@ -50,9 +49,6 @@
import psutil.tests


PYTHON_39 = sys.version_info[:2] == (3, 9)


# ===================================================================
# --- Misc / generic tests.
# ===================================================================
Expand Down Expand Up @@ -414,7 +410,7 @@ def test_debug(self):
msg = f.getvalue()
assert msg.startswith("psutil-debug"), msg
self.assertIn("hello", msg)
self.assertIn(__file__, msg)
self.assertIn(__file__.replace('.pyc', '.py'), msg)

# supposed to use repr(exc)
with redirect_stderr(StringIO()) as f:
Expand Down
2 changes: 1 addition & 1 deletion scripts/internal/download_wheels_appveyor.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
USER = "giampaolo"
PROJECT = "psutil"
BASE_URL = 'https://ci.appveyor.com/api'
PY_VERSIONS = ['2.7', '3.6', '3.7', '3.8', '3.9']
PY_VERSIONS = ['2.7', '3.7', '3.8', '3.9', '3.10']
TIMEOUT = 30


Expand Down
2 changes: 1 addition & 1 deletion scripts/internal/print_wheels.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def main():

tot_files = 0
tot_size = 0
templ = "%-54s %7s %7s %7s"
templ = "%-100s %7s %7s %7s"
for platf, wheels in groups.items():
ppn = "%s (total = %s)" % (platf, len(wheels))
s = templ % (ppn, "size", "arch", "pyver")
Expand Down