diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2023-01-24 14:45:21 +0100 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2023-01-24 14:45:21 +0100 |
commit | 2312057d267c85185e5f49eb86bb6f90bd9ab206 (patch) | |
tree | d44e260767e0b323984e8e3958c85532b9d0099b | |
parent | 2da99502238852f18f74db05304e67a01ee77005 (diff) | |
download | psutil-2312057d267c85185e5f49eb86bb6f90bd9ab206.tar.gz |
disable flaky test + small Makefile refact
-rw-r--r-- | .ci/README | 3 | ||||
-rw-r--r-- | .ci/appveyor/README | 2 | ||||
-rw-r--r-- | MANIFEST.in | 1 | ||||
-rw-r--r-- | Makefile | 15 | ||||
-rw-r--r-- | appveyor.yml | 2 | ||||
-rwxr-xr-x | psutil/tests/test_misc.py | 20 | ||||
-rw-r--r-- | scripts/internal/appveyor_run_with_compiler.cmd (renamed from .ci/appveyor/run_with_compiler.cmd) | 0 |
7 files changed, 20 insertions, 23 deletions
diff --git a/.ci/README b/.ci/README deleted file mode 100644 index 810fe638..00000000 --- a/.ci/README +++ /dev/null @@ -1,3 +0,0 @@ -This directory contains support scripts for Travis and Appveyor continuous -integration services. -Travis is used to run tests on Linux and macOS, Appveyor runs tests on Windows. diff --git a/.ci/appveyor/README b/.ci/appveyor/README deleted file mode 100644 index 2e092a07..00000000 --- a/.ci/appveyor/README +++ /dev/null @@ -1,2 +0,0 @@ -This directory contains support files for appveyor, a continuous integration -service which runs tests on Windows on every push. diff --git a/MANIFEST.in b/MANIFEST.in index 13ed1c17..94b2d120 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -129,6 +129,7 @@ include scripts/fans.py include scripts/free.py include scripts/ifconfig.py include scripts/internal/README +include scripts/internal/appveyor_run_with_compiler.cmd include scripts/internal/bench_oneshot.py include scripts/internal/bench_oneshot_2.py include scripts/internal/check_broken_links.py @@ -8,7 +8,7 @@ ARGS = TSCRIPT = psutil/tests/runner.py # Internal. -DEPS = \ +PY3_DEPS = \ autoflake \ autopep8 \ check-manifest \ @@ -34,8 +34,8 @@ PY2_DEPS = \ futures \ ipaddress \ mock -DEPS += `$(PYTHON) -c \ - "import sys; print('$(PY2_DEPS)' if sys.version_info[0] == 2 else '')"` +PY_DEPS = `$(PYTHON) -c \ + "import sys; print('$(PY3_DEPS)' if sys.version_info[0] == 3 else '$(PY2_DEPS)')"` # "python3 setup.py build" can be parallelized on Python >= 3.6. BUILD_OPTS = `$(PYTHON) -c \ "import sys, os; \ @@ -55,7 +55,8 @@ TEST_PREFIX = PYTHONWARNINGS=always PSUTIL_DEBUG=1 # =================================================================== clean: ## Remove all build files. - @rm -rfv `find . -type d -name __pycache__ \ + @rm -rfv `find . \ + -type d -name __pycache__ \ -o -type f -name \*.bak \ -o -type f -name \*.orig \ -o -type f -name \*.pyc \ @@ -71,10 +72,12 @@ clean: ## Remove all build files. *\@psutil-* \ .coverage \ .failed-tests.txt \ + .pytest_cache \ build/ \ dist/ \ docs/_build/ \ - htmlcov/ + htmlcov/ \ + wheelhouse .PHONY: build build: ## Compile (in parallel) without installing. @@ -115,7 +118,7 @@ setup-dev-env: ## Install GIT hooks, pip, test deps (also upgrades them). ${MAKE} install-git-hooks ${MAKE} install-pip $(PYTHON) -m pip install $(INSTALL_OPTS) --upgrade --trusted-host files.pythonhosted.org pip - $(PYTHON) -m pip install $(INSTALL_OPTS) --upgrade --trusted-host files.pythonhosted.org $(DEPS) + $(PYTHON) -m pip install $(INSTALL_OPTS) --upgrade --trusted-host files.pythonhosted.org $(PY_DEPS) # =================================================================== # Tests diff --git a/appveyor.yml b/appveyor.yml index 0752e610..70a4daec 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -13,7 +13,7 @@ environment: # SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the # /E:ON and /V:ON options are not enabled in the batch script interpreter # See: http://stackoverflow.com/a/13751649/163740 - WITH_COMPILER: "cmd /E:ON /V:ON /C .\\.ci\\appveyor\\run_with_compiler.cmd" + WITH_COMPILER: "cmd /E:ON /V:ON /C .\\scripts\\internal\\appveyor_run_with_compiler.cmd" PYTHONWARNINGS: always PYTHONUNBUFFERED: 1 PSUTIL_DEBUG: 1 diff --git a/psutil/tests/test_misc.py b/psutil/tests/test_misc.py index 1ff0f52f..44922216 100755 --- a/psutil/tests/test_misc.py +++ b/psutil/tests/test_misc.py @@ -45,10 +45,8 @@ from psutil.tests import HAS_SENSORS_BATTERY from psutil.tests import HAS_SENSORS_FANS from psutil.tests import HAS_SENSORS_TEMPERATURES from psutil.tests import PYTHON_EXE -from psutil.tests import ROOT_DIR from psutil.tests import SCRIPTS_DIR from psutil.tests import PsutilTestCase -from psutil.tests import import_module_by_path from psutil.tests import mock from psutil.tests import reload_module from psutil.tests import sh @@ -250,15 +248,15 @@ class TestMisc(PsutilTestCase): check(psutil.disk_usage(os.getcwd())) check(psutil.users()) - # XXX: https://github.com/pypa/setuptools/pull/2896 - @unittest.skipIf(APPVEYOR, "temporarily disabled due to setuptools bug") - def test_setup_script(self): - setup_py = os.path.join(ROOT_DIR, 'setup.py') - if CI_TESTING and not os.path.exists(setup_py): - return self.skipTest("can't find setup.py") - module = import_module_by_path(setup_py) - self.assertRaises(SystemExit, module.setup) - self.assertEqual(module.get_version(), psutil.__version__) + # # XXX: https://github.com/pypa/setuptools/pull/2896 + # @unittest.skipIf(APPVEYOR, "temporarily disabled due to setuptools bug") + # def test_setup_script(self): + # setup_py = os.path.join(ROOT_DIR, 'setup.py') + # if CI_TESTING and not os.path.exists(setup_py): + # return self.skipTest("can't find setup.py") + # module = import_module_by_path(setup_py) + # self.assertRaises(SystemExit, module.setup) + # self.assertEqual(module.get_version(), psutil.__version__) def test_ad_on_process_creation(self): # We are supposed to be able to instantiate Process also in case diff --git a/.ci/appveyor/run_with_compiler.cmd b/scripts/internal/appveyor_run_with_compiler.cmd index 7965f865..7965f865 100644 --- a/.ci/appveyor/run_with_compiler.cmd +++ b/scripts/internal/appveyor_run_with_compiler.cmd |