8000 Merge pull request #208 from pyppeteer/importlib_metadata · pythonthings/pyppeteer@0fc95c9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0fc95c9

Browse files
Merge pull request pyppeteer#208 from pyppeteer/importlib_metadata
ensure that versions match between release name and__version__
2 parents 2c72b82 + 4909af8 commit 0fc95c9

File tree

4 files changed

+25
-7
lines changed

4 files changed

+25
-7
lines changed

CHANGES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ History
55

66
* [populate me]
77

8+
## Version 0.2.5
9+
10+
* Match package version and \_\_version__ (🤦‍♂️)
11+
* Use `importlib_metadata` so this isn't a problem in the future
12+
813
## Version 0.2.4
914

1015
* Update `pyee` dependency breaking build failures on NixOS + Fedora packaging systems (#207)

pyppeteer/__init__.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,21 @@
66
import logging
77
import os
88

9+
try:
10+
# noinspection PyCompatibility
11+
from importlib.metadata import version
12+
except ModuleNotFoundError:
13+
# noinspection PyUnresolvedReferences
14+
# <3.8 backport
15+
from importlib_metadata import version
16+
17+
try:
18+
__version__ = version('wheel')
19+
except Exception:
20+
pass
21+
922
from appdirs import AppDirs
1023

11-
__author__ = """Hiroyuki Takagi"""
12-
__email__ = 'miyako.dev@gmail.com'
13-
__version__ = '0.2.4'
1424
__chromium_revision__ = '588429'
1525
__base_puppeteer_version__ = 'v1.6.0'
1626
__pyppeteer_home__ = os.environ.get(

pyppeteer/launcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def get_ws_endpoint(url) -> str:
228228
with urlopen(url) as f:
229229
data = json.loads(f.read().decode())
230230
break
231-
except URLError as e:
231+
except URLError:
232232
continue
233233
time.sleep(0.1)
234234

pyproject.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "pyppeteer"
3-
version = "0.2.2"
3+
version = "0.2.5"
44
description = "Headless chrome/chromium automation library (unofficial port of puppeteer)"
55
readme = 'README.md'
66
license = "MIT"
@@ -49,10 +49,13 @@ appdirs = "^1.4.3"
4949
pyee = "^8.1.0"
5050
tqdm = "^4.42.1"
5151
urllib3 = "^1.25.8"
52-
websockets = "^8.1"
52+
# todo: update this dep when tox releases patch version w/ https://github.com/tox-dev/tox/pull/1764
53+
importlib-metadata = { version = "^2.1.1", python = "<3.8" }
5354

5455
[tool.poetry.dev-dependencies]
55-
doit = "^0.32.0"
56+
tox = "^3.20.1"
57+
syncer = "^1.3.0"
58+
livereload = "^2.6.1"
5659
flake8 = "^3.7.9"
5760
livereload = "^2.6.1"
5861
m2r = "^0.2.1"

0 commit comments

Comments
 (0)
0