From 4b2318b367048625dc80865967cf3e9efbc6636c Mon Sep 17 00:00:00 2001 From: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Date: Sat, 13 Feb 2021 17:14:11 +0530 Subject: [PATCH 1/6] chore: Install typing-extensions only on python_version<=3.8 --- setup.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/setup.py b/setup.py index f9d48dccc..b90efcec8 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,6 @@ import shutil import subprocess import sys -import typing import zipfile import setuptools @@ -29,13 +28,11 @@ with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() -NoneType = type(None) - -def extractall(zip: typing.Any, path: str) -> NoneType: +def extractall(zip: zipfile.ZipFile, path: str) -> None: for name in zip.namelist(): member = zip.getinfo(name) - extracted_path = zip._extract_member(member, path, None) + extracted_path = zip.extract(member, path, None) attr = member.external_attr >> 16 if attr != 0: os.chmod(extracted_path, attr) @@ -90,7 +87,7 @@ def run(self) -> None: shutil.copy(base_wheel_location, wheel_location) with zipfile.ZipFile(wheel_location, "a") as zip: driver_root = os.path.abspath(f"driver/{platform}") - for dir_path, dirs, files in os.walk(driver_root): + for dir_path, _, files in os.walk(driver_root): for file in files: from_path = os.path.join(dir_path, file) to_path = os.path.relpath(from_path, driver_root) @@ -115,7 +112,11 @@ def run(self) -> None: url="https://github.com/Microsoft/playwright-python", packages=["playwright"], include_package_data=True, - install_requires=["greenlet==1.0.0", "pyee>=8.0.1", "typing-extensions"], + install_requires=[ + "greenlet==1.0.0", + "pyee>=8.0.1", + "typing-extensions;python_version<='3.8'", + ], classifiers=[ "Topic :: Software Development :: Testing", "Topic :: Internet :: WWW/HTTP :: Browsers", @@ -134,7 +135,7 @@ def run(self) -> None: "write_to": "playwright/_repo_version.py", "write_to_template": 'version = "{version}"\n', }, - setup_requires=["setuptools_scm"], + setup_requires=["setuptools_scm", "wheel"], entry_points={ "console_scripts": [ "playwright=playwright.__main__:main", From 6196efe59349c7ac23157288c47b67b006e98f81 Mon Sep 17 00:00:00 2001 From: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Date: Sat, 13 Feb 2021 18:43:26 +0530 Subject: [PATCH 2/6] Update setup.py Co-authored-by: Max Schmitt --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b90efcec8..faddc7c9a 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ def extractall(zip: zipfile.ZipFile, path: str) -> None: for name in zip.namelist(): member = zip.getinfo(name) - extracted_path = zip.extract(member, path, None) + extracted_path = zip.extract(member, path) attr = member.external_attr >> 16 if attr != 0: os.chmod(extracted_path, attr) From 32f696438acd28aa7801c0923974f96cbdda7e6d Mon Sep 17 00:00:00 2001 From: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Date: Sat, 13 Feb 2021 18:52:55 +0530 Subject: [PATCH 3/6] chore: Use pathlib --- setup.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index faddc7c9a..88630d3c1 100644 --- a/setup.py +++ b/setup.py @@ -18,6 +18,7 @@ import subprocess import sys import zipfile +from pathlib import Path import setuptools from wheel.bdist_wheel import bdist_wheel as BDistWheelCommand @@ -25,10 +26,6 @@ driver_version = "1.9.0-next-1612400196000" -with open("README.md", "r", encoding="utf-8") as fh: - long_description = fh.read() - - def extractall(zip: zipfile.ZipFile, path: str) -> None: for name in zip.namelist(): member = zip.getinfo(name) @@ -107,7 +104,7 @@ def run(self) -> None: author="Microsoft Corporation", author_email="", description="A high-level API to automate web browsers", - long_description=long_description, + long_description=Path("README.md").read_text(encoding="utf-8"), long_description_content_type="text/markdown", url="https://github.com/Microsoft/playwright-python", packages=["playwright"], From 8ba800049e0f7882145357411443e918d04ae2c4 Mon Sep 17 00:00:00 2001 From: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Date: Sat, 27 Feb 2021 15:17:25 +0530 Subject: [PATCH 4/6] Bumps deps --- .github/workflows/ci.yml | 2 +- .pre-commit-config.yaml | 8 ++++---- local-requirements.txt | 27 ++++++++++++++------------- setup.py | 15 +++++++++++++++ 4 files changed, 34 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a92dc2e1b..e17ca9701 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: - name: Install browsers run: python -m playwright install - name: Lint - run: pre-commit run --all-files + run: pre-commit run --all-files --show-diff-on-failure - name: Generate APIs run: bash scripts/update_api.sh - name: Verify API is up to date diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fb427c8f3..722ddf264 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.2.0 + rev: v3.4.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -13,14 +13,14 @@ repos: hooks: - id: black - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.782 + rev: v0.812 hooks: - id: mypy - repo: https://gitlab.com/pycqa/flake8 - rev: '3.8.3' + rev: 3.8.4 hooks: - id: flake8 - repo: https://github.com/pycqa/isort - rev: 5.5.4 + rev: 5.7.0 hooks: - id: isort diff --git a/local-requirements.txt b/local-requirements.txt index 2c29f2fec..030c7eddf 100644 --- a/local-requirements.txt +++ b/local-requirements.txt @@ -1,21 +1,22 @@ -autobahn==20.7.1 -pytest==6.1.0 +autobahn==21.2.2 +pytest==6.2.2 pytest-asyncio==0.14.0 -pytest-cov==2.10.1 +pytest-cov==2.11.1 pytest-sugar==0.9.4 -pytest-xdist==2.1.0 +pytest-xdist==2.2.1 pytest-timeout==1.4.2 flaky==3.7.0 -pixelmatch==0.2.1 -Pillow==8.0.0 -mypy==0.782 -setuptools==50.3.0 +pixelmatch==0.2.3 +Pillow==8.1.0 +mypy==0.812 +setuptools==53.1.0 # TODO: use PyPi version after >20.3.0 is released git+https://github.com/twisted/twisted.git@4ff22287cab3b54f51cee41ea2619e72d1bff2e4 -wheel==0.35.1 +wheel==0.36.2 +auditwheel==3.3.1 black==20.8b1 -pre-commit==2.7.1 -flake8==3.8.3 -twine==3.2.0 -pyOpenSSL==19.1.0 +pre-commit==2.10.1 +flake8==3.8.4 +twine==3.3.0 +pyOpenSSL==20.0.1 service_identity==18.1.0 diff --git a/setup.py b/setup.py index dc721b244..2578c85b6 100644 --- a/setup.py +++ b/setup.py @@ -21,13 +21,16 @@ import zipfile import setuptools +from auditwheel.wheeltools import InWheel from wheel.bdist_wheel import bdist_wheel as BDistWheelCommand driver_version = "1.9.0-1614037901000" + with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() + NoneType = type(None) @@ -101,6 +104,18 @@ def run(self) -> None: zip.writestr("playwright/driver/README.md", "Universal Mac package") os.remove(base_wheel_location) + for whlfile in glob.glob("dist/*.whl"): + + os.makedirs("wheelhouse", exist_ok=True) + with InWheel( + in_wheel=whlfile, + out_wheel=os.path.join("wheelhouse", os.path.basename(whlfile)), + ret_self=True, + ): + print("Updating RECORD file of %s" % whlfile) + shutil.rmtree("dist") + print("Copying new wheels") + shutil.move("wheelhouse", "dist") setuptools.setup( From 6157ece63764ab68dec8fdd0716c983e1f7811ed Mon Sep 17 00:00:00 2001 From: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Date: Sat, 27 Feb 2021 15:44:46 +0530 Subject: [PATCH 5/6] Revert "Merge branch 'master' of https://github.com/kumaraditya303/playwright-python" This reverts commit 16b7dd2c41123800293d805f3a517c7014687296, reversing changes made to 8ba800049e0f7882145357411443e918d04ae2c4. --- setup.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/setup.py b/setup.py index 4d4d4462f..2578c85b6 100644 --- a/setup.py +++ b/setup.py @@ -17,8 +17,8 @@ import shutil import subprocess import sys +import typing import zipfile -from pathlib import Path import setuptools from auditwheel.wheeltools import InWheel @@ -27,10 +27,17 @@ driver_version = "1.9.0-1614037901000" -def extractall(zip: zipfile.ZipFile, path: str) -> None: +with open("README.md", "r", encoding="utf-8") as fh: + long_description = fh.read() + + +NoneType = type(None) + + +def extractall(zip: typing.Any, path: str) -> NoneType: for name in zip.namelist(): member = zip.getinfo(name) - extracted_path = zip.extract(member, path) + extracted_path = zip._extract_member(member, path, None) attr = member.external_attr >> 16 if attr != 0: os.chmod(extracted_path, attr) @@ -84,7 +91,7 @@ def run(self) -> None: shutil.copy(base_wheel_location, wheel_location) with zipfile.ZipFile(wheel_location, "a") as zip: driver_root = os.path.abspath(f"driver/{platform}") - for dir_path, _, files in os.walk(driver_root): + for dir_path, dirs, files in os.walk(driver_root): for file in files: from_path = os.path.join(dir_path, file) to_path = os.path.relpath(from_path, driver_root) @@ -116,16 +123,12 @@ def run(self) -> None: author="Microsoft Corporation", author_email="", description="A high-level API to automate web browsers", - long_description=Path("README.md").read_text(encoding="utf-8"), + long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/Microsoft/playwright-python", packages=["playwright"], include_package_data=True, - install_requires=[ - "greenlet==1.0.0", - "pyee>=8.0.1", - "typing-extensions;python_version<='3.8'", - ], + install_requires=["greenlet==1.0.0", "pyee>=8.0.1", "typing-extensions"], classifiers=[ "Topic :: Software Development :: Testing", "Topic :: Internet :: WWW/HTTP :: Browsers", @@ -144,7 +147,7 @@ def run(self) -> None: "write_to": "playwright/_repo_version.py", "write_to_template": 'version = "{version}"\n', }, - setup_requires=["setuptools_scm", "wheel"], + setup_requires=["setuptools_scm"], entry_points={ "console_scripts": [ "playwright=playwright.__main__:main", From 2275c82df39a8ac4f2bd2cc04362a7920895bf1d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 1 Mar 2021 15:20:35 +0530 Subject: [PATCH 6/6] chore(deps): bump setuptools from 53.1.0 to 54.0.0 (#17) Bumps [setuptools](https://github.com/pypa/setuptools) from 53.1.0 to 54.0.0. - [Release notes](https://github.com/pypa/setuptools/releases) - [Changelog](https://github.com/pypa/setuptools/blob/main/CHANGES.rst) - [Commits](https://github.com/pypa/setuptools/compare/v53.1.0...v54.0.0) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- local-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/local-requirements.txt b/local-requirements.txt index 0465de916..c6ae64358 100644 --- a/local-requirements.txt +++ b/local-requirements.txt @@ -9,7 +9,7 @@ flaky==3.7.0 pixelmatch==0.2.3 Pillow==8.1.0 mypy==0.812 -setuptools==53.1.0 +setuptools==54.0.0 # TODO: use PyPi version after >20.3.0 is released git+https://github.com/twisted/twisted.git@4ff22287cab3b54f51cee41ea2619e72d1bff2e4 wheel==0.36.2