From ebfbfd4f83631b15f42fc510f91144dece117a08 Mon Sep 17 00:00:00 2001 From: Bhavam Vidyathi Date: Sun, 2 Feb 2020 15:38:19 +0530 Subject: [PATCH 1/6] removed tests/scripts folder with its contents --- tests/scripts/test_all_pip.py | 139 ---------------------------------- 1 file changed, 139 deletions(-) delete mode 100644 tests/scripts/test_all_pip.py diff --git a/tests/scripts/test_all_pip.py b/tests/scripts/test_all_pip.py deleted file mode 100644 index 18c97f1c819..00000000000 --- a/tests/scripts/test_all_pip.py +++ /dev/null @@ -1,139 +0,0 @@ -import os -import re -import subprocess -import sys -from os.path import abspath, dirname - -from pip._vendor.six.moves.urllib import request as urllib_request - -from pip._internal.utils.misc import rmtree - -src_folder = dirname(dirname(abspath(__file__))) - -if sys.platform == 'win32': - bin_dir = 'Scripts' -else: - bin_dir = 'bin' - - -def all_projects(): - data = urllib_request.urlopen('http://pypi.org/simple/').read() - projects = [m.group(1) for m in re.finditer(r'(.+)', data)] - return projects - - -def main(args=None): - if args is None: - args = sys.argv[1:] - if not args: - print('Usage: test_all_pip.py ') - sys.exit(1) - output = os.path.abspath(args[0]) - if not os.path.exists(output): - print('Creating %s' % output) - os.makedirs(output) - pending_fn = os.path.join(output, 'pending.txt') - if not os.path.exists(pending_fn): - print('Downloading pending list') - projects = all_projects() - print('Found %s projects' % len(projects)) - with open(pending_fn, 'w') as f: - for name in projects: - f.write(name + '\n') - print('Starting testing...') - while os.stat(pending_fn).st_size: - _test_packages(output, pending_fn) - print('Finished all pending!') - - -def _test_packages(output, pending_fn): - package = get_last_item(pending_fn) - print('Testing package %s' % package) - dest_dir = os.path.join(output, package) - print('Creating virtualenv in %s' % dest_dir) - create_venv(dest_dir) - print('Uninstalling actual pip') - code = subprocess.check_call([ - os.path.join(dest_dir, bin_dir, 'pip'), - 'uninstall', - '-y', - 'pip', - ]) - assert not code, 'pip uninstallation failed' - print('Installing development pip') - code = subprocess.check_call( - [ - os.path.join(dest_dir, bin_dir, 'python'), - 'setup.py', - 'install' - ], - cwd=src_folder, - ) - assert not code, 'pip installation failed' - print('Trying installation of %s' % dest_dir) - code = subprocess.check_call([ - os.path.join(dest_dir, bin_dir, 'pip'), - 'install', - package, - ]) - if code: - print('Installation of %s failed' % package) - print('Now checking easy_install...') - create_venv(dest_dir) - code = subprocess.check_call([ - os.path.join(dest_dir, bin_dir, 'easy_install'), - package, - ]) - if code: - print('easy_install also failed') - add_package(os.path.join(output, 'easy-failure.txt'), package) - else: - print('easy_install succeeded') - add_package(os.path.join(output, 'failure.txt'), package) - pop_last_item(pending_fn, package) - else: - print('Installation of %s succeeded' % package) - add_package(os.path.join(output, 'success.txt'), package) - pop_last_item(pending_fn, package) - rmtree(dest_dir) - - -def create_venv(dest_dir): - if os.path.exists(dest_dir): - rmtree(dest_dir) - print('Creating virtualenv in %s' % dest_dir) - code = subprocess.check_call([ - 'virtualenv', - '--no-site-packages', - dest_dir, - ]) - assert not code, "virtualenv failed" - - -def get_last_item(fn): - f = open(fn, 'r') - lines = f.readlines() - f.close() - return lines[-1].strip() - - -def pop_last_item(fn, line=None): - f = open(fn, 'r') - lines = f.readlines() - f.close() - if line: - assert lines[-1].strip() == line.strip() - lines.pop() - f = open(fn, 'w') - f.writelines(lines) - f.close() - - -def add_package(filename, package): - f = open(filename, 'a') - f.write(package + '\n') - f.close() - - -if __name__ == '__main__': - main() From db49d669964599b2c1458795465e62f7197f8632 Mon Sep 17 00:00:00 2001 From: Bhavam Vidyathi Date: Sun, 2 Feb 2020 16:26:57 +0530 Subject: [PATCH 2/6] included required news file --- news/7659.removal | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/7659.removal diff --git a/news/7659.removal b/news/7659.removal new file mode 100644 index 00000000000..1bb3788d8db --- /dev/null +++ b/news/7659.removal @@ -0,0 +1 @@ +removed unused module test_all_pip and its associated folder. \ No newline at end of file From cd63a3efdddee48e887be73493a835a8675c67b9 Mon Sep 17 00:00:00 2001 From: Bhavam Vidyathi Date: Sun, 2 Feb 2020 16:27:52 +0530 Subject: [PATCH 3/6] included required news file --- news/{7659.removal => 7680.removal} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename news/{7659.removal => 7680.removal} (100%) diff --git a/news/7659.removal b/news/7680.removal similarity index 100% rename from news/7659.removal rename to news/7680.removal From 81d6a1b00834f203241a8ab9b8a5a4956153ed0c Mon Sep 17 00:00:00 2001 From: Bhavam Vidyathi Date: Sun, 2 Feb 2020 16:45:01 +0530 Subject: [PATCH 4/6] added newline to created news file --- news/7680.removal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/7680.removal b/news/7680.removal index 1bb3788d8db..aa35c05d805 100644 --- a/news/7680.removal +++ b/news/7680.removal @@ -1 +1 @@ -removed unused module test_all_pip and its associated folder. \ No newline at end of file +removed unused module test_all_pip and its associated folder. From f95100285cc090d9452867f35ecb2cc153768a17 Mon Sep 17 00:00:00 2001 From: Bhavam Vidyathi Date: Sun, 2 Feb 2020 22:52:48 +0530 Subject: [PATCH 5/6] removed scripts/ bullet point under test/ from developer docs --- docs/html/development/architecture/anatomy.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/html/development/architecture/anatomy.rst b/docs/html/development/architecture/anatomy.rst index 9613460b0cb..7415358451b 100644 --- a/docs/html/development/architecture/anatomy.rst +++ b/docs/html/development/architecture/anatomy.rst @@ -50,7 +50,6 @@ The ``README``, license, ``pyproject.toml``, ``setup.py``, and so on are in the * ``data/`` *[test data for running tests -- pesudo package index in it! Lots of small packages that are invalid or are valid. Test fixtures. Used by functional tests]* * ``functional/`` *[functional tests of pip’s CLI -- end-to-end, invoke pip in subprocess & check results of execution against desired result. This also is what makes test suite slow]* * ``lib/`` *[helpers for tests]* - * ``scripts/`` *[will probably die in future in a refactor -- scripts for running all of the tests, but we use pytest now. Someone could make a PR to remove this! Good first issue!]* * ``unit/`` *[unit tests -- fast and small and nice!]* * ``yaml/`` *[resolver tests! They’re written in YAML. This folder just contains .yaml files -- actual code for reading/running them is in lib/yaml.py . This is fine!]* From 9bac66998313ced846a308ead5bf2bbca6c005e5 Mon Sep 17 00:00:00 2001 From: Bhavam Vidyathi Date: Mon, 3 Feb 2020 00:07:16 +0530 Subject: [PATCH 6/6] updated news file entry news/7680.removal --- news/7680.removal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/7680.removal b/news/7680.removal index aa35c05d805..7d582156f23 100644 --- a/news/7680.removal +++ b/news/7680.removal @@ -1 +1 @@ -removed unused module test_all_pip and its associated folder. +Remove unused ``tests/scripts/test_all_pip.py`` test script and the ``tests/scripts`` folder.