Skip to content

Commit a69de3d

Browse files
chore: force lf line ending (microsoft#697)
1 parent a60b20f commit a69de3d

File tree

7 files changed

+156
-152
lines changed

7 files changed

+156
-152
lines changed

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
# text files must be lf for golden file tests to work
22
*.txt eol=lf
33
*.json eol=lf
4+
*.py eol=lf
5+
*.yml eol=lf
6+
*.yaml eol=lf
7+
*.md eol=lf

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v3.4.0
5+
rev: v4.0.1
66
hooks:
77
- id: trailing-whitespace
88
- id: end-of-file-fixer
99
- id: check-yaml
1010
- id: check-toml
1111
- id: requirements-txt-fixer
1212
- repo: https://github.com/psf/black
13-
rev: 21.5b0
13+
rev: 21.5b1
1414
hooks:
1515
- id: black
1616
- repo: https://github.com/pre-commit/mirrors-mypy
1717
rev: v0.812
1818
hooks:
1919
- id: mypy
2020
- repo: https://gitlab.com/pycqa/flake8
21-
rev: 3.9.1
21+
rev: 3.9.2
2222
hooks:
2323
- id: flake8
2424
- repo: https://github.com/pycqa/isort

conda_build_config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
python:
2-
- 3.7
3-
- 3.8
4-
- 3.9
1+
python:
2+
- 3.7
3+
- 3.8
4+
- 3.9

local-requirements.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
auditwheel==4.0.0
22
autobahn==21.3.1
3-
black==21.5b0
4-
flake8==3.9.1
3+
black==21.5b1
4+
flake8==3.9.2
55
flaky==3.7.0
66
mypy==0.812
77
objgraph==3.5.0
88
pandas==1.2.4
99
Pillow==8.2.0
1010
pixelmatch==0.2.3
11-
pre-commit==2.10.1
11+
pre-commit==2.12.1
1212
pyOpenSSL==20.0.1
1313
pytest==6.2.4
1414
pytest-asyncio==0.15.1
15-
pytest-cov==2.11.1
15+
pytest-cov==2.12.0
1616
pytest-repeat==0.9.1
1717
pytest-sugar==0.9.4
1818
pytest-timeout==1.4.2
1919
pytest-xdist==2.2.1
2020
requests==2.25.1
21-
service_identity==18.1.0
22-
setuptools==56.1.0
23-
twine==3.3.0
21+
service_identity==21.1.0
22+
setuptools==56.2.0
23+
twine==3.4.1
2424
twisted==21.2.0
2525
wheel==0.36.2

meta.yaml

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
1-
package:
2-
name: playwright
3-
version: "{{ environ.get('GIT_DESCRIBE_TAG') }}"
4-
5-
source:
6-
path: .
7-
8-
build:
9-
number: 0
10-
script: "{{ PYTHON }} -m pip install . --no-deps -vv"
11-
skip: true # [py<37]
12-
binary_relocation: False
13-
missing_dso_whitelist: "*"
14-
entry_points:
15-
- playwright = playwright.__main__:main
16-
17-
requirements:
18-
host:
19-
- python
20-
- wheel
21-
- pip
22-
- curl
23-
- setuptools_scm
24-
run:
25-
- python
26-
- greenlet >=0.4
27-
- pyee >=8.0.1
28-
- websockets >=8.1
29-
- typing_extensions # [py<39]
30-
test:
31-
requires:
32-
- pip
33-
imports:
34-
- playwright
35-
- playwright.sync_api
36-
- playwright.async_api
37-
commands:
38-
- pip check
39-
- playwright --help
40-
41-
about:
42-
home: https://github.com/microsoft/playwright-python
43-
license: Apache-2.0
44-
license_family: Apache
45-
license_file: LICENSE
46-
summary: Python version of the Playwright testing and automation library.
47-
description: |
48-
Playwright is a Python library to automate Chromium,
49-
Firefox and WebKit browsers with a single API. Playwright
50-
delivers automation that is ever-green, capable, reliable
51-
and fast.
52-
doc_url: https://playwright.dev/python/docs/intro/
53-
dev_url: https://github.com/microsoft/playwright-python
1+
package:
2+
name: playwright
3+
version: "{{ environ.get('GIT_DESCRIBE_TAG') }}"
4+
5+
source:
6+
path: .
7+
8+
build:
9+
number: 0
10+
script: "{{ PYTHON }} -m pip install . --no-deps -vv"
11+
skip: true # [py<37]
12+
binary_relocation: False
13+
missing_dso_whitelist: "*"
14+
entry_points:
15+
- playwright = playwright.__main__:main
16+
17+
requirements:
18+
host:
19+
- python
20+
- wheel
21+
- pip
22+
- curl
23+
- setuptools_scm
24+
run:
25+
- python
26+
- greenlet >=0.4
27+
- pyee >=8.0.1
28+
- websockets >=8.1
29+
- typing_extensions # [py<39]
30+
test:
31+
requires:
32+
- pip
33+
imports:
34+
- playwright
35+
- playwright.sync_api
36+
- playwright.async_api
37+
commands:
38+
- pip check
39+
- playwright --help
40+
41+
about:
42+
home: https://github.com/microsoft/playwright-python
43+
license: Apache-2.0
44+
license_family: Apache
45+
license_file: LICENSE
46+
summary: Python version of the Playwright testing and automation library.
47+
description: |
48+
Playwright is a Python library to automate Chromium,
49+
Firefox and WebKit browsers with a single API. Playwright
50+
delivers automation that is ever-green, capable, reliable
51+
and fast.
52+
doc_url: https://playwright.dev/python/docs/intro/
53+
dev_url: https://github.com/microsoft/playwright-python

tests/assets/client.py

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
# Copyright (c) Microsoft Corporation.
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
14-
15-
from pathlib import Path
16-
17-
from playwright.sync_api import Playwright, sync_playwright
18-
19-
20-
def main(playwright: Playwright) -> None:
21-
for browser_type in [playwright.chromium, playwright.firefox, playwright.webkit]:
22-
browser = browser_type.launch()
23-
page = browser.new_page()
24-
page.goto("https://example.com")
25-
here = Path(__file__).parent.resolve()
26-
page.screenshot(path=here / f"{browser_type.name}.png")
27-
page.close()
28-
browser.close()
29-
30-
31-
if __name__ == "__main__":
32-
with sync_playwright() as p:
33-
main(p)
1+
# Copyright (c) Microsoft Corporation.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
from pathlib import Path
16+
17+
from playwright.sync_api import Playwright, sync_playwright
18+
19+
20+
def main(playwright: Playwright) -> None:
21+
for browser_type in [playwright.chromium, playwright.firefox, playwright.webkit]:
22+
browser = browser_type.launch()
23+
page = browser.new_page()
24+
page.goto("https://example.com")
25+
here = Path(__file__).parent.resolve()
26+
page.screenshot(path=here / f"{browser_type.name}.png")
27+
page.close()
28+
browser.close()
29+
30+
31+
if __name__ == "__main__":
32+
with sync_playwright() as p:
33+
main(p)

tests/test_installation.py

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
1-
# Copyright (c) Microsoft Corporation.
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License")
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
14-
15-
import os
16-
import shutil
17-
import subprocess
18-
import sys
19-
from pathlib import Path
20-
from venv import EnvBuilder
21-
22-
23-
def test_install(tmp_path: Path):
24-
env = EnvBuilder(with_pip=True)
25-
env.create(env_dir=tmp_path)
26-
context = env.ensure_directories(tmp_path)
27-
root = Path(__file__).parent.parent.resolve()
28-
if sys.platform == "win32":
29-
wheelpath = list((root / "dist").glob("playwright*win_amd64*.whl"))[0]
30-
elif sys.platform == "linux":
31-
wheelpath = list((root / "dist").glob("playwright*manylinux1*.whl"))[0]
32-
elif sys.platform == "darwin":
33-
wheelpath = list((root / "dist").glob("playwright*macosx_10_*.whl"))[0]
34-
subprocess.check_output(
35-
[
36-
context.env_exe,
37-
"-m",
38-
"pip",
39-
"install",
40-
str(wheelpath),
41-
]
42-
)
43-
environ = os.environ.copy()
44-
environ["PLAYWRIGHT_BROWSERS_PATH"] = str(tmp_path)
45-
subprocess.check_output(
46-
[context.env_exe, "-m", "playwright", "install"], env=environ
47-
)
48-
shutil.copyfile(root / "tests" / "assets" / "client.py", tmp_path / "main.py")
49-
subprocess.check_output([context.env_exe, str(tmp_path / "main.py")], env=environ)
50-
assert (tmp_path / "chromium.png").exists()
51-
assert (tmp_path / "firefox.png").exists()
52-
assert (tmp_path / "webkit.png").exists()
1+
# Copyright (c) Microsoft Corporation.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License")
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import os
16+
import shutil
17+
import subprocess
18+
import sys
19+
from pathlib import Path
20+
from venv import EnvBuilder
21+
22+
23+
def test_install(tmp_path: Path):
24+
env = EnvBuilder(with_pip=True)
25+
env.create(env_dir=tmp_path)
26+
context = env.ensure_directories(tmp_path)
27+
root = Path(__file__).parent.parent.resolve()
28+
if sys.platform == "win32":
29+
wheelpath = list((root / "dist").glob("playwright*win_amd64*.whl"))[0]
30+
elif sys.platform == "linux":
31+
wheelpath = list((root / "dist").glob("playwright*manylinux1*.whl"))[0]
32+
elif sys.platform == "darwin":
33+
wheelpath = list((root / "dist").glob("playwright*macosx_10_*.whl"))[0]
34+
subprocess.check_output(
35+
[
36+
context.env_exe,
37+
"-m",
38+
"pip",
39+
"install",
40+
str(wheelpath),
41+
]
42+
)
43+
environ = os.environ.copy()
44+
environ["PLAYWRIGHT_BROWSERS_PATH"] = str(tmp_path)
45+
subprocess.check_output(
46+
[context.env_exe, "-m", "playwright", "install"], env=environ
47+
)
48+
shutil.copyfile(root / "tests" / "assets" / "client.py", tmp_path / "main.py")
49+
subprocess.check_output([context.env_exe, str(tmp_path / "main.py")], env=environ)
50+
assert (tmp_path / "chromium.png").exists()
51+
assert (tmp_path / "firefox.png").exists()
52+
assert (tmp_path / "webkit.png").exists()

0 commit comments

Comments
 (0)