replace selenium with nodriver

This commit is contained in:
sebthom
2024-03-07 20:26:40 +01:00
parent ca539cdd92
commit a441c5de73
13 changed files with 1303 additions and 1303 deletions

View File

@@ -32,14 +32,14 @@ classifiers = [ # https://pypi.org/classifiers/
]
requires-python = ">=3.10,<3.13" # <3.12 required for pyinstaller
dependencies = [
"colorama~=0.4",
"coloredlogs~=15.0",
"overrides~=7.4",
"ruamel.yaml~=0.18",
"pywin32==306; sys_platform == 'win32'",
"selenium~=4.18",
"selenium_stealth~=1.0",
"wcmatch~=8.5",
"colorama",
"coloredlogs",
"nodriver",
"overrides",
"ruamel.yaml",
"psutil",
"pywin32; sys_platform == 'win32'",
"wcmatch",
]
[project.urls]
@@ -60,25 +60,28 @@ write_template = "__version__ = '{}'\n"
[tool.pdm.dev-dependencies]
dev = [
"autopep8~=2.0",
"bandit~=1.7",
"autopep8",
"bandit",
"toml", # required by bandit
"tomli", # required by bandit
"pydantic~=2.6",
"pytest~=8.1",
"pyinstaller~=6.4",
"psutil",
"pylint~=3.1",
"mypy~=1.8",
"pytest",
"flaky", # used by pytest
"pyinstaller",
"pylint",
"mypy",
"pyright",
]
[tool.pdm.scripts] # https://pdm-project.org/latest/usage/scripts/
app = "python -m kleinanzeigen_bot"
compile.cmd = "python -O -m PyInstaller pyinstaller.spec --clean"
compile.env = {PYTHONHASHSEED = "1", SOURCE_DATE_EPOCH = "0"} # https://pyinstaller.org/en/stable/advanced-topics.html#creating-a-reproducible-build
format = "autopep8 --recursive --in-place kleinanzeigen_bot tests --verbose"
lint = {shell = "pylint -v src tests && autopep8 -v --exit-code --recursive --diff src tests && echo No issues found."}
scan = "bandit -c pyproject.toml -r kleinanzeigen_bot"
format = "autopep8 --recursive --in-place src tests --verbose"
lint = {shell = "pylint -v src tests && autopep8 -v --exit-code --recursive --diff src tests && mypy" }
scan = "bandit -c pyproject.toml -r src"
test = "python -m pytest --capture=tee-sys -v"
utest = "python -m pytest --capture=tee-sys -v -m 'not itest'"
itest = "python -m pytest --capture=tee-sys -v -m 'itest'"
@@ -117,6 +120,7 @@ aggressive = 3
# https://mypy.readthedocs.io/en/stable/config_file.html
#mypy_path = "$MYPY_CONFIG_FILE_DIR/tests/stubs"
python_version = "3.10"
files = "src,tests"
strict = true
disallow_untyped_calls = false
disallow_untyped_defs = true
@@ -127,6 +131,18 @@ warn_unused_ignores = true
verbosity = 0
#####################
# pyright
# https://github.com/microsoft/pyright/
#####################
[tool.pyright]
# https://microsoft.github.io/pyright/#/configuration?id=main-configuration-options
include = ["src", "tests"]
defineConstant = { DEBUG = false }
pythonVersion = "3.10"
typeCheckingMode = "standard"
#####################
# pylint
# https://pypi.org/project/pylint/
@@ -190,6 +206,7 @@ disable= [
"multiple-imports",
"multiple-statements",
"no-self-use",
"no-member", # pylint cannot find async methods from super class
"too-few-public-methods"
]