Skip to content

Commit 48ac1a0

Browse files
committed
Merge branch 'remove-old-entry-points' into features
2 parents db9b3e9 + b953660 commit 48ac1a0

File tree

2 files changed

+9
-24
lines changed

2 files changed

+9
-24
lines changed

CHANGELOG.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@
9797
Example '-o xfail_strict=True'. A complete ini-options can be viewed
9898
by py.test --help. Thanks `@blueyed`_ and `@fengxx`_ for the PR
9999

100+
* Remove all py.test-X* entry points. The versioned, suffixed entry points
101+
were never documented and a leftover from a pre-virtualenv era. These entry
102+
points also created broken entry points in wheels, so removing them also
103+
removes a source of confusion for users (`#1632`_).
104+
Thanks `@obestwalter`_ for the PR.
100105

101106
**Changes**
102107

@@ -161,6 +166,7 @@
161166
fixtures into one. Thanks to `@hpk42`_ and `@hackebrot`_.
162167

163168

169+
.. _#1632: https://github.com/pytest-dev/pytest/issues/1632
164170
.. _#1580: https://github.com/pytest-dev/pytest/pull/1580
165171
.. _#1605: https://github.com/pytest-dev/pytest/issues/1605
166172
.. _#1597: https://github.com/pytest-dev/pytest/pull/1597
@@ -174,6 +180,7 @@
174180
.. _@Vogtinator: https://github.com/Vogtinator
175181
.. _@blueyed: https://github.com/blueyed
176182
.. _@fengxx: https://github.com/fengxx
183+
.. _@obestwalter: https://github.com/obestwalter
177184

178185
* Fix `#1421`_: Exit tests if a collection error occurs and add
179186
``--continue-on-collection-errors`` option to restore previous behaviour.

setup.py

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ def main():
6969
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
7070
author='Holger Krekel, Bruno Oliveira, Ronny Pfannschmidt, Floris Bruynooghe, Brianna Laugher, Florian Bruhin and others',
7171
author_email='holger at merlinux.eu',
72-
entry_points=make_entry_points(),
72+
entry_points={'console_scripts':
73+
['pytest=pytest:main', 'py.test=pytest:main']},
7374
classifiers=classifiers,
7475
cmdclass={'test': PyTest},
7576
# the following should be enabled for release
@@ -81,29 +82,6 @@ def main():
8182
)
8283

8384

84-
def cmdline_entrypoints(versioninfo, platform, basename):
85-
target = 'pytest:main'
86-
if platform.startswith('java'):
87-
points = {'py.test-jython': target}
88-
else:
89-
if basename.startswith('pypy'):
90-
points = {'py.test-%s' % basename: target}
91-
else: # cpython
92-
points = {'py.test-%s.%s' % versioninfo[:2] : target}
93-
points['py.test'] = target
94-
points['pytest'] = target
95-
return points
96-
97-
98-
def make_entry_points():
99-
basename = os.path.basename(sys.executable)
100-
points = cmdline_entrypoints(sys.version_info, sys.platform, basename)
101-
keys = list(points.keys())
102-
keys.sort()
103-
l = ['%s = %s' % (x, points[x]) for x in keys]
104-
return {'console_scripts': l}
105-
106-
10785
class PyTest(Command):
10886
user_options = []
10987
def initialize_options(self):

0 commit comments

Comments
 (0)