testing-cabal / testtools

Testtools - tasteful testing for python
https://testtools.readthedocs.io/en/latest/
Other
94 stars 88 forks source link

Drop support for EOL Python 2.7 #289

Closed hugovk closed 4 years ago

hugovk commented 4 years ago

For #286, once a last 2.7-supporting release is out.

Closes https://github.com/testing-cabal/testtools/issues/160 because six is no longer needed and has been removed.

Includes https://github.com/testing-cabal/testtools/pull/288, and adds a TODO for to put the version number of that last release 2.7-supporting release.

Also uses https://github.com/asottile/pyupgrade to upgrade Python syntax.

There's still some more Python 2.7-specific code that could be removed, but I wasn't so sure about that and this is already quite a large diff, so that can follow later.

rbtcollins commented 4 years ago

This universal wheel change removal is incorrect. The build has not suddenly become conditional on python version, not does it include compiled code.

I should expand on this: the point of universality for a given build is that the wheel contents are identical whether building for 2 or 3, not whether the code in wheel works on a given Python version: for instance, new Python releases, and early Python 3 releases probably don't work at all.

Indicating to pip that this new release doesn't work on 2.7 is important, but a lack of universal wheel won't do that - it will just cause pip to download the source zip instead and try to build from source.

I think the best option today is the trove markers, sadly. Every single using project will have to use PEP 508 environment markers to select old testtools if they still support Python 2.7 at all - e.g.

testtools<2.4;python_version<"3"
testtools;python_version>"2"

in their dependency list.

We probably want to document that somewhere.

hugovk commented 4 years ago

You can still create a wheel, removing universal = 1 will produce a Pure Python Wheel, instead of a Universal Wheel, and it'll have just py3 in the filename:

The current wheel has py2.py3 in the filename:

image

https://pypi.org/project/testtools/2.3.0/#files

Universal Wheels

Universal Wheels are wheels that are pure Python (i.e. contain no compiled extensions) and support Python 2 and 3. This is a wheel that can be installed anywhere by pip. ... Only use the --universal setting, if:

  • Your project runs on Python 2 and 3 with no changes (i.e. it does not require 2to3).
  • Your project does not have any C extensions.

Beware that bdist_wheel does not currently have any checks to warn if you use the setting inappropriately.

https://packaging.python.org/guides/distributing-packages-using-setuptools/#universal-wheels

Pure Python Wheels

Pure Python Wheels that are not “universal” are wheels that are pure Python (i.e. contain no compiled extensions), but don’t natively support both Python 2 and 3. ... bdist_wheel will detect that the code is pure Python, and build a wheel that’s named such that it’s usable on any Python installation with the same major version (Python 2 or Python 3) as the version you used to build the wheel.

https://packaging.python.org/guides/distributing-packages-using-setuptools/#pure-python-wheels

Example

On this PR:

$ python setup.py bdist_wheel sdist
...
$ ls -l dist
total 768
-rw-r--r--  1 hugo  wheel  180568  4 Feb 17:12 testtools-0.0.1.dev9-py3-none-any.whl
-rw-r--r--  1 hugo  wheel  207338  4 Feb 17:12 testtools-0.0.1.dev9.tar.gz
$ pip2 install dist/testtools-0.0.1.dev9-py3-none-any.whl
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
ERROR: testtools-0.0.1.dev9-py3-none-any.whl is not a supported wheel on this platform.
$ pip2 install dist/testtools-0.0.1.dev9.tar.gz
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Processing ./dist/testtools-0.0.1.dev9.tar.gz
ERROR: Package 'testtools' requires a different Python: 2.7.17 not in '>=3.5'

Uploading these to TestPyPI, so TestPyPI only contains this version:

twine upload --repository-url https://test.pypi.org/legacy/ dist/*
Uploading distributions to https://test.pypi.org/legacy/
Enter your username: hugovk
Uploading testtools-0.0.1.dev9-py3-none-any.whl
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████| 186k/186k [00:03<00:00, 58.7kB/s]
Uploading testtools-0.0.1.dev9.tar.gz
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████| 211k/211k [00:01<00:00, 116kB/s]

View at:
https://test.pypi.org/project/testtools/0.0.1.dev9/

Then trying to install (verbose) to Python 2, only from TestPyPI, fails as expected:

$ pip2 install --index-url https://test.pypi.org/simple/ testtools -v
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Non-user install because site-packages writeable
Created temporary directory: /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-ephem-wheel-cache-kdjllk
Created temporary directory: /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-req-tracker-Yk20Ha
Initialized build tracking at /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-req-tracker-Yk20Ha
Created build tracker: /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-req-tracker-Yk20Ha
Entered build tracker: /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-req-tracker-Yk20Ha
Created temporary directory: /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-install-bD_E0T
Looking in indexes: https://test.pypi.org/simple/
1 location(s) to search for versions of testtools:
* https://test.pypi.org/simple/testtools/
Fetching project page and analyzing links: https://test.pypi.org/simple/testtools/
Getting page https://test.pypi.org/simple/testtools/
Found index url https://test.pypi.org/simple/
Looking up "https://test.pypi.org/simple/testtools/" in the cache
Request header has "max_age" as 0, cache bypassed
Starting new HTTPS connection (1): test.pypi.org:443
https://test.pypi.org:443 "GET /simple/testtools/ HTTP/1.1" 304 0
  Skipping link: none of the wheel's tags match: py3-none-any: https://test-files.pythonhosted.org/packages/88/a2/80bb264c8955ba8d424920e92e6626425ce8c0ee5564e19d7afe12447fdb/testtools-0.0.1.dev9-py3-none-any.whl#sha256=7e2484b544662f456a5d270182adcc85f769712755663e0f07208b92ef16f022 (from https://test.pypi.org/simple/testtools/) (requires-python:>=3.5)
  Link requires a different Python (2.7.17 not in: u'>=3.5'): https://test-files.pythonhosted.org/packages/b1/8e/0bf8398471eec58361265f12a71df0c0440d62c290fe605a18baa6dde9f0/testtools-0.0.1.dev9.tar.gz#sha256=b69b5fc44afd4cb9abea8d3ae6d80886a27472c57ebae6112b7c90d578c51ffa (from https://test.pypi.org/simple/testtools/) (requires-python:>=3.5)
Given no hashes to check 0 links for project 'testtools': discarding no candidates
ERROR: Could not find a version that satisfies the requirement testtools (from versions: none)
Cleaning up...
Removed build tracker: '/private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-req-tracker-Yk20Ha'
ERROR: No matching distribution found for testtools
Exception information:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/pip/_internal/cli/base_command.py", line 186, in _main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/site-packages/pip/_internal/commands/install.py", line 331, in run
    resolver.resolve(requirement_set)
  File "/usr/local/lib/python2.7/site-packages/pip/_internal/legacy_resolve.py", line 177, in resolve
    discovered_reqs.extend(self._resolve_one(requirement_set, req))
  File "/usr/local/lib/python2.7/site-packages/pip/_internal/legacy_resolve.py", line 333, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/usr/local/lib/python2.7/site-packages/pip/_internal/legacy_resolve.py", line 281, in _get_abstract_dist_for
    req.populate_link(self.finder, upgrade_allowed, require_hashes)
  File "/usr/local/lib/python2.7/site-packages/pip/_internal/req/req_install.py", line 249, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "/usr/local/lib/python2.7/site-packages/pip/_internal/index/package_finder.py", line 927, in find_requirement
    'No matching distribution found for %s' % req
DistributionNotFound: No matching distribution found for testtools

And trying to install (verbose) to Python 2, from TestPyPI as primary, and main PyPI as extra, succeeds in installing testtools-2.3.0 from main PyPI:

$ pip2 install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple testtools -v
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Non-user install because site-packages writeable
Created temporary directory: /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-ephem-wheel-cache-fxSFc_
Created temporary directory: /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-req-tracker-fkYoyh
Initialized build tracking at /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-req-tracker-fkYoyh
Created build tracker: /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-req-tracker-fkYoyh
Entered build tracker: /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-req-tracker-fkYoyh
Created temporary directory: /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-install-L7lD9m
Looking in indexes: https://test.pypi.org/simple/, https://pypi.org/simple
2 location(s) to search for versions of testtools:
* https://test.pypi.org/simple/testtools/
* https://pypi.org/simple/testtools/
Fetching project page and analyzing links: https://test.pypi.org/simple/testtools/
Getting page https://test.pypi.org/simple/testtools/
Found index url https://test.pypi.org/simple/
Looking up "https://test.pypi.org/simple/testtools/" in the cache
Request header has "max_age" as 0, cache bypassed
Starting new HTTPS connection (1): test.pypi.org:443
https://test.pypi.org:443 "GET /simple/testtools/ HTTP/1.1" 304 0
  Skipping link: none of the wheel's tags match: py3-none-any: https://test-files.pythonhosted.org/packages/88/a2/80bb264c8955ba8d424920e92e6626425ce8c0ee5564e19d7afe12447fdb/testtools-0.0.1.dev9-py3-none-any.whl#sha256=7e2484b544662f456a5d270182adcc85f769712755663e0f07208b92ef16f022 (from https://test.pypi.org/simple/testtools/) (requires-python:>=3.5)
  Link requires a different Python (2.7.17 not in: u'>=3.5'): https://test-files.pythonhosted.org/packages/b1/8e/0bf8398471eec58361265f12a71df0c0440d62c290fe605a18baa6dde9f0/testtools-0.0.1.dev9.tar.gz#sha256=b69b5fc44afd4cb9abea8d3ae6d80886a27472c57ebae6112b7c90d578c51ffa (from https://test.pypi.org/simple/testtools/) (requires-python:>=3.5)
Fetching project page and analyzing links: https://pypi.org/simple/testtools/
Getting page https://pypi.org/simple/testtools/
Found index url https://pypi.org/simple
Looking up "https://pypi.org/simple/testtools/" in the cache
Request header has "max_age" as 0, cache bypassed
Starting new HTTPS connection (1): pypi.org:443
https://pypi.org:443 "GET /simple/testtools/ HTTP/1.1" 200 5822
Updating cache with response from "https://pypi.org/simple/testtools/"
Caching due to etag
  Found link https://files.pythonhosted.org/packages/b8/3b/e0e63137ef132d84f8e040b48100c429be5edcfa0d2526482be9eff23a85/testtools-0.9.9.tar.gz#sha256=d47737dc3cc5b7e8ecc1bfaa001dac28b1ae2b5e47f9f7aeceb497a36067db8d (from https://pypi.org/simple/testtools/), version: 0.9.9
  Found link https://files.pythonhosted.org/packages/37/ae/df16c9f8ae594966ae22aef68f46b4bbf29f525a830b88429d89ee1f46f1/testtools-0.9.10.tar.gz#sha256=9d810506bcf58fa7d9da099be71210c00f77d9c316bc3b7f95209046cdd716af (from https://pypi.org/simple/testtools/), version: 0.9.10
  Found link https://files.pythonhosted.org/packages/9d/f1/549ffcc105e40440a48e9201f617789700dd387dfafe1f26b109ed088dd4/testtools-0.9.11.tar.gz#sha256=45569f20a355e8a4e60f705b95ed5d06a1994a1594d0e8cbff46cea1fd15e9e6 (from https://pypi.org/simple/testtools/), version: 0.9.11
  Found link https://files.pythonhosted.org/packages/48/bb/5473e3221ea8120043f1b51956be1f13d70e06ec60c6ad0c354d0c3b43db/testtools-0.9.12.tar.gz#sha256=7b82c52889182f4ab7524b9db89ac552e1927677d861c60da9ad7ad5a38b48f8 (from https://pypi.org/simple/testtools/), version: 0.9.12
  Found link https://files.pythonhosted.org/packages/f4/2b/f3189afc814df13216cba09ee11c2211355747325ce9f022e0e1fdf7be3c/testtools-0.9.13.tar.gz#sha256=01da240b50ce7700f041bb2a567ede4e7f680dfaa61851f82a36654841231063 (from https://pypi.org/simple/testtools/), version: 0.9.13
  Found link https://files.pythonhosted.org/packages/ce/d2/15373d4db156cda1c912d31c2fb309ee818331259bb3a6751dc646662970/testtools-0.9.14.tar.gz#sha256=8fbe8736822caa3f95a3c65cf4df9e6d68aab5edd6f0adf3eebd0072d1a012cc (from https://pypi.org/simple/testtools/), version: 0.9.14
  Found link https://files.pythonhosted.org/packages/53/e6/6eb8a5c3214b1e78b2bba18d3956bde23bea73f035e41b72ef8758253f21/testtools-0.9.15.tar.gz#sha256=49ef090f09e217c9f2688d4b2f9e246f00b9c1a867040a7ae8e4e9de7f707c02 (from https://pypi.org/simple/testtools/), version: 0.9.15
  Found link https://files.pythonhosted.org/packages/6d/98/66608dc1d72230bfcdd9be31092196222e52de29beb228922f4a22971cb0/testtools-0.9.16.tar.gz#sha256=2adb021c9a15040f94af099480d8d751930ce5a2294ecbdfd0853c87cbb2e1f7 (from https://pypi.org/simple/testtools/), version: 0.9.16
  Found link https://files.pythonhosted.org/packages/e0/ba/6b1bf63aa033e89aea367de0673e703364e9b5b649ef76b39191bbb4f2f8/testtools-0.9.17.tar.gz#sha256=ac9e06be5c5bada3ac48a80f17703f959a22e421ecf614d42f39be5aa6668845 (from https://pypi.org/simple/testtools/), version: 0.9.17
  Found link https://files.pythonhosted.org/packages/f9/71/576525c61655ce1b58f784830a3b469c0ed22f64b98b571f2c5a87d15570/testtools-0.9.18.tar.gz#sha256=401a1fd5ac92f6f0de1f9569a4ab1d62718f22c2e8d691769872a4e5d5ae57bf (from https://pypi.org/simple/testtools/), version: 0.9.18
  Found link https://files.pythonhosted.org/packages/ad/73/b750c94ce6092ce9a0973604d9141ffb814d15e99bf93e946bc05c86e360/testtools-0.9.19.tar.gz#sha256=6020b89292bbd2bd97632d0b2ad2892f2cd0c81b9449494e30267817f48e0954 (from https://pypi.org/simple/testtools/), version: 0.9.19
  Found link https://files.pythonhosted.org/packages/cf/c8/effbedb99948567eb7f198a53c814ab662a724f38a2b83e35034149aa8f3/testtools-0.9.20.tar.gz#sha256=ac91ff4cb820862bab8a290f6802d7a269fc2e92be7c87ffc51a2b7047921ccd (from https://pypi.org/simple/testtools/), version: 0.9.20
  Found link https://files.pythonhosted.org/packages/80/01/e3113c8b8ed49b1fa11dbfad37448e9f43a2d83f7732c4b8d9afcdd81907/testtools-0.9.21.tar.gz#sha256=c9ec8cb335e2630f2ed274887d789fb9e0e8eeb12c9b7912f9064af1a0f936f9 (from https://pypi.org/simple/testtools/), version: 0.9.21
  Found link https://files.pythonhosted.org/packages/2c/83/d233a73ca137ffe0c21e518bfd939e7f0cb9ab57c3521f0a9c47e98a6709/testtools-0.9.22.tar.gz#sha256=e5d1ff7c8bab0e9ff6d347a68a9e5cd692db001ca4df2ce0d25dc3d229136f5b (from https://pypi.org/simple/testtools/), version: 0.9.22
  Found link https://files.pythonhosted.org/packages/05/6d/1b0173a270c981981dbf39e24c48149929d3538bff07b58e005557b5d0c9/testtools-0.9.23.tar.gz#sha256=91ee81ca251cfc070938dc4f7b86c356159d82e7ca78a9cf7ca6a4db814e64a1 (from https://pypi.org/simple/testtools/), version: 0.9.23
  Found link https://files.pythonhosted.org/packages/fa/d1/8ce45b94706d8b5ff0144293b4a651cd87b56849f8174d86feeb5477344e/testtools-0.9.24.tar.gz#sha256=a7072188727d4cefacd06bc6d87b845805300ba5d58a6fa92583abc04edbf355 (from https://pypi.org/simple/testtools/), version: 0.9.24
  Found link https://files.pythonhosted.org/packages/30/6e/82e1b05a3acb56136de7b48cf01563a15c043ceceb126b7eacec65ef2590/testtools-0.9.25.tar.gz#sha256=190eeb363779ecb2258ea00f6fb33792835b0c2989de6c5a695a081d0525f7ab (from https://pypi.org/simple/testtools/), version: 0.9.25
  Found link https://files.pythonhosted.org/packages/38/92/41c459cbb5a307f473ff03e7251501f3bc633ee2e2783503880754128ad1/testtools-0.9.26.tar.gz#sha256=10ca6f1cf66ed3bd388a80eac33cb9ef4ef41dfe7a315d62246883ccf785d8cd (from https://pypi.org/simple/testtools/), version: 0.9.26
  Found link https://files.pythonhosted.org/packages/6d/21/751955fd84768de06131cfd2e4654f9dcd0af08def8b3b9b4870f73c8474/testtools-0.9.27.tar.gz#sha256=78403a159e4df46bebc3329d302b95ce98cee1ef56a56a033ad8445de96ccc4a (from https://pypi.org/simple/testtools/), version: 0.9.27
  Found link https://files.pythonhosted.org/packages/e7/37/5001e05d9fe1d00e93d7576d7b3c2abdf6db50475362f902d07bd780986d/testtools-0.9.28.tar.gz#sha256=fd44191a2ee38680c533d987362f68bdcf48ee53c6226eae843cc2f991f53c9a (from https://pypi.org/simple/testtools/), version: 0.9.28
  Found link https://files.pythonhosted.org/packages/63/54/b6ce18203a08048b1c6f4d6513db6fcbb6d95a4d6e04f747503965a8a057/testtools-0.9.29.tar.gz#sha256=997e2d6d206de437826f85ab56cb98c198fe2d3f34275bf07a1f6a782b75d6dc (from https://pypi.org/simple/testtools/), version: 0.9.29
  Found link https://files.pythonhosted.org/packages/1e/62/ce999ca466ac3959f3203a912f92a8907ff38a0a025e6b79f32af48b91f7/testtools-0.9.30.tar.gz#sha256=69cefa19414ccb8b5f02de790cd8b8ac04a8161e445b6084b4309bdf4ac88c45 (from https://pypi.org/simple/testtools/), version: 0.9.30
  Found link https://files.pythonhosted.org/packages/da/e9/a36721afc290ee5615f3c79b2de1cb1c8b44f5c3c4d82c34f08b5d4b6467/testtools-0.9.32.tar.gz#sha256=d87b7e4cc632f4a96dcb52214ebc89e5914e8b35ab795e662ff0bb7efc98afea (from https://pypi.org/simple/testtools/), version: 0.9.32
  Found link https://files.pythonhosted.org/packages/09/71/ce28bf64a03f11c83757f1e5c29c37d88507b1a7ffb281dd959666ec64d9/testtools-0.9.33.tar.gz#sha256=5b62231fea71ccb2361d48286481b198ccb8768bf81f8aaec1c8d5fb98eaaca3 (from https://pypi.org/simple/testtools/), version: 0.9.33
  Found link https://files.pythonhosted.org/packages/3c/a9/9cbbc0e205b5f34e8812a57ebbf4ba4ba1530530c3a8231be4c4be79440f/testtools-0.9.34.tar.gz#sha256=96c5a7b51690bfe3a2610b13279644780a617a39c879a513132e362360b2da68 (from https://pypi.org/simple/testtools/), version: 0.9.34
  Found link https://files.pythonhosted.org/packages/c7/ef/a3a4bea37de8db076a99945a08fede4ed689320e6d3fa80d7b74cd2681cc/testtools-0.9.35.tar.gz#sha256=5520257639d94ed309b15cda84dfe6fc759fe0e153b35c7b6e681385b55e1778 (from https://pypi.org/simple/testtools/), version: 0.9.35
  Found link https://files.pythonhosted.org/packages/d5/e7/7621002408038eb073edb49781bf4ca70a1a4110221e6d6f53208aca2be2/testtools-0.9.36.tar.gz#sha256=20a1b0d6325f1303ff8112a272047057b73217aac85424aa4065b87641a04499 (from https://pypi.org/simple/testtools/), version: 0.9.36
  Found link https://files.pythonhosted.org/packages/ad/4a/0c51aa9b1991f7b3d39d529be84481d3a962f9c04b44fec1a64e7ea921e6/testtools-0.9.37.tar.gz#sha256=bf071857d1209c451d00a6b67e49c659e776f90ba8967d0cd149b434543a3df1 (from https://pypi.org/simple/testtools/), version: 0.9.37
  Found link https://files.pythonhosted.org/packages/bb/5c/41976306c8313bfac02e816a33392750af305ed18d3376138898c875ad97/testtools-0.9.38.tar.gz#sha256=3d51c02a65819d970e8b267f58c10a7d165d133a4046897fdb7e774286aa6024 (from https://pypi.org/simple/testtools/), version: 0.9.38
  Found link https://files.pythonhosted.org/packages/12/89/a7dd97aa8917506fbfeaa97a0fca7be7e7d1facbee658a26dcaaf345020e/testtools-0.9.39.tar.gz#sha256=c22e9d28a4b14c9e833384e28eee0d0712e684d64101bec4a5d88d0c7da4aea1 (from https://pypi.org/simple/testtools/), version: 0.9.39
  Found link https://files.pythonhosted.org/packages/94/a5/5b3e220e6350719956f83ad7a52accbb9b256489d760ace3e75e94283af0/testtools-1.0.0.tar.gz#sha256=7dadf18d54f43b02a6901b1bed9f8db8b3e0e16eac3638d39285dee991a0d5b7 (from https://pypi.org/simple/testtools/), version: 1.0.0
  Found link https://files.pythonhosted.org/packages/24/71/8a16a2bf346fcfa241241fbfb630d43647639f8e0bf26345ff4ebb63798c/testtools-1.1.0.tar.gz#sha256=61f237050738995d43cbda9f6073afed8ee5c287f38080510a8d8dfe0b6cfc53 (from https://pypi.org/simple/testtools/), version: 1.1.0
  Found link https://files.pythonhosted.org/packages/a8/9c/5790f3ba5ca5d201b2bdbf8b8d50c8a4b63f7ba990f053b17d6be0c41b67/testtools-1.2.0-py2-none-any.whl#sha256=1a806a8bc0a74b591b6a085a09f8e45b31e2fe99044d27c44f54bd897a1a4ee8 (from https://pypi.org/simple/testtools/), version: 1.2.0
  Found link https://files.pythonhosted.org/packages/5e/05/f90ef18de4c0d4e3ffadb63e9c89ea1257c7064a12ac5d255dcebd29e7b1/testtools-1.2.0.tar.gz#sha256=09fc5d0835cce4931e480d965cea247981307b962d8a9dcb428e68169ad2c092 (from https://pypi.org/simple/testtools/), version: 1.2.0
  Found link https://files.pythonhosted.org/packages/99/79/88a7f49b7d214b699b4d49ef04869e3c3e30614d3539522c17edadd8fe41/testtools-1.2.1-py2-none-any.whl#sha256=65ce98830969716861b0cc9c39a77d9939855bcacf9239c6a5407153059035a6 (from https://pypi.org/simple/testtools/), version: 1.2.1
  Found link https://files.pythonhosted.org/packages/3f/bd/1c749be450c12436f972ed041c05fd49b1db651c7f57aba19f4dbd2d2922/testtools-1.2.1.tar.gz#sha256=83dde6f4d986fc8941906d373543246c84b935a54e9b2db520ae4676857cecfc (from https://pypi.org/simple/testtools/), version: 1.2.1
  Found link https://files.pythonhosted.org/packages/9a/c6/aa91fab3853846cbe9c145b9b72204a5410e160d58fe61d36a63b8c65173/testtools-1.3.0-py2.py3-none-any.whl#sha256=ac76eea516ba0a974bd1e0f375db31c5d6aed7d80463504fc0907512a27f4274 (from https://pypi.org/simple/testtools/), version: 1.3.0
  Found link https://files.pythonhosted.org/packages/a5/84/78a2559b2985b947d931d50f7ba1eb69269ee0dcc8b2026e650202fe1762/testtools-1.3.0.tar.gz#sha256=3bf0be7c76587e8318936462438124ffb74372f3718def71fe8bd5ba28e1e394 (from https://pypi.org/simple/testtools/), version: 1.3.0
  Found link https://files.pythonhosted.org/packages/7e/7f/57931a1eaf58e9ed466050b7db78b606665a130a3792476cb61e8dd42609/testtools-1.4.0-py2.py3-none-any.whl#sha256=c87f7a3f89fd9466a9b60dd4b4356f9ac06c573937ead2ada43e13146997c597 (from https://pypi.org/simple/testtools/), version: 1.4.0
  Found link https://files.pythonhosted.org/packages/20/31/5098b76ed3b6bb45bb5f0606f3b94e4de4043136b1e5736f9c0d4c6ed8d5/testtools-1.4.0.tar.gz#sha256=0cc5f1cb1054770aaa2acdc54290ff9431e23214da70084d1aad9c6625f588ef (from https://pypi.org/simple/testtools/), version: 1.4.0
  Found link https://files.pythonhosted.org/packages/26/04/f79e4d75346cb1d48ed84c8e2533730855d96c78aab74396fb65e29d54bd/testtools-1.5.0-py2.py3-none-any.whl#sha256=49fb2a4b9fee2418d2c8e8fccc4733b3f0e2bc84aee33177e7538cdb803e7ba3 (from https://pypi.org/simple/testtools/), version: 1.5.0
  Found link https://files.pythonhosted.org/packages/62/4b/602fb7a145df95e00281765ead4f4796119f3b02694cb50c4a8a4348385e/testtools-1.5.0.tar.gz#sha256=8d22a559f15b4540e069df0d69698d5bc70d9c42c8694c5e253595d70283511a (from https://pypi.org/simple/testtools/), version: 1.5.0
  Found link https://files.pythonhosted.org/packages/80/cf/e5162b549ac4a4112c1833fed00cc6220c7b6f11f9b9b47cdc1bd5927094/testtools-1.6.0-py2.py3-none-any.whl#sha256=878b11e1742dec8516b881e2348c2e0bc91a5f3ac151d4d4527182edd2f8aad7 (from https://pypi.org/simple/testtools/), version: 1.6.0
  Found link https://files.pythonhosted.org/packages/14/b9/8610e4be32ae0d1cb5b4e0ddb9393618fcfdc8a473f3a0dba64593d3171d/testtools-1.6.0.tar.gz#sha256=221a760aa2c64b1573610db7d201e0c98082951923d7e641d8b930e302bfe218 (from https://pypi.org/simple/testtools/), version: 1.6.0
  Found link https://files.pythonhosted.org/packages/64/02/9310292b151c528c2cecf6f94fcc8181850c615ccd01705b0efc520500ec/testtools-1.6.1-py2.py3-none-any.whl#sha256=393262ddece3944b78fac31799890425a63ee01c417e5ae6e49cabbc80006340 (from https://pypi.org/simple/testtools/), version: 1.6.1
  Found link https://files.pythonhosted.org/packages/6c/53/fac2de794897331663ca5d944733f4b28241a802a9f5ab648a322c8507fb/testtools-1.6.1.tar.gz#sha256=a00723427797f20fbe8cb775d9c1f0a096302576e70bba267ce9213e4e49b03e (from https://pypi.org/simple/testtools/), version: 1.6.1
  Found link https://files.pythonhosted.org/packages/b0/9b/a98c1a5f52756c668aa7e63045e8f33b4436524e3a8e3b4e0a6a98865370/testtools-1.7.0.tar.gz#sha256=f725a1da2857c344a9f1e8f1faab2cde579abbbd67665550e565d5aa58220726 (from https://pypi.org/simple/testtools/), version: 1.7.0
  Found link https://files.pythonhosted.org/packages/cf/a6/94dd4ed94539a2a0015fc57f7c822ea5b10c4390d1c3b1cd75fd25b23b50/testtools-1.7.1-py2.py3-none-any.whl#sha256=cc96a555cd766594a9738217a7e017779e7d4f89bd0a974c5d6353a94e169a31 (from https://pypi.org/simple/testtools/), version: 1.7.1
  Found link https://files.pythonhosted.org/packages/3e/31/2db4bdfcb407f88dffa3ab6165dcca1e3596dd00bcb794fa4576a89a5efe/testtools-1.7.1.tar.gz#sha256=e9999eecf002a9fdc499ab82c13cc7b40226ed4b5fc4ed2a2c1cfb08fe23cfea (from https://pypi.org/simple/testtools/), version: 1.7.1
  Found link https://files.pythonhosted.org/packages/59/64/963f8601877dc58373613fa603d8a02ca6b640dd2e77ead12bd29372e63b/testtools-1.8.0-py2.py3-none-any.whl#sha256=5a41e3bd19e9cbe7767c2a76055d02f4bdc33e7c3a7fb6bbe47be754e776eab7 (from https://pypi.org/simple/testtools/), version: 1.8.0
  Found link https://files.pythonhosted.org/packages/0f/7a/c00e8fbb2195ce6cd5b389ed7282d8c630f681008cab6b6a6b1ed361d299/testtools-1.8.0.tar.gz#sha256=8afd6400fb4e75adb0b29bd09695ecb2024cd7befab4677a58c147701afadd97 (from https://pypi.org/simple/testtools/), version: 1.8.0
  Found link https://files.pythonhosted.org/packages/9f/68/5502c0075faa5452468ba2a215705713e7a8e5c01b3907ba8beb3a4ef209/testtools-1.8.1-py2.py3-none-any.whl#sha256=2f1957cb17095b80bea339b6782ac4be53704a20e7b3d1d22963786e1f06f59c (from https://pypi.org/simple/testtools/), version: 1.8.1
  Found link https://files.pythonhosted.org/packages/f7/7c/0929d2318a0f9540c4f78c5952fd32de2543998c657faf368d2efd70c40b/testtools-1.8.1.tar.gz#sha256=155ed29086e48156519e15f7801b702c15ba34d8700d80ba606101f448a3839f (from https://pypi.org/simple/testtools/), version: 1.8.1
  Found link https://files.pythonhosted.org/packages/ac/67/811419b9dee65f657d81e9b7c510951b3ebb02f3300330ec3f1bdb74fcc7/testtools-1.9.0-py2.py3-none-any.whl#sha256=c2d878b6a15ccd8c5cf9a04bd32dcd0557fb6ab948da8828750165f9956af777 (from https://pypi.org/simple/testtools/), version: 1.9.0
  Found link https://files.pythonhosted.org/packages/b2/b2/45737170548b4394e1fbec6dd16363d41bb1c67395962aefa0a044f95b57/testtools-1.9.0.tar.gz#sha256=b46eec2ad3da6e83d53f2b0eca9a8debb687b4f71343a074f83a16bbdb3c0644 (from https://pypi.org/simple/testtools/), version: 1.9.0
  Found link https://files.pythonhosted.org/packages/b8/31/95f9e5d0c5fb4eac3337f917a36854e26fd175c610964c8ea9b2c4b2c11d/testtools-2.0.0-py2.py3-none-any.whl#sha256=10bc0c7a23aca87f23ef5fd40cb4a8a53a0993ebdb98032de776e6274cc413db (from https://pypi.org/simple/testtools/), version: 2.0.0
  Found link https://files.pythonhosted.org/packages/67/28/d3ed649a0d6c629329d199e5c9fa323096f1ec111fa79345ec3f05f19a9c/testtools-2.0.0.tar.gz#sha256=8237ab211cdeced2ff69e7b51c66ed8b1fd2aa0b338b1749609f9567646fad57 (from https://pypi.org/simple/testtools/), version: 2.0.0
  Found link https://files.pythonhosted.org/packages/73/c9/a43fda45060107ac8147980ce654b9324c28919cf1eef57df1697096bd19/testtools-2.1.0-py2.py3-none-any.whl#sha256=2f05d4f68980c0f199942e13f82977f344082bd5545e222f7ccbf706a61f75e9 (from https://pypi.org/simple/testtools/), version: 2.1.0
  Found link https://files.pythonhosted.org/packages/d1/29/ab52c43fb751099bf364902f418a968cb251add1a0739b57e297e8cc1820/testtools-2.1.0.tar.gz#sha256=2734d641024f6eff9918a00028c42fc7aa4e36fda399be039ff5e8a3cd1f47ae (from https://pypi.org/simple/testtools/), version: 2.1.0
  Found link https://files.pythonhosted.org/packages/95/7f/24c35c97c50e91595e3d47861be016544dafdf65a2cad9379c786ac2709e/testtools-2.2.0-py2.py3-none-any.whl#sha256=9b21a293cd33853956b1d3834c294d77a6ad0ab0eb1c077f858be433f0f225bb (from https://pypi.org/simple/testtools/), version: 2.2.0
  Found link https://files.pythonhosted.org/packages/0d/72/3212c1723d49f5b58fca736dabdd2e74f38435076d943f4a642117f04d65/testtools-2.2.0.tar.gz#sha256=80f606607a6e4ce4d0e24e5b786562aa42c581906f3c070607a4265f3da65810 (from https://pypi.org/simple/testtools/), version: 2.2.0
  Found link https://files.pythonhosted.org/packages/87/74/a4d55da28d7bba6d6f49430f22a62afd8472cb24a63fa61daef80d3e821b/testtools-2.3.0-py2.py3-none-any.whl#sha256=a2be448869171b6e0f26d9544088b8b98439ec180ce272040236d570a40bcbed (from https://pypi.org/simple/testtools/), version: 2.3.0
  Found link https://files.pythonhosted.org/packages/e5/d4/9b22df94d0d5c83affe2517295c85fa2d9917f3cafa7dc7f6b1ce4135b00/testtools-2.3.0.tar.gz#sha256=5827ec6cf8233e0f29f51025addd713ca010061204fdea77484a2934690a0559 (from https://pypi.org/simple/testtools/), version: 2.3.0
Given no hashes to check 63 links for project 'testtools': discarding no candidates
Using version 2.3.0 (newest of versions: 0.9.9, 0.9.10, 0.9.11, 0.9.12, 0.9.13, 0.9.14, 0.9.15, 0.9.16, 0.9.17, 0.9.18, 0.9.19, 0.9.20, 0.9.21, 0.9.22, 0.9.23, 0.9.24, 0.9.25, 0.9.26, 0.9.27, 0.9.28, 0.9.29, 0.9.30, 0.9.32, 0.9.33, 0.9.34, 0.9.35, 0.9.36, 0.9.37, 0.9.38, 0.9.39, 1.0.0, 1.1.0, 1.2.0, 1.2.1, 1.3.0, 1.4.0, 1.5.0, 1.6.0, 1.6.1, 1.7.0, 1.7.1, 1.8.0, 1.8.1, 1.9.0, 2.0.0, 2.1.0, 2.2.0, 2.3.0)
Collecting testtools
  Created temporary directory: /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-unpack-HhRUjm
  Looking up "https://files.pythonhosted.org/packages/87/74/a4d55da28d7bba6d6f49430f22a62afd8472cb24a63fa61daef80d3e821b/testtools-2.3.0-py2.py3-none-any.whl" in the cache
  No cache entry available
  Starting new HTTPS connection (1): files.pythonhosted.org:443
  https://files.pythonhosted.org:443 "GET /packages/87/74/a4d55da28d7bba6d6f49430f22a62afd8472cb24a63fa61daef80d3e821b/testtools-2.3.0-py2.py3-none-any.whl HTTP/1.1" 200 184636
  Downloading testtools-2.3.0-py2.py3-none-any.whl (184 kB)
     |████████████████████████████████| 184 kB 5.1 MB/s eta 0:00:01  Ignoring unknown cache-control directive: immutable
  Updating cache with response from "https://files.pythonhosted.org/packages/87/74/a4d55da28d7bba6d6f49430f22a62afd8472cb24a63fa61daef80d3e821b/testtools-2.3.0-py2.py3-none-any.whl"
  Caching due to etag
     |████████████████████████████████| 184 kB 5.1 MB/s
  Added testtools from https://files.pythonhosted.org/packages/87/74/a4d55da28d7bba6d6f49430f22a62afd8472cb24a63fa61daef80d3e821b/testtools-2.3.0-py2.py3-none-any.whl#sha256=a2be448869171b6e0f26d9544088b8b98439ec180ce272040236d570a40bcbed to build tracker '/private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-req-tracker-fkYoyh'
  Removed testtools from https://files.pythonhosted.org/packages/87/74/a4d55da28d7bba6d6f49430f22a62afd8472cb24a63fa61daef80d3e821b/testtools-2.3.0-py2.py3-none-any.whl#sha256=a2be448869171b6e0f26d9544088b8b98439ec180ce272040236d570a40bcbed from build tracker '/private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-req-tracker-fkYoyh'
Requirement already satisfied: six>=1.4.0 in /usr/local/lib/python2.7/site-packages (from testtools) (1.12.0)
Requirement already satisfied: traceback2 in /usr/local/lib/python2.7/site-packages (from testtools) (1.4.0)
Requirement already satisfied: pbr>=0.11 in /usr/local/lib/python2.7/site-packages (from testtools) (3.1.1)
Requirement already satisfied: extras>=1.0.0 in /usr/local/lib/python2.7/site-packages (from testtools) (1.0.0)
Requirement already satisfied: unittest2>=1.0.0 in /usr/local/lib/python2.7/site-packages (from testtools) (1.1.0)
Requirement already satisfied: python-mimeparse in /usr/local/lib/python2.7/site-packages (from testtools) (1.6.0)
Requirement already satisfied: fixtures>=1.3.0 in /usr/local/lib/python2.7/site-packages (from testtools) (3.0.0)
Requirement already satisfied: linecache2 in /usr/local/lib/python2.7/site-packages (from traceback2->testtools) (1.0.0)
Requirement already satisfied: argparse in /usr/local/lib/python2.7/site-packages (from unittest2>=1.0.0->testtools) (1.4.0)
Installing collected packages: testtools
  Created temporary directory: /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-unpacked-wheel-HN8oFY

Successfully installed testtools-2.3.0
Cleaning up...
Removed build tracker: '/private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-req-tracker-fkYoyh'
rbtcollins commented 4 years ago

https://packaging.python.org/guides/dropping-older-python-versions/ suggests adding a python-requires version too (that will go in setup.cfg just fine I think, but if it doesn't pickup properly, putting it in setup.py would be the obvious workaround). I suspect we need a 2.3.x point release with that in specifying 2.7 compat according to the docs.

And yes. I understand that pure python wheels are possible too. My concern is looking forward to Python 4, where universal will probably again mean 'builds the same wheel for all python versions'.

I'd be interested to know what the results are with this test:

hugovk commented 4 years ago

There's already python_requires in setup.py, although it's not been released yet. A 2.3.x with it isn't a bad idea, to be on the safe side.

https://github.com/testing-cabal/testtools/blame/2d05afacd4cc9b8f5d0af14599c971895d8ef568/setup.py#L14

I'll make those tests.

hugovk commented 4 years ago

I deleted the 0.0.1 from TestPyPI, and uploaded:

Python 2

Installs 2.3.1

$ pip2 uninstall testtools -y
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Found existing installation: testtools 2.3.0
Uninstalling testtools-2.3.0:
  Successfully uninstalled testtools-2.3.0
$ pip2 install --index-url https://test.pypi.org/simple/ testtools -v
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Non-user install because site-packages writeable
Created temporary directory: /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-ephem-wheel-cache-VFQSF4
Created temporary directory: /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-req-tracker-L8xqwR
Initialized build tracking at /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-req-tracker-L8xqwR
Created build tracker: /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-req-tracker-L8xqwR
Entered build tracker: /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-req-tracker-L8xqwR
Created temporary directory: /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-install-dvOI0v
Looking in indexes: https://test.pypi.org/simple/
1 location(s) to search for versions of testtools:
* https://test.pypi.org/simple/testtools/
Fetching project page and analyzing links: https://test.pypi.org/simple/testtools/
Getting page https://test.pypi.org/simple/testtools/
Found index url https://test.pypi.org/simple/
Looking up "https://test.pypi.org/simple/testtools/" in the cache
Request header has "max_age" as 0, cache bypassed
Starting new HTTPS connection (1): test.pypi.org:443
https://test.pypi.org:443 "GET /simple/testtools/ HTTP/1.1" 200 646
Updating cache with response from "https://test.pypi.org/simple/testtools/"
Caching due to etag
  Found link https://test-files.pythonhosted.org/packages/d1/3d/1bdae0366acf2fe3f3cace47e225ff5375389ba061eca84398aea33c4689/testtools-2.3.1-py2.py3-none-any.whl#sha256=96c27655bc7711d1d11d9a1dc27a40c28be0e8bdc289ceafff4abffd7beb59e5 (from https://test.pypi.org/simple/testtools/) (requires-python:>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*), version: 2.3.1
  Found link https://test-files.pythonhosted.org/packages/41/79/895064e040c21ea7b3dc14a62c17c00e424883e25eae858c2e8f5c1f7489/testtools-2.3.1.tar.gz#sha256=42abe22279d18a37960603ffe57c604e04c29431b88778dd5bfd320b42a2e37d (from https://test.pypi.org/simple/testtools/) (requires-python:>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*), version: 2.3.1
  Link requires a different Python (2.7.17 not in: u'>=3.5'): https://test-files.pythonhosted.org/packages/31/9e/9c462dd282150001f4a03361dfe6750a16df286706938abd625f0a2658ac/testtools-2.4.0-py2.py3-none-any.whl#sha256=f9d9818d06a60adfab536260d037e5d3df555981b4fb173157ac707f7ffe4fe4 (from https://test.pypi.org/simple/testtools/) (requires-python:>=3.5)
  Link requires a different Python (2.7.17 not in: u'>=3.5'): https://test-files.pythonhosted.org/packages/db/ff/43ba11ec150195c51322141c9729f7d5fec535c524ec626619b356df62e5/testtools-2.4.0.tar.gz#sha256=e1189e5386a6fea16a22aed5ef875257a7e1f6dd03eaafcb4803d890aea55483 (from https://test.pypi.org/simple/testtools/) (requires-python:>=3.5)
Given no hashes to check 2 links for project 'testtools': discarding no candidates
Using version 2.3.1 (newest of versions: 2.3.1)
Collecting testtools
  Created temporary directory: /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-unpack-2UfvPO
  Looking up "https://test-files.pythonhosted.org/packages/d1/3d/1bdae0366acf2fe3f3cace47e225ff5375389ba061eca84398aea33c4689/testtools-2.3.1-py2.py3-none-any.whl" in the cache
  No cache entry available
  Starting new HTTPS connection (1): test-files.pythonhosted.org:443
  https://test-files.pythonhosted.org:443 "GET /packages/d1/3d/1bdae0366acf2fe3f3cace47e225ff5375389ba061eca84398aea33c4689/testtools-2.3.1-py2.py3-none-any.whl HTTP/1.1" 200 184147
  Downloading https://test-files.pythonhosted.org/packages/d1/3d/1bdae0366acf2fe3f3cace47e225ff5375389ba061eca84398aea33c4689/testtools-2.3.1-py2.py3-none-any.whl (184 kB)
     |██████████████████████████████▎ | 174 kB 6.0 MB/s eta 0:00:01  Updating cache with response from "https://test-files.pythonhosted.org/packages/d1/3d/1bdae0366acf2fe3f3cace47e225ff5375389ba061eca84398aea33c4689/testtools-2.3.1-py2.py3-none-any.whl"
  Caching due to etag
     |████████████████████████████████| 184 kB 6.0 MB/s
  Added testtools from https://test-files.pythonhosted.org/packages/d1/3d/1bdae0366acf2fe3f3cace47e225ff5375389ba061eca84398aea33c4689/testtools-2.3.1-py2.py3-none-any.whl#sha256=96c27655bc7711d1d11d9a1dc27a40c28be0e8bdc289ceafff4abffd7beb59e5 to build tracker '/private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-req-tracker-L8xqwR'
  Removed testtools from https://test-files.pythonhosted.org/packages/d1/3d/1bdae0366acf2fe3f3cace47e225ff5375389ba061eca84398aea33c4689/testtools-2.3.1-py2.py3-none-any.whl#sha256=96c27655bc7711d1d11d9a1dc27a40c28be0e8bdc289ceafff4abffd7beb59e5 from build tracker '/private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-req-tracker-L8xqwR'
Requirement already satisfied: six>=1.4.0 in /usr/local/lib/python2.7/site-packages (from testtools) (1.12.0)
Requirement already satisfied: traceback2 in /usr/local/lib/python2.7/site-packages (from testtools) (1.4.0)
Requirement already satisfied: pbr>=0.11 in /usr/local/lib/python2.7/site-packages (from testtools) (3.1.1)
Requirement already satisfied: extras>=1.0.0 in /usr/local/lib/python2.7/site-packages (from testtools) (1.0.0)
Requirement already satisfied: unittest2>=1.0.0 in /usr/local/lib/python2.7/site-packages (from testtools) (1.1.0)
Requirement already satisfied: python-mimeparse in /usr/local/lib/python2.7/site-packages (from testtools) (1.6.0)
Requirement already satisfied: fixtures>=1.3.0 in /usr/local/lib/python2.7/site-packages (from testtools) (3.0.0)
Requirement already satisfied: linecache2 in /usr/local/lib/python2.7/site-packages (from traceback2->testtools) (1.0.0)
Requirement already satisfied: argparse in /usr/local/lib/python2.7/site-packages (from unittest2>=1.0.0->testtools) (1.4.0)
Installing collected packages: testtools
  Created temporary directory: /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-unpacked-wheel-Ptn3WW

Successfully installed testtools-2.3.1
Cleaning up...
Removed build tracker: '/private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-req-tracker-L8xqwR'

Python 3

Installs 2.4.0

$ pip3 uninstall testtools -y
Found existing installation: testtools 0.0.1.dev10
Uninstalling testtools-0.0.1.dev10:
  Successfully uninstalled testtools-0.0.1.dev10
$ pip3 install --index-url https://test.pypi.org/simple/ testtools -v
Non-user install because site-packages writeable
Created temporary directory: /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-ephem-wheel-cache-3n5clebx
Created temporary directory: /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-req-tracker-ry6tf4p7
Initialized build tracking at /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-req-tracker-ry6tf4p7
Created build tracker: /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-req-tracker-ry6tf4p7
Entered build tracker: /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-req-tracker-ry6tf4p7
Created temporary directory: /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-install-pionyu2_
Looking in indexes: https://test.pypi.org/simple/
1 location(s) to search for versions of testtools:
* https://test.pypi.org/simple/testtools/
Fetching project page and analyzing links: https://test.pypi.org/simple/testtools/
Getting page https://test.pypi.org/simple/testtools/
Found index url https://test.pypi.org/simple/
Getting credentials from keyring for https://test.pypi.org/simple/
Getting credentials from keyring for test.pypi.org
Looking up "https://test.pypi.org/simple/testtools/" in the cache
Request header has "max_age" as 0, cache bypassed
Starting new HTTPS connection (1): test.pypi.org:443
https://test.pypi.org:443 "GET /simple/testtools/ HTTP/1.1" 304 0
  Found link https://test-files.pythonhosted.org/packages/d1/3d/1bdae0366acf2fe3f3cace47e225ff5375389ba061eca84398aea33c4689/testtools-2.3.1-py2.py3-none-any.whl#sha256=96c27655bc7711d1d11d9a1dc27a40c28be0e8bdc289ceafff4abffd7beb59e5 (from https://test.pypi.org/simple/testtools/) (requires-python:>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*), version: 2.3.1
  Found link https://test-files.pythonhosted.org/packages/41/79/895064e040c21ea7b3dc14a62c17c00e424883e25eae858c2e8f5c1f7489/testtools-2.3.1.tar.gz#sha256=42abe22279d18a37960603ffe57c604e04c29431b88778dd5bfd320b42a2e37d (from https://test.pypi.org/simple/testtools/) (requires-python:>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*), version: 2.3.1
  Found link https://test-files.pythonhosted.org/packages/31/9e/9c462dd282150001f4a03361dfe6750a16df286706938abd625f0a2658ac/testtools-2.4.0-py2.py3-none-any.whl#sha256=f9d9818d06a60adfab536260d037e5d3df555981b4fb173157ac707f7ffe4fe4 (from https://test.pypi.org/simple/testtools/) (requires-python:>=3.5), version: 2.4.0
  Found link https://test-files.pythonhosted.org/packages/db/ff/43ba11ec150195c51322141c9729f7d5fec535c524ec626619b356df62e5/testtools-2.4.0.tar.gz#sha256=e1189e5386a6fea16a22aed5ef875257a7e1f6dd03eaafcb4803d890aea55483 (from https://test.pypi.org/simple/testtools/) (requires-python:>=3.5), version: 2.4.0
Given no hashes to check 4 links for project 'testtools': discarding no candidates
Using version 2.4.0 (newest of versions: 2.3.1, 2.4.0)
Collecting testtools
  Created temporary directory: /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-unpack-709ast7q
  Getting credentials from keyring for test-files.pythonhosted.org
  Looking up "https://test-files.pythonhosted.org/packages/31/9e/9c462dd282150001f4a03361dfe6750a16df286706938abd625f0a2658ac/testtools-2.4.0-py2.py3-none-any.whl" in the cache
  No cache entry available
  Starting new HTTPS connection (1): test-files.pythonhosted.org:443
  https://test-files.pythonhosted.org:443 "GET /packages/31/9e/9c462dd282150001f4a03361dfe6750a16df286706938abd625f0a2658ac/testtools-2.4.0-py2.py3-none-any.whl HTTP/1.1" 200 184165
  Downloading https://test-files.pythonhosted.org/packages/31/9e/9c462dd282150001f4a03361dfe6750a16df286706938abd625f0a2658ac/testtools-2.4.0-py2.py3-none-any.whl (184 kB)
     |██████████████████████████████▎ | 174 kB 5.0 MB/s eta 0:00:01  Updating cache with response from "https://test-files.pythonhosted.org/packages/31/9e/9c462dd282150001f4a03361dfe6750a16df286706938abd625f0a2658ac/testtools-2.4.0-py2.py3-none-any.whl"
  Caching due to etag
     |████████████████████████████████| 184 kB 5.0 MB/s
  Added testtools from https://test-files.pythonhosted.org/packages/31/9e/9c462dd282150001f4a03361dfe6750a16df286706938abd625f0a2658ac/testtools-2.4.0-py2.py3-none-any.whl#sha256=f9d9818d06a60adfab536260d037e5d3df555981b4fb173157ac707f7ffe4fe4 to build tracker '/private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-req-tracker-ry6tf4p7'
  Removed testtools from https://test-files.pythonhosted.org/packages/31/9e/9c462dd282150001f4a03361dfe6750a16df286706938abd625f0a2658ac/testtools-2.4.0-py2.py3-none-any.whl#sha256=f9d9818d06a60adfab536260d037e5d3df555981b4fb173157ac707f7ffe4fe4 from build tracker '/private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-req-tracker-ry6tf4p7'
Requirement already satisfied: six>=1.4.0 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from testtools) (1.14.0)
Requirement already satisfied: extras>=1.0.0 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from testtools) (1.0.0)
Requirement already satisfied: pbr>=0.11 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from testtools) (5.4.4)
Requirement already satisfied: unittest2>=1.0.0 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from testtools) (1.1.0)
Requirement already satisfied: python-mimeparse in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from testtools) (1.6.0)
Requirement already satisfied: traceback2 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from testtools) (1.4.0)
Requirement already satisfied: fixtures>=1.3.0 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from testtools) (3.0.0)
Requirement already satisfied: argparse in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from unittest2>=1.0.0->testtools) (1.4.0)
Requirement already satisfied: linecache2 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from traceback2->testtools) (1.0.0)
Installing collected packages: testtools
  Created temporary directory: /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-unpacked-wheel-j_4twlsy
  *** Error compiling '/private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-unpacked-wheel-j_4twlsy/testtools/_compat2x.py'...
    File "/private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-unpacked-wheel-j_4twlsy/testtools/_compat2x.py", line 16
      raise exc_class, exc_obj, exc_tb
                     ^
  SyntaxError: invalid syntax

Successfully installed testtools-2.4.0
Cleaning up...
Removed build tracker: '/private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-req-tracker-ry6tf4p7'
mtreinish commented 4 years ago

@hugovk so is the takeaway there that we need to remove the universal wheel tag to maintain a working package? I have typically have been doing this with python3 packages already, just do a pure python3 wheel and not try to ship a universal wheel with python_requires. It honestly never even occurred to me to even try that.

hugovk commented 4 years ago

Remove the universal wheel flag, because the flag indicates it's for both Python 2 and 3. Without the flag, it'll be a pure Python wheel.

Keep python_requires, because this tells pip which Python 3 versions are supported, eg. 3.5+.

rbtcollins commented 4 years ago

@hugovk so is the takeaway there that we need to remove the universal wheel tag to maintain a working package? I have typically have been doing this with python3 packages already, just do a pure python3 wheel and not try to ship a universal wheel with python_requires. It honestly never even occurred to me to even try that.

Just the python_requires is the only crucial thing needed, despite a universal wheel permitting download from python2 clients - the universality of wheel really is about whether per-python source is being shipped once you get down at the bottom level of the tools; OTOH there's nothing wrong with using universal as a belt-and-braces thing: it will certainly help to eliminate the set of users with old-pip+python2, but do nothing for the set of users with old-pip + python <3.5.

hugovk commented 4 years ago

@rbtcollins Shall I drop commit https://github.com/testing-cabal/testtools/pull/289/commits/119c71003715bacd38610f4f7bd831dbae26914f?

rbtcollins commented 4 years ago

Up to @mtreinish to be honest