diff options
author | Grzegorz Bokota <bokota+github@gmail.com> | 2020-05-16 14:01:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-16 14:01:07 +0200 |
commit | 135628639bd6d73b5e88aefe300acd13a04a858d (patch) | |
tree | 8f3e2adfb039865233743a392422f7f4de3c58ec | |
parent | 84a4ac3eb4465d296d00e7549242d2dc8c47b721 (diff) | |
download | psutil-135628639bd6d73b5e88aefe300acd13a04a858d.tar.gz |
Have GitHub build wheels on commit (#1758)
-rw-r--r-- | .github/workflows/build_wheel.yml | 77 | ||||
-rw-r--r-- | psutil/tests/__init__.py | 7 | ||||
-rwxr-xr-x | psutil/tests/test_system.py | 3 | ||||
-rwxr-xr-x | psutil/tests/test_unicode.py | 1 | ||||
-rwxr-xr-x | setup.py | 9 |
5 files changed, 91 insertions, 6 deletions
diff --git a/.github/workflows/build_wheel.yml b/.github/workflows/build_wheel.yml new file mode 100644 index 00000000..917a8436 --- /dev/null +++ b/.github/workflows/build_wheel.yml @@ -0,0 +1,77 @@ +name: Build wheel + +on: [push, pull_request] + +jobs: + wheel_without_test: + name: build wheel for ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [windows-latest, macos-latest, ubuntu-latest] + env: + CIBW_SKIP: "pp27-*win* cp27-*manylinux* pp-*manylinux*" + CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 + CIBW_MANYLINUX_I686_IMAGE: manylinux2014 + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-python@v1 + name: Install Python 3.7 + with: + python-version: '3.7' + + - name: Install Visual C++ for Python 2.7 + if: startsWith(matrix.os, 'windows') + run: | + choco install vcpython27 -f -y + + - name: "install cibuildwheel" + run: pip install cibuildwheel==1.4.1 + + - name: build wheel + run: cibuildwheel . + + - name: Upload wheels + uses: actions/upload-artifact@v1 + with: + name: wheels2 + path: wheelhouse + + wheel: + name: build wheel for ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [windows-latest, macos-latest, ubuntu-latest] + env: + CIBW_SKIP: "pp27-*win* *27* cp27-*manylinux* pp-*manylinux*" + CIBW_TEST_COMMAND: python -Wa {project}/psutil/tests/runner.py + CIBW_TEST_COMMAND_MACOS: LC_ALL='en_US.utf8' python -Wa {project}/psutil/tests/runner.py + CIBW_TEST_EXTRAS: test + CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 + CIBW_MANYLINUX_I686_IMAGE: manylinux2014 + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-python@v1 + name: Install Python 3.7 + with: + python-version: '3.7' + + - name: Install Visual C++ for Python 2.7 + if: startsWith(matrix.os, 'windows') + run: | + choco install vcpython27 -f -y + + - name: "install cibuildwheel" + run: pip install cibuildwheel==1.4.1 + + - name: build wheel + run: cibuildwheel . + + - name: Upload wheels + uses: actions/upload-artifact@v1 + with: + name: wheels + path: wheelhouse diff --git a/psutil/tests/__init__.py b/psutil/tests/__init__.py index 9667b5d5..8a086b6b 100644 --- a/psutil/tests/__init__.py +++ b/psutil/tests/__init__.py @@ -123,7 +123,8 @@ PYPY = '__pypy__' in sys.builtin_module_names TRAVIS = bool(os.environ.get('TRAVIS')) APPVEYOR = bool(os.environ.get('APPVEYOR')) CIRRUS = bool(os.environ.get('CIRRUS')) -CI_TESTING = TRAVIS or APPVEYOR or CIRRUS +GITHUB_WHEELS = bool(os.environ.get('CIBUILDWHEEL', False)) +CI_TESTING = TRAVIS or APPVEYOR or CIRRUS or GITHUB_WHEELS # --- configurable defaults @@ -199,7 +200,9 @@ def _get_py_exe(): else: return exe - if MACOS: + if GITHUB_WHEELS: + return which('python') + elif MACOS: exe = \ attempt(sys.executable) or \ attempt(os.path.realpath(sys.executable)) or \ diff --git a/psutil/tests/test_system.py b/psutil/tests/test_system.py index 09f5324f..49eb2d0b 100755 --- a/psutil/tests/test_system.py +++ b/psutil/tests/test_system.py @@ -47,6 +47,7 @@ from psutil.tests import PsutilTestCase from psutil.tests import PYPY from psutil.tests import retry_on_failure from psutil.tests import TRAVIS +from psutil.tests import GITHUB_WHEELS from psutil.tests import UNICODE_SUFFIX from psutil.tests import unittest @@ -618,7 +619,7 @@ class TestDiskAPIs(PsutilTestCase): try: os.stat(disk.mountpoint) except OSError as err: - if TRAVIS and MACOS and err.errno == errno.EIO: + if (GITHUB_WHEELS or TRAVIS) and MACOS and err.errno == errno.EIO: continue # http://mail.python.org/pipermail/python-dev/ # 2012-June/120787.html diff --git a/psutil/tests/test_unicode.py b/psutil/tests/test_unicode.py index 181df096..ec5ef4e3 100755 --- a/psutil/tests/test_unicode.py +++ b/psutil/tests/test_unicode.py @@ -108,6 +108,7 @@ from psutil.tests import spawn_testproc from psutil.tests import terminate from psutil.tests import TESTFN_PREFIX from psutil.tests import TRAVIS +from psutil.tests import GITHUB_WHEELS from psutil.tests import UNICODE_SUFFIX from psutil.tests import unittest import psutil @@ -67,9 +67,12 @@ if POSIX: sources.append('psutil/_psutil_posix.c') -extras_require = {} -if sys.version_info[:2] <= (3, 3): - extras_require.update(dict(enum='enum34')) +extras_require = {"test": [ + "ipaddress; python_version < '3.0'", + "mock; python_version < '3.0'", + "pypiwin32; sys.platform == 'win32'", + "wmi; sys.platform == 'win32'", + "enum34; python_version <= '3.4'",]} def get_version(): |