Skip to content

Commit

Permalink
fix #1442: use python3 as Makefile default
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Feb 27, 2019
1 parent eb05ea9 commit bcff9ae
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .ci/travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ elif [[ $TRAVIS_PYTHON_VERSION == '2.7' ]] || [[ $PYVER == 'py27' ]]; then
pip install -U ipaddress mock
fi

pip install -U coverage coveralls flake8 pep8 setuptools
pip install -U coverage coveralls flake8 setuptools
2 changes: 1 addition & 1 deletion DEVGUIDE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Some useful make commands:
.. code-block:: bash
make install # install
make setup-dev-env # install useful dev libs (pyflakes, unittest2, etc.)
make setup-dev-env # install useful dev libs (fkale8, unittest2, etc.)
make test # run unit tests
make test-memleaks # run memory leak tests
make test-coverage # run test coverage
Expand Down
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ XXXX-XX-XX
startup.
- 1433_: new Process.parents() method. (idea by Ghislain Le Meur)
- 1437_: pids() are returned in sorted order.
- 1442_: python3 is now the default interpreter used by Makefile.

**Bug fixes**

Expand Down
19 changes: 5 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# To use a specific Python version run: "make install PYTHON=python3.3"
# You can set the variables below from the command line.

PYTHON = python
PYTHON = python3
TSCRIPT = psutil/tests/__main__.py
ARGS =
# List of nice-to-have dev libs.
Expand All @@ -14,9 +14,7 @@ DEPS = \
futures \
ipaddress \
mock==1.0.1 \
pep8 \
perf \
pyflakes \
requests \
setuptools \
sphinx \
Expand Down Expand Up @@ -166,13 +164,6 @@ test-coverage: ## Run test coverage.
# Linters
# ===================================================================

pep8: ## PEP8 linter.
@git ls-files | grep \\.py$ | xargs $(PYTHON) -m pep8

pyflakes: ## Pyflakes linter.
@export PYFLAKES_NODOCTEST=1 && \
git ls-files | grep \\.py$ | xargs $(PYTHON) -m pyflakes

flake8: ## flake8 linter.
@git ls-files | grep \\.py$ | xargs $(PYTHON) -m flake8

Expand Down Expand Up @@ -247,16 +238,16 @@ generate-manifest: ## Generates MANIFEST.in file.
# ===================================================================

print-announce: ## Print announce of new release.
@$(TEST_PREFIX) $(PYTHON) scripts/internal/print_announce.py
@$(PYTHON) scripts/internal/print_announce.py

print-timeline: ## Print releases' timeline.
@$(TEST_PREFIX) $(PYTHON) scripts/internal/print_timeline.py
@$(PYTHON) scripts/internal/print_timeline.py

print-access-denied: ## Print AD exceptions
@$(TEST_PREFIX) $(PYTHON) scripts/internal/print_access_denied.py
@$(PYTHON) scripts/internal/print_access_denied.py

print-api-speed: ## Benchmark all API calls
@$(TEST_PREFIX) $(PYTHON) scripts/internal/print_api_speed.py $(ARGS)
@$(PYTHON) scripts/internal/print_api_speed.py $(ARGS)

# ===================================================================
# Misc
Expand Down
9 changes: 6 additions & 3 deletions scripts/internal/print_api_speed.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ def run():
# --- system

public_apis = []
ignore = ('wait_procs', 'process_iter', 'win_service_get',
'win_service_iter')
ignore = ['wait_procs', 'process_iter', 'win_service_get',
'win_service_iter']
if psutil.MACOS:
ignore.append('net_connections') # raises AD
for name in psutil.__all__:
obj = getattr(psutil, name, None)
if inspect.isfunction(obj):
Expand All @@ -88,11 +90,12 @@ def run():
print_timings()

# --- process

print(titlestr("\nPROCESS APIS"))
ignore = ['send_signal', 'suspend', 'resume', 'terminate', 'kill', 'wait',
'as_dict', 'parent', 'parents', 'memory_info_ex', 'oneshot',
'pid', 'rlimit']
if psutil.MACOS:
ignore.append('memory_maps') # XXX
p = psutil.Process()
for name in sorted(dir(p)):
if not name.startswith('_') and name not in ignore:
Expand Down

0 comments on commit bcff9ae

Please sign in to comment.