From 2b914e46b2ca43eef8d94c70745112bf7548c017 Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Sat, 14 Nov 2020 01:09:11 +0100 Subject: update doc --- .github/workflows/build_wheel.yml | 4 +-- INSTALL.rst | 64 ++++++++++++++++++++++++--------------- Makefile | 4 +-- 3 files changed, 43 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build_wheel.yml b/.github/workflows/build_wheel.yml index 157e4be0..e6b81a99 100644 --- a/.github/workflows/build_wheel.yml +++ b/.github/workflows/build_wheel.yml @@ -17,8 +17,8 @@ jobs: CIBW_TEST_COMMAND: python -u -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 - # https://cibuildwheel.readthedocs.io/en/stable/options/ - CIBW_SKIP: cp35-* pp*-win32* pp37* + # https://cibuildwheel.readthedocs.io/en/stable/options/#build-skip + CIBW_SKIP: cp35-* pp* steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 diff --git a/INSTALL.rst b/INSTALL.rst index 9e145b85..a4f2bf11 100644 --- a/INSTALL.rst +++ b/INSTALL.rst @@ -1,12 +1,38 @@ -Linux, Windows, macOS -===================== +Linux, Windows, macOS (wheels) +============================== -Wheel binaries are provided for these platforms, so all you have to do is this:: +psutil makes extensive use of C extension modules, meaning a C compiler is +required. +For these 3 platforms though, pre-compiled cPython wheels are provided on each +psutil release, so all you have to do is this:: - python3 -m pip install psutil + pip3 install psutil + +If wheels are not available and you whish to install from sources, keep reading. + +Linux (install from sources) +============================ + +Ubuntu / Debian:: + + sudo apt-get install gcc python3-dev + pip3 install --user psutil --no-binary :all: + +RedHat / CentOS:: + + sudo yum install gcc python3-devel + pip3 install --user psutil --no-binary :all: + +Windows (install from sources) +============================== -If you whish to install from sources instead, take a look at the -`dev guide `__. +In order to compile psutil on Windows you'll need **Visual Studio**. +Here's a couple of guides describing how to do it: `1 `__ +and `2 `__. And then:: + + pip3 install --user psutil --no-binary :all: + +Note that MinGW compiler is not supported. FreeBSD ======= @@ -47,16 +73,6 @@ Install:: pkg install gcc python3 -m pip install psutil - -Install from sources -==================== - -:: - - git clone https://github.com/giampaolo/psutil.git - cd psutil - python3 setup.py install - Testing installation ==================== @@ -73,14 +89,13 @@ Install pip =========== Pip is shipped by default with Python 2.7.9+ and 3.4+. -For other Python versions you can install it manually. -On Linux or via wget:: +If you don't have it you can install with wget:: - wget https://bootstrap.pypa.io/get-pip.py -O - | python + wget https://bootstrap.pypa.io/get-pip.py -O - | python3 -On macOS or via curl:: +...ow with curl:: - python < <(curl -s https://bootstrap.pypa.io/get-pip.py) + python3 < <(curl -s https://bootstrap.pypa.io/get-pip.py) On Windows, `download pip `__, open cmd.exe and install it:: @@ -90,12 +105,11 @@ cmd.exe and install it:: Permission issues (UNIX) ======================== -The commands below assume you're running as root. -If you aren't or you bump into permission errors you can either install psutil -for your user only:: +If you bump into permission errors you have two options. +Install psutil for your user only:: pip3 install --user psutil -...or prepend ``sudo`` and install it globally, e.g.:: +...or prepend ``sudo`` and install it at system level:: sudo pip3 install psutil diff --git a/Makefile b/Makefile index 7ec0b808..06ec7ea8 100644 --- a/Makefile +++ b/Makefile @@ -220,7 +220,7 @@ download-wheels-github: ## Download latest wheels hosted on github. download-wheels: ## Download wheels from github and appveyor rm -rf dist - ${MAKE} download-wheels-appveyor + # ${MAKE} download-wheels-appveyor ${MAKE} download-wheels-github ${MAKE} print-wheels @@ -279,9 +279,9 @@ pre-release: ## Check if we're ready to produce a new release. assert ver in doc, '%r not in docs/index.rst' % ver; \ assert ver in history, '%r not in HISTORY.rst' % ver; \ assert 'XXXX' not in history, 'XXXX in HISTORY.rst';" - $(PYTHON) -c "import subprocess, sys; out = subprocess.check_output('git diff --quiet && git diff --cached --quiet', shell=True).strip(); sys.exit('there are uncommitted changes:\n%s' % out) if out else 0 ;" release: ## Create a release (down/uploads tar.gz, wheels, git tag release). + $(PYTHON) -c "import subprocess, sys; out = subprocess.check_output('git diff --quiet && git diff --cached --quiet', shell=True).strip(); sys.exit('there are uncommitted changes:\n%s' % out) if out else 0 ;" $(PYTHON) -m twine upload dist/* # upload tar.gz and Windows wheels on PyPI ${MAKE} git-tag-release ${MAKE} tidelift-relnotes -- cgit v1.2.1