Skip to content

Commit 1356623

Browse files
committed
removed pip dependency
1 parent ad05269 commit 1356623

File tree

4 files changed

+23
-14
lines changed

4 files changed

+23
-14
lines changed

CHANGELOG

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
1.6.0 (dev)
22
-----------
3-
* drop suport python 2.6
3+
* removed pip dependency
4+
* drop support pytest<3.0
45

56
1.5.1
67
-----

README.rst

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Print environment variables, package version and generic attributes,
1212
as they are at the begining of the test.
1313

1414
Useful in the continuous integration to dump test
15-
configuration/environment and or to check is attributes are properly set
15+
configuration/environment and or to check if attributes are properly set
1616
(ie. you change environment with `os.environ`)
1717

1818

@@ -25,10 +25,6 @@ install via::
2525

2626

2727

28-
The plugin provides ability to print some extra information prior to run the tests.
29-
30-
31-
3228
Examples
3329
========
3430

@@ -57,6 +53,7 @@ Dump package version
5753
pytest_echo: 0.1
5854
plugins: echo, pydev, cov, cache, django
5955
56+
6057
.. warning:: The first attempt to retrieve the version is done via setuptools
6158
if it fails, the module is imported (``__import__(package)``) to retrieve the version reading
6259
``get_version``, ``__version__``, ``VERSION``, ``version`` so any module

pytest_echo.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11
# -*- coding: utf-8 -*-
22
from __future__ import print_function
3+
34
import fnmatch
45
import os
56
from pprint import pformat
67

7-
import pip
8+
import pkg_resources
89
from pkg_resources import DistributionNotFound
910

1011
__version__ = '1.6.0'
1112

1213

14+
def get_installed_distributions():
15+
"""
16+
Return a list of installed Distribution objects.
17+
"""
18+
return [d for d in pkg_resources.working_set]
19+
20+
1321
def get_attr(obj, attr, default='NOT FOUND'):
1422
"""Recursive get object's attribute. May use dot notation.
1523
@@ -105,7 +113,7 @@ def get_env(var_name):
105113
def get_version(package_name):
106114
if '*' in package_name:
107115
targets = [(i.key, i.version)
108-
for i in pip.get_installed_distributions()
116+
for i in get_installed_distributions()
109117
if fnmatch.fnmatch(i.key, package_name)]
110118
else:
111119
targets = [(package_name, _get_version(package_name))]

tox.ini

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
[tox]
2-
envlist=py27,py33,py34,py35,py36,pypy
2+
envlist=py{27,35,36}-pytest{30,31,32,33,34,35}
33

44
[testenv]
55
deps =
6-
py{27,33},pypy: django<2
7-
py{34,35,36}: django
8-
py{33,34}: pytest<3
9-
py{33,34}: py<1.5
106
coverage
7+
py{27,33},pypy: django<2
8+
py{34,35,36}: django>=2
9+
pytest30: pytest>=3.0,<3.1
10+
pytest31: pytest>=3.1,<3.2
11+
pytest32: pytest>=3.2,<3.3
12+
pytest33: pytest>=3.3,<3.4
13+
pytest34: pytest>=3.4,<3.5
14+
pytest35: pytest>=3.5,<3.6
1115

1216
commands =
13-
; py.test --pyargs test_echo.py
1417
pip install -e .
1518
coverage run -m py.test test_echo.py pytest_echo.py
1619
coverage report

0 commit comments

Comments
 (0)