diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2020-11-15 04:49:29 +0100 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2020-11-15 04:49:29 +0100 |
commit | ebbe751220214a78f095a6571311308c1232a8d6 (patch) | |
tree | 88293fe88c2052f3aeedb95c4cb4bc73e6632610 | |
parent | af797dca13623e85d7851fa3c3e39f6c610debfd (diff) | |
download | psutil-ebbe751220214a78f095a6571311308c1232a8d6.tar.gz |
get rid of travis and cirrus
-rw-r--r-- | .ci/travis/README | 2 | ||||
-rwxr-xr-x | .ci/travis/install.sh | 48 | ||||
-rwxr-xr-x | .ci/travis/run.sh | 38 | ||||
-rw-r--r-- | .cirrus.yml | 31 | ||||
-rw-r--r-- | .github/workflows/ci.yml | 32 | ||||
-rw-r--r-- | .travis.yml | 27 | ||||
-rw-r--r-- | MANIFEST.in | 21 | ||||
-rw-r--r-- | Makefile | 12 | ||||
-rw-r--r-- | README.rst | 12 | ||||
-rw-r--r-- | docs/DEVGUIDE.rst | 13 | ||||
-rw-r--r-- | psutil/tests/README.rst | 9 | ||||
-rw-r--r-- | psutil/tests/__init__.py | 9 | ||||
-rwxr-xr-x | psutil/tests/test_connections.py | 9 | ||||
-rwxr-xr-x | psutil/tests/test_linux.py | 12 | ||||
-rwxr-xr-x | psutil/tests/test_memleaks.py | 7 | ||||
-rwxr-xr-x | psutil/tests/test_misc.py | 7 | ||||
-rwxr-xr-x | psutil/tests/test_posix.py | 2 | ||||
-rwxr-xr-x | psutil/tests/test_process.py | 27 | ||||
-rwxr-xr-x | psutil/tests/test_system.py | 10 | ||||
-rwxr-xr-x | psutil/tests/test_unicode.py | 3 | ||||
-rwxr-xr-x | scripts/internal/download_wheels_github.py | 10 | ||||
-rwxr-xr-x | scripts/internal/generate_manifest.py | 4 |
22 files changed, 72 insertions, 273 deletions
diff --git a/.ci/travis/README b/.ci/travis/README deleted file mode 100644 index d9d5f65a..00000000 --- a/.ci/travis/README +++ /dev/null @@ -1,2 +0,0 @@ -This directory contains support files for Travis, a continuous integration -service which runs tests on Linux and Windows on every push. diff --git a/.ci/travis/install.sh b/.ci/travis/install.sh deleted file mode 100755 index ff6b9378..00000000 --- a/.ci/travis/install.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -set -e -set -x - -uname -a -python -c "import sys; print(sys.version)" - -if [[ "$(uname -s)" == 'Darwin' ]]; then - brew update || brew update - brew outdated pyenv || brew upgrade pyenv - brew install pyenv-virtualenv - - if which pyenv > /dev/null; then - eval "$(pyenv init -)" - fi - - case "${PYVER}" in - py27) - pyenv install 2.7.16 - pyenv virtualenv 2.7.16 psutil - ;; - py36) - pyenv install 3.6.6 - pyenv virtualenv 3.6.6 psutil - ;; - py37) - pyenv install 3.7.6 - pyenv virtualenv 3.7.6 psutil - ;; - py38) - pyenv install 3.8.5 - pyenv virtualenv 3.8.5 psutil - ;; - py39) - pyenv install 3.9.0 - pyenv virtualenv 3.9.0 psutil - ;; - esac - pyenv rehash - pyenv activate psutil -fi - -if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]] || [[ $PYVER == 'py27' ]]; then - pip install -U ipaddress mock unittest2 -fi - -pip install -U coverage coveralls flake8 setuptools twine diff --git a/.ci/travis/run.sh b/.ci/travis/run.sh deleted file mode 100755 index ae593df5..00000000 --- a/.ci/travis/run.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -set -e -set -x - -PYVER=`python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))'` - -# setup macOS -if [[ "$(uname -s)" == 'Darwin' ]]; then - if which pyenv > /dev/null; then - eval "$(pyenv init -)" - fi - pyenv activate psutil -fi - -# install psutil -make clean -python setup.py build -python setup.py develop - -# run tests (with coverage) -if [[ $PYVER == '2.7' ]] && [[ "$(uname -s)" != 'Darwin' ]]; then - PSUTIL_TESTING=1 python -Wa -m coverage run psutil/tests/runner.py -else - PSUTIL_TESTING=1 python -Wa psutil/tests/runner.py -fi - -if [ "$PYVER" == "2.7" ] || [ "$PYVER" == "3.6" ]; then - # run mem leaks test - PSUTIL_TESTING=1 python -Wa psutil/tests/test_memleaks.py - # run linter (on Linux only) - if [[ "$(uname -s)" != 'Darwin' ]]; then - make lint PYTHON=python - fi -fi - -PSUTIL_TESTING=1 python -Wa scripts/internal/print_access_denied.py -PSUTIL_TESTING=1 python -Wa scripts/internal/print_api_speed.py diff --git a/.cirrus.yml b/.cirrus.yml deleted file mode 100644 index a0b8f1f0..00000000 --- a/.cirrus.yml +++ /dev/null @@ -1,31 +0,0 @@ -freebsd_13_py3_task: - freebsd_instance: - image: freebsd-12-1-release-amd64 - env: - CIRRUS: 1 - install_script: - - pkg install -y python3 gcc py37-pip - script: - - python3 -m pip install --user setuptools - - make clean - - make install - - make test - - make test-memleaks - - make print-access-denied - - make print-api-speed - -freebsd_11_py2_task: - freebsd_instance: - image: freebsd-12-1-release-amd64 - env: - CIRRUS: 1 - install_script: - - pkg install -y python gcc py27-pip - script: - - python2.7 -m pip install --user setuptools ipaddress mock - - make clean - - make install - - make test - - make test-memleaks - - make print-access-denied - - make print-api-speed diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d3a2f7f..233731b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,26 +1,32 @@ -name: CI +# Executed on every push by GitHub Actions. This runs CI tests and +# generates wheels on the following platforms: +# +# * Linux +# * macOS +# * FreeBSD +# +# Windows works as well but it's disabled (we do it via AppVeyor). +# To skip certain builds see: +# https://cibuildwheel.readthedocs.io/en/stable/options/#build-skip +name: CI on: [push, pull_request] - jobs: - - # --- Linux, macOS, Windows - linux-macos-win: name: ${{ matrix.os }} runs-on: ${{ matrix.os }} timeout-minutes: 30 strategy: - fail-fast: false # whether to exit the whole run on first failure + fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + # os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest] include: - {name: Linux, python: '3.9', os: ubuntu-latest} env: CIBW_TEST_COMMAND: python -u -Wa {project}/psutil/tests/runner.py && python -u -Wa {project}/psutil/tests/test_memleaks.py CIBW_TEST_COMMAND_MACOS: LC_ALL='en_US.utf8' python -Wa {project}/psutil/tests/runner.py && LC_ALL='en_US.utf8' python -Wa {project}/psutil/tests/test_memleaks.py CIBW_TEST_EXTRAS: test - # https://cibuildwheel.readthedocs.io/en/stable/options/#build-skip CIBW_SKIP: cp35-* pp* steps: - uses: actions/checkout@v2 @@ -28,10 +34,10 @@ jobs: with: python-version: 3.9 - - name: (Windows) install Visual C++ for Python 2.7 - if: matrix.os == 'windows-latest' - run: | - choco install vcpython27 -f -y + # - name: (Windows) install Visual C++ for Python 2.7 + # if: matrix.os == 'windows-latest' + # run: | + # choco install vcpython27 -f -y - name: Run tests run: | @@ -56,8 +62,6 @@ jobs: mv dist/psutil*.tar.gz wheelhouse/ python scripts/internal/print_hashes.py wheelhouse/ - # --- FreeBSD - freebsd: runs-on: macos-latest steps: diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d9420682..00000000 --- a/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -language: python -cache: pip -matrix: - include: - # Linux - - python: 3.8 - - python: 3.9-dev - # macOS - - language: generic - os: osx - env: PYVER=py38 - - language: generic - os: osx - env: PYVER=py27 - # pypy - - python: pypy - - python: pypy3 -install: - - ./.ci/travis/install.sh -script: - - ./.ci/travis/run.sh -after_success: - - | - if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]] && [[ "$(uname -s)" != 'Darwin' ]]; then - echo "sending test coverage results to coveralls.io" - coveralls - fi diff --git a/MANIFEST.in b/MANIFEST.in index 780bbdc7..626d4921 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -111,6 +111,27 @@ include scripts/disk_usage.py include scripts/fans.py include scripts/free.py include scripts/ifconfig.py +include scripts/internal/README +include scripts/internal/bench_oneshot.py +include scripts/internal/bench_oneshot_2.py +include scripts/internal/check_broken_links.py +include scripts/internal/clinter.py +include scripts/internal/convert_readme.py +include scripts/internal/download_wheels_appveyor.py +include scripts/internal/download_wheels_github.py +include scripts/internal/fix_flake8.py +include scripts/internal/generate_manifest.py +include scripts/internal/git_pre_commit.py +include scripts/internal/print_access_denied.py +include scripts/internal/print_announce.py +include scripts/internal/print_api_speed.py +include scripts/internal/print_downloads.py +include scripts/internal/print_hashes.py +include scripts/internal/print_timeline.py +include scripts/internal/print_wheels.py +include scripts/internal/purge_installation.py +include scripts/internal/tidelift.py +include scripts/internal/winmake.py include scripts/iotop.py include scripts/killall.py include scripts/meminfo.py @@ -212,14 +212,13 @@ install-git-hooks: ## Install GIT pre-commit hook. # Wheels # =================================================================== -download-wheels-appveyor: ## Download latest wheels hosted on appveyor. - $(PYTHON) scripts/internal/download_wheels_appveyor.py --user giampaolo --project psutil - ${MAKE} print-wheels - download-wheels-github: ## Download latest wheels hosted on github. $(PYTHON) scripts/internal/download_wheels_github.py --user=giampaolo --project=psutil --tokenfile=~/.github.token ${MAKE} print-wheels +download-wheels-appveyor: ## Download latest wheels hosted on appveyor. + $(PYTHON) scripts/internal/download_wheels_appveyor.py --user giampaolo --project psutil + print-wheels: ## Print downloaded wheels $(PYTHON) scripts/internal/print_wheels.py @@ -261,10 +260,11 @@ pre-release: ## Check if we're ready to produce a new release. ${MAKE} install ${MAKE} generate-manifest git diff MANIFEST.in > /dev/null # ...otherwise 'git diff-index HEAD' will complain - ${MAKE} download-wheels-github ${MAKE} sdist + ${MAKE} download-wheels-github + ${MAKE} download-wheels-appveyor + ${MAKE} print-wheels $(PYTHON) -m twine check dist/* - ${MAKE} md5-dist $(PYTHON) -c \ "from psutil import __version__ as ver; \ doc = open('docs/index.rst').read(); \ @@ -1,6 +1,6 @@ | |downloads| |stars| |forks| |contributors| |coverage| |quality| | |version| |py-versions| |packages| |license| -| |linux-macos-win| |freebsd| |appveyor| |doc| |twitter| |tidelift| +| |github-actions| |appveyor| |doc| |twitter| |tidelift| .. |downloads| image:: https://img.shields.io/pypi/dm/psutil.svg :target: https://pepy.tech/project/psutil @@ -22,22 +22,14 @@ :target: https://www.codacy.com/app/g-rodola/psutil?utm_source=github.com&utm_medium=referral&utm_content=giampaolo/psutil&utm_campaign=Badge_Grade :alt: Code quality -.. |linux-macos-win| image:: https://github.com/giampaolo/psutil/workflows/Linux,%20macOS,%20Windows/badge.svg +.. |github-actions| image:: https://img.shields.io/github/workflow/status/giampaolo/psutil/CI?label=Linux%2C%20macOS%2C%20FreeBSD :target: https://github.com/giampaolo/psutil/actions?query=workflow%3A%22Linux%2C+macOS%2C+Windows%22 :alt: Linux, macOS, Windows tests -.. |freebsd| image:: https://github.com/giampaolo/psutil/workflows/FreeBSD/badge.svg - :target: https://github.com/giampaolo/psutil/actions?query=workflow%3AFreeBSD - :alt: FreeBSD tests - .. |appveyor| image:: https://img.shields.io/appveyor/ci/giampaolo/psutil/master.svg?maxAge=3600&label=Windows :target: https://ci.appveyor.com/project/giampaolo/psutil :alt: Windows tests (Appveyor) -.. |cirrus| image:: https://img.shields.io/cirrus/github/giampaolo/psutil?label=FreeBSD - :target: https://cirrus-ci.com/github/giampaolo/psutil-cirrus-ci - :alt: FreeBSD tests (Cirrus-Ci) - .. |coverage| image:: https://coveralls.io/repos/github/giampaolo/psutil/badge.svg?branch=master :target: https://coveralls.io/github/giampaolo/psutil?branch=master :alt: Test coverage (coverall.io) diff --git a/docs/DEVGUIDE.rst b/docs/DEVGUIDE.rst index 573afdd5..edd9aa8f 100644 --- a/docs/DEVGUIDE.rst +++ b/docs/DEVGUIDE.rst @@ -107,23 +107,18 @@ All of the services listed below are automatically run on each ``git push``. Unit tests ---------- -Tests are automatically run on every GIT push on **Linux**, **macOS**, +Tests are automatically run on every GIT push and PR on **Linux**, **macOS**, **Windows** and **FreeBSD** by using: -- `Travis`_ (Linux, macOS) - `Github Actions`_ (Linux, macOS, Windows) - `Appveyor`_ (Windows) -- `Cirrus CI`_ (FreeBSD) -.. image:: https://img.shields.io/travis/giampaolo/psutil/master.svg?maxAge=3600&label=Linux,%20OSX,%20PyPy - :target: https://travis-ci.org/giampaolo/psutil +.. image:: https://img.shields.io/github/workflow/status/giampaolo/psutil/CI?label=Linux%2C%20macOS%2C%20FreeBSD + :target: https://github.com/giampaolo/psutil/actions .. image:: https://img.shields.io/appveyor/ci/giampaolo/psutil/master.svg?maxAge=3600&label=Windows :target: https://ci.appveyor.com/project/giampaolo/psutil -.. image:: https://img.shields.io/cirrus/github/giampaolo/psutil?label=FreeBSD - :target: https://cirrus-ci.com/github/giampaolo/psutil-cirrus-ci - OpenBSD, NetBSD, AIX and Solaris does not have continuos test integration. Test coverage @@ -147,7 +142,6 @@ Documentation .. _`.travis.yml`: https://github.com/giampaolo/psutil/blob/master/.travis.yml .. _`appveyor.yml`: https://github.com/giampaolo/psutil/blob/master/appveyor.yml .. _`Appveyor`: https://ci.appveyor.com/project/giampaolo/psuti -.. _`Cirrus CI`: https://cirrus-ci.com/github/giampaolo/psutil-cirrus-ci .. _`coveralls.io`: https://coveralls.io/github/giampaolo/psuti .. _`CREDITS`: https://github.com/giampaolo/psutil/blob/master/CREDITS .. _`doc/index.rst`: https://github.com/giampaolo/psutil/blob/master/doc/index.rst @@ -165,4 +159,3 @@ Documentation .. _`psutil/tests/test_system.py`: https://github.com/giampaolo/psutil/blob/master/psutil/tests/test_system.py .. _`RsT syntax`: http://docutils.sourceforge.net/docs/user/rst/quickref.htm .. _`sphinx`: http://sphinx-doc.org -.. _`Travis`: https://travis-ci.org/giampaolo/psuti diff --git a/psutil/tests/README.rst b/psutil/tests/README.rst index 61e066b7..9dca1186 100644 --- a/psutil/tests/README.rst +++ b/psutil/tests/README.rst @@ -12,12 +12,3 @@ Instructions for running tests make setup-dev-env # install missing third-party deps make test # serial run make test-parallel # parallel run - -* To run tests on all supported Python versions install tox - (``pip install tox``) then run ``tox`` from within psutil root directory. - -* Every time a commit is pushed tests are automatically run on Travis - (Linux, MACOS) and appveyor (Windows): - - * Travis builds: https://travis-ci.org/giampaolo/psutil - * AppVeyor builds: https://ci.appveyor.com/project/giampaolo/psutil diff --git a/psutil/tests/__init__.py b/psutil/tests/__init__.py index 24e145e1..399aa84c 100644 --- a/psutil/tests/__init__.py +++ b/psutil/tests/__init__.py @@ -77,7 +77,7 @@ __all__ = [ # constants 'APPVEYOR', 'DEVNULL', 'GLOBAL_TIMEOUT', 'TOLERANCE_SYS_MEM', 'NO_RETRIES', 'PYPY', 'PYTHON_EXE', 'ROOT_DIR', 'SCRIPTS_DIR', 'TESTFN_PREFIX', - 'UNICODE_SUFFIX', 'INVALID_UNICODE_SUFFIX', 'TRAVIS', 'CIRRUS', + 'UNICODE_SUFFIX', 'INVALID_UNICODE_SUFFIX', 'CI_TESTING', 'VALID_PROC_STATUSES', 'TOLERANCE_DISK_USAGE', 'IS_64BIT', "HAS_CPU_AFFINITY", "HAS_CPU_FREQ", "HAS_ENVIRON", "HAS_PROC_IO_COUNTERS", "HAS_IONICE", "HAS_MEMORY_MAPS", "HAS_PROC_CPU_NUM", "HAS_RLIMIT", @@ -120,11 +120,9 @@ __all__ = [ PYPY = '__pypy__' in sys.builtin_module_names # whether we're running this test suite on a Continuous Integration service -TRAVIS = 'TRAVIS' in os.environ APPVEYOR = 'APPVEYOR' in os.environ -CIRRUS = 'CIRRUS' in os.environ GITHUB_ACTIONS = 'GITHUB_ACTIONS' in os.environ or 'CIBUILDWHEEL' in os.environ -CI_TESTING = TRAVIS or APPVEYOR or CIRRUS or GITHUB_ACTIONS +CI_TESTING = APPVEYOR or GITHUB_ACTIONS # are we a 64 bit process? IS_64BIT = sys.maxsize > 2 ** 32 @@ -138,8 +136,7 @@ TOLERANCE_SYS_MEM = 5 * 1024 * 1024 # 5MB TOLERANCE_DISK_USAGE = 10 * 1024 * 1024 # 10MB # the timeout used in functions which have to wait GLOBAL_TIMEOUT = 5 -# be more tolerant if we're on travis / appveyor in order to avoid -# false positives +# be more tolerant if we're on CI in order to avoid false positives if CI_TESTING: NO_RETRIES *= 3 GLOBAL_TIMEOUT *= 3 diff --git a/psutil/tests/test_connections.py b/psutil/tests/test_connections.py index ba019ec0..6bbf2194 100755 --- a/psutil/tests/test_connections.py +++ b/psutil/tests/test_connections.py @@ -31,7 +31,6 @@ from psutil.tests import AF_UNIX from psutil.tests import bind_socket from psutil.tests import bind_unix_socket from psutil.tests import check_connection_ntuple -from psutil.tests import CIRRUS from psutil.tests import create_sockets from psutil.tests import HAS_CONNECTIONS_UNIX from psutil.tests import PsutilTestCase @@ -41,7 +40,6 @@ from psutil.tests import serialrun from psutil.tests import skip_on_access_denied from psutil.tests import SKIP_SYSCONS from psutil.tests import tcp_socketpair -from psutil.tests import TRAVIS from psutil.tests import unittest from psutil.tests import unix_socketpair from psutil.tests import wait_for_file @@ -246,9 +244,6 @@ class TestConnectedSocket(ConnectionTestCase): # On NetBSD creating a UNIX socket will cause # a UNIX connection to /var/run/log. cons = [c for c in cons if c.raddr != '/var/run/log'] - if CIRRUS: - cons = [c for c in cons if c.fd in - (server.fileno(), client.fileno())] self.assertEqual(len(cons), 2, msg=cons) if LINUX or FREEBSD or SUNOS: # remote path is never set @@ -495,10 +490,6 @@ class TestSystemWideConnections(ConnectionTestCase): self.assertEqual(len(cons), len(set(cons))) check(cons, families, types_) - # See: https://travis-ci.org/giampaolo/psutil/jobs/237566297 - @unittest.skipIf(MACOS and TRAVIS, "unreliable on MACOS + TRAVIS") - # XXX - @unittest.skipIf(TRAVIS and PYTHON_39, "unreliable on TRAVIS + PYTHON_39") @retry_on_failure() def test_multi_sockets_procs(self): # Creates multiple sub processes, each creating different diff --git a/psutil/tests/test_linux.py b/psutil/tests/test_linux.py index fbfa05a9..f8a9e008 100755 --- a/psutil/tests/test_linux.py +++ b/psutil/tests/test_linux.py @@ -44,7 +44,6 @@ from psutil.tests import skip_on_not_implemented from psutil.tests import ThreadTask from psutil.tests import TOLERANCE_DISK_USAGE from psutil.tests import TOLERANCE_SYS_MEM -from psutil.tests import TRAVIS from psutil.tests import unittest from psutil.tests import which @@ -261,7 +260,6 @@ class TestSystemVirtualMemory(PsutilTestCase): free_value, psutil_value, delta=TOLERANCE_SYS_MEM, msg='%s %s \n%s' % (free_value, psutil_value, free.output)) - @unittest.skipIf(TRAVIS, "unreliable on TRAVIS") @retry_on_failure() def test_free(self): vmstat_value = vmstat('free memory') * 1024 @@ -276,8 +274,6 @@ class TestSystemVirtualMemory(PsutilTestCase): self.assertAlmostEqual( vmstat_value, psutil_value, delta=TOLERANCE_SYS_MEM) - # https://travis-ci.org/giampaolo/psutil/jobs/226719664 - @unittest.skipIf(TRAVIS, "unreliable on TRAVIS") @retry_on_failure() def test_active(self): vmstat_value = vmstat('active memory') * 1024 @@ -285,8 +281,6 @@ class TestSystemVirtualMemory(PsutilTestCase): self.assertAlmostEqual( vmstat_value, psutil_value, delta=TOLERANCE_SYS_MEM) - # https://travis-ci.org/giampaolo/psutil/jobs/227242952 - @unittest.skipIf(TRAVIS, "unreliable on TRAVIS") @retry_on_failure() def test_inactive(self): vmstat_value = vmstat('inactive memory') * 1024 @@ -638,7 +632,6 @@ class TestSystemSwapMemory(PsutilTestCase): @unittest.skipIf(not LINUX, "LINUX only") class TestSystemCPUTimes(PsutilTestCase): - @unittest.skipIf(TRAVIS, "unknown failure on travis") def test_fields(self): fields = psutil.cpu_times()._fields kernel_ver = re.findall(r'\d+\.\d+\.\d+', os.uname()[2])[0] @@ -753,7 +746,6 @@ class TestSystemCPUCountPhysical(PsutilTestCase): @unittest.skipIf(not LINUX, "LINUX only") class TestSystemCPUFrequency(PsutilTestCase): - @unittest.skipIf(TRAVIS, "fails on Travis") @unittest.skipIf(not HAS_CPU_FREQ, "not supported") def test_emulate_use_second_file(self): # https://github.com/giampaolo/psutil/issues/981 @@ -874,7 +866,6 @@ class TestSystemCPUFrequency(PsutilTestCase): if freq[1].max != 0.0: self.assertEqual(freq[1].max, 600.0) - @unittest.skipIf(TRAVIS, "fails on Travis") @unittest.skipIf(not HAS_CPU_FREQ, "not supported") def test_emulate_no_scaling_cur_freq_file(self): # See: https://github.com/giampaolo/psutil/issues/1071 @@ -901,13 +892,11 @@ class TestSystemCPUFrequency(PsutilTestCase): @unittest.skipIf(not LINUX, "LINUX only") class TestSystemCPUStats(PsutilTestCase): - @unittest.skipIf(TRAVIS, "fails on Travis") def test_ctx_switches(self): vmstat_value = vmstat("context switches") psutil_value = psutil.cpu_stats().ctx_switches self.assertAlmostEqual(vmstat_value, psutil_value, delta=500) - @unittest.skipIf(TRAVIS, "fails on Travis") def test_interrupts(self): vmstat_value = vmstat("interrupts") psutil_value = psutil.cpu_stats().interrupts @@ -961,7 +950,6 @@ class TestSystemNetIfAddrs(PsutilTestCase): # XXX - not reliable when having virtual NICs installed by Docker. # @unittest.skipIf(not which('ip'), "'ip' utility not available") - # @unittest.skipIf(TRAVIS, "skipped on Travis") # def test_net_if_names(self): # out = sh("ip addr").strip() # nics = [x for x in psutil.net_if_addrs().keys() if ':' not in x] diff --git a/psutil/tests/test_memleaks.py b/psutil/tests/test_memleaks.py index 48a65dd5..ab6aac69 100755 --- a/psutil/tests/test_memleaks.py +++ b/psutil/tests/test_memleaks.py @@ -49,7 +49,6 @@ from psutil.tests import spawn_testproc from psutil.tests import system_namespace from psutil.tests import terminate from psutil.tests import TestMemoryLeak -from psutil.tests import TRAVIS from psutil.tests import unittest @@ -219,9 +218,8 @@ class TestProcessObjectLeaks(TestMemoryLeak): def test_cpu_affinity_set(self): affinity = thisproc.cpu_affinity() self.execute(lambda: self.proc.cpu_affinity(affinity)) - if not TRAVIS: - self.execute_w_exc( - ValueError, lambda: self.proc.cpu_affinity([-1])) + self.execute_w_exc( + ValueError, lambda: self.proc.cpu_affinity([-1])) @fewtimes_if_linux() def test_open_files(self): @@ -429,7 +427,6 @@ class TestModuleFunctionsLeaks(TestMemoryLeak): tolerance = 80 * 1024 if WINDOWS else self.tolerance self.execute(psutil.net_if_addrs, tolerance=tolerance) - # @unittest.skipIf(TRAVIS, "EPERM on travis") def test_net_if_stats(self): self.execute(psutil.net_if_stats) diff --git a/psutil/tests/test_misc.py b/psutil/tests/test_misc.py index dac81859..81fa8f39 100755 --- a/psutil/tests/test_misc.py +++ b/psutil/tests/test_misc.py @@ -43,7 +43,6 @@ from psutil.tests import reload_module from psutil.tests import ROOT_DIR from psutil.tests import SCRIPTS_DIR from psutil.tests import sh -from psutil.tests import TRAVIS from psutil.tests import unittest import psutil import psutil.tests @@ -638,8 +637,6 @@ class TestWrapNumbers(PsutilTestCase): @unittest.skipIf(not os.path.exists(SCRIPTS_DIR), "can't locate scripts directory") -# XXX -@unittest.skipIf(TRAVIS and PYTHON_39, "unreliable on TRAVIS + PYTHON_39") class TestScripts(PsutilTestCase): """Tests for scripts in the "scripts" directory.""" @@ -713,8 +710,6 @@ class TestScripts(PsutilTestCase): def test_netstat(self): self.assert_stdout('netstat.py') - # permission denied on travis - @unittest.skipIf(TRAVIS, "unreliable on TRAVIS") def test_ifconfig(self): self.assert_stdout('ifconfig.py') @@ -751,14 +746,12 @@ class TestScripts(PsutilTestCase): self.assert_syntax('cpu_distribution.py') @unittest.skipIf(not HAS_SENSORS_TEMPERATURES, "not supported") - @unittest.skipIf(TRAVIS, "unreliable on TRAVIS") def test_temperatures(self): if not psutil.sensors_temperatures(): self.skipTest("no temperatures") self.assert_stdout('temperatures.py') @unittest.skipIf(not HAS_SENSORS_FANS, "not supported") - @unittest.skipIf(TRAVIS, "unreliable on TRAVIS") def test_fans(self): if not psutil.sensors_fans(): self.skipTest("no fans") diff --git a/psutil/tests/test_posix.py b/psutil/tests/test_posix.py index 54cf5ceb..d9513eed 100755 --- a/psutil/tests/test_posix.py +++ b/psutil/tests/test_posix.py @@ -32,7 +32,6 @@ from psutil.tests import retry_on_failure from psutil.tests import sh from psutil.tests import skip_on_access_denied from psutil.tests import terminate -from psutil.tests import TRAVIS from psutil.tests import unittest from psutil.tests import which @@ -307,7 +306,6 @@ class TestSystemAPIs(PsutilTestCase): # for some reason ifconfig -a does not report all interfaces # returned by psutil @unittest.skipIf(SUNOS, "unreliable on SUNOS") - @unittest.skipIf(TRAVIS, "unreliable on TRAVIS") @unittest.skipIf(not which('ifconfig'), "no ifconfig cmd") @unittest.skipIf(not HAS_NET_IO_COUNTERS, "not supported") def test_nic_names(self): diff --git a/psutil/tests/test_process.py b/psutil/tests/test_process.py index bf301ed0..af35a58c 100755 --- a/psutil/tests/test_process.py +++ b/psutil/tests/test_process.py @@ -40,7 +40,6 @@ from psutil._compat import super from psutil.tests import APPVEYOR from psutil.tests import call_until from psutil.tests import CI_TESTING -from psutil.tests import CIRRUS from psutil.tests import copyload_shared_lib from psutil.tests import create_exe from psutil.tests import GITHUB_ACTIONS @@ -64,7 +63,6 @@ from psutil.tests import sh from psutil.tests import skip_on_access_denied from psutil.tests import skip_on_not_implemented from psutil.tests import ThreadTask -from psutil.tests import TRAVIS from psutil.tests import unittest from psutil.tests import wait_for_pid @@ -295,7 +293,6 @@ class TestProcess(PsutilTestCase): time.strftime("%Y %m %d %H:%M:%S", time.localtime(p.create_time())) @unittest.skipIf(not POSIX, 'POSIX only') - @unittest.skipIf(TRAVIS or CIRRUS, 'not reliable on TRAVIS/CIRRUS') def test_terminal(self): terminal = psutil.Process().terminal() if terminal is not None: @@ -758,9 +755,6 @@ class TestProcess(PsutilTestCase): "import time; [time.sleep(0.01) for x in range(3000)];" "arg1", "arg2", "", "arg3", ""] p = self.spawn_psproc(cmdline) - # ...in order to try to prevent occasional failures on travis - if TRAVIS: - wait_for_pid(p.pid) self.assertEqual(p.cmdline(), cmdline) self.assertEqual(p.name(), os.path.basename(funky_path)) self.assertEqual(os.path.normcase(p.exe()), @@ -875,9 +869,7 @@ class TestProcess(PsutilTestCase): self.assertEqual(len(initial), len(set(initial))) all_cpus = list(range(len(psutil.cpu_percent(percpu=True)))) - # Work around travis failure: - # https://travis-ci.org/giampaolo/psutil/builds/284173194 - for n in all_cpus if not TRAVIS else initial: + for n in all_cpus: p.cpu_affinity([n]) self.assertEqual(p.cpu_affinity(), [n]) if hasattr(os, "sched_getaffinity"): @@ -902,9 +894,8 @@ class TestProcess(PsutilTestCase): self.assertRaises(TypeError, p.cpu_affinity, 1) p.cpu_affinity(initial) # it should work with all iterables, not only lists - if not TRAVIS: - p.cpu_affinity(set(all_cpus)) - p.cpu_affinity(tuple(all_cpus)) + p.cpu_affinity(set(all_cpus)) + p.cpu_affinity(tuple(all_cpus)) @unittest.skipIf(not HAS_CPU_AFFINITY, 'not supported') def test_cpu_affinity_errs(self): @@ -1310,14 +1301,10 @@ class TestProcess(PsutilTestCase): succeed_or_zombie_p_exc(fun) assert psutil.pid_exists(zproc.pid) - if not TRAVIS and MACOS: - # For some reason this started failing all of the sudden. - # Maybe they upgraded MACOS version? - # https://travis-ci.org/giampaolo/psutil/jobs/310896404 - self.assertIn(zproc.pid, psutil.pids()) - self.assertIn(zproc.pid, [x.pid for x in psutil.process_iter()]) - psutil._pmap = {} - self.assertIn(zproc.pid, [x.pid for x in psutil.process_iter()]) + self.assertIn(zproc.pid, psutil.pids()) + self.assertIn(zproc.pid, [x.pid for x in psutil.process_iter()]) + psutil._pmap = {} + self.assertIn(zproc.pid, [x.pid for x in psutil.process_iter()]) @unittest.skipIf(not POSIX, 'POSIX only') def test_zombie_process_is_running_w_exc(self): diff --git a/psutil/tests/test_system.py b/psutil/tests/test_system.py index 4d6f79ff..4da4e784 100755 --- a/psutil/tests/test_system.py +++ b/psutil/tests/test_system.py @@ -48,7 +48,6 @@ from psutil.tests import mock 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_ACTIONS from psutil.tests import UNICODE_SUFFIX from psutil.tests import unittest @@ -533,8 +532,6 @@ class TestCpuAPIs(PsutilTestCase): self.assertGreaterEqual(value, 0) ls = psutil.cpu_freq(percpu=True) - if TRAVIS and not ls: - raise self.skipTest("skipped on Travis") if FREEBSD and not ls: raise self.skipTest("returns empty list on FreeBSD") @@ -606,9 +603,6 @@ class TestDiskAPIs(PsutilTestCase): # all = False ls = psutil.disk_partitions(all=False) - # on travis we get: - # self.assertEqual(p.cpu_affinity(), [n]) - # AssertionError: Lists differ: [0, 1, 2, 3, 4, 5, 6, 7,... != [0] self.assertTrue(ls, msg=ls) for disk in ls: check_ntuple(disk) @@ -633,8 +627,7 @@ class TestDiskAPIs(PsutilTestCase): try: os.stat(disk.mountpoint) except OSError as err: - if (GITHUB_ACTIONS or TRAVIS) and \ - MACOS and err.errno == errno.EIO: + if GITHUB_ACTIONS and MACOS and err.errno == errno.EIO: continue # http://mail.python.org/pipermail/python-dev/ # 2012-June/120787.html @@ -816,7 +809,6 @@ class TestNetAPIs(PsutilTestCase): else: self.assertEqual(addr.address, '06-3d-29-00-00-00') - @unittest.skipIf(TRAVIS, "unreliable on TRAVIS") # raises EPERM def test_net_if_stats(self): nics = psutil.net_if_stats() assert nics, nics diff --git a/psutil/tests/test_unicode.py b/psutil/tests/test_unicode.py index 60cb3651..9edb8c89 100755 --- a/psutil/tests/test_unicode.py +++ b/psutil/tests/test_unicode.py @@ -90,7 +90,6 @@ from psutil.tests import ASCII_FS from psutil.tests import bind_unix_socket from psutil.tests import chdir from psutil.tests import CI_TESTING -from psutil.tests import CIRRUS from psutil.tests import copyload_shared_lib from psutil.tests import create_exe from psutil.tests import get_testfn @@ -259,7 +258,7 @@ class TestFSAPIs(BaseUnicodeTest): conn = psutil.Process().connections('unix')[0] self.assertIsInstance(conn.laddr, str) # AF_UNIX addr not set on OpenBSD - if not OPENBSD and not CIRRUS: # XXX + if not OPENBSD: # XXX self.assertEqual(conn.laddr, name) @unittest.skipIf(not POSIX, "POSIX only") diff --git a/scripts/internal/download_wheels_github.py b/scripts/internal/download_wheels_github.py index 5623bb59..9de66fc2 100755 --- a/scripts/internal/download_wheels_github.py +++ b/scripts/internal/download_wheels_github.py @@ -57,12 +57,14 @@ def rename_win27_wheels(): # See: https://github.com/giampaolo/psutil/issues/810 src = 'dist/psutil-%s-cp27-cp27m-win32.whl' % PSUTIL_VERSION dst = 'dist/psutil-%s-cp27-none-win32.whl' % PSUTIL_VERSION - print("rename: %s\n %s" % (src, dst)) - os.rename(src, dst) + if os.path.exists(src): + print("rename: %s\n %s" % (src, dst)) + os.rename(src, dst) src = 'dist/psutil-%s-cp27-cp27m-win_amd64.whl' % PSUTIL_VERSION dst = 'dist/psutil-%s-cp27-none-win_amd64.whl' % PSUTIL_VERSION - print("rename: %s\n %s" % (src, dst)) - os.rename(src, dst) + if os.path.exists(src): + print("rename: %s\n %s" % (src, dst)) + os.rename(src, dst) def run(): diff --git a/scripts/internal/generate_manifest.py b/scripts/internal/generate_manifest.py index f760dd65..384fb329 100755 --- a/scripts/internal/generate_manifest.py +++ b/scripts/internal/generate_manifest.py @@ -13,8 +13,8 @@ import subprocess SKIP_EXTS = ('.png', '.jpg', '.jpeg') -SKIP_FILES = ('.cirrus.yml', '.travis.yml', 'appveyor.yml') -SKIP_PREFIXES = ('.ci/', '.github/', 'scripts/internal/') +SKIP_FILES = ('appveyor.yml') +SKIP_PREFIXES = ('.ci/', '.github/') def sh(cmd): |