Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
557 changes: 0 additions & 557 deletions .pylintrc

This file was deleted.

20 changes: 4 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,10 @@ check-all: ## Run all lint checks and unittest
@echo "[Notice] If you'd like to run commands with same env to CI, please run \`tox\`."
@bash ci.sh

.PHONY: isort
isort: ## Run isort
python -m isort --profile black $(ARGS) .

.PHONY: black
black: ## Run black
python -m black $(ARGS) . -l 120 -S

.PHONY: pylint
pylint: ## Run pylint
# TODO Remove --disable=E1136 when no errors in py39
python -m pylint $(ARGS) --load-plugins pylint_quotes --rcfile .pylintrc appium test --disable=E1136

.PHONY: mypy
mypy: ## Run mypy
python -m mypy appium test/functional
.PHONY: ruff
Copy link
Contributor

@mykola-mokhnach mykola-mokhnach Oct 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe create two tasks: format + lint for local dev and the task check, which would be called automatically in the precommit hook

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the idea is that we don't want to rely on tool names, but rather intention purposes

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense

ruff: ## Run ruff
python -m ruff check .
python -m ruff format --check .

.PHONY: unittest
unittest: ## Run unittest
Expand Down
6 changes: 1 addition & 5 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@ url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
black = "<25.0.0"
httpretty = "~=1.1"
isort = "<6.0"
mypy = "<2.0"
mock = "~=5.1"
pre-commit = "~=2.21"
pylint = "~=3.2.7"
pylint-quotes = "~=0.2.3"
pytest = "~=8.3"
pytest-cov = "~=5.0"
python-dateutil = "~=2.9"
ruff = "~=0.6.9"
tox = "~=4.21"
types-python-dateutil = "~=2.9"

Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

[![Functional Tests](https://github.com/appium/python-client/actions/workflows/functional-test.yml/badge.svg)](https://github.com/appium/python-client/actions/workflows/functional-test.yml)

[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

An extension library for adding [WebDriver Protocol](https://www.w3.org/TR/webdriver/) and Appium commands to the Selenium Python language binding for use with the mobile testing framework [Appium](https://appium.io).

## Getting the Appium Python client
Expand Down Expand Up @@ -355,7 +353,7 @@ driver = webdriver.Remote(custom_executor, options=options)
## Development

- Code Style: [PEP-0008](https://www.python.org/dev/peps/pep-0008/)
- Apply `black`, `isort` and `mypy` as pre commit hook
- Apply `ruff` as pre commit hook
- Run `make` command for development. See `make help` output for details
- Docstring style: [Google Style](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html)
- `gitchangelog` generates `CHANGELOG.rst`
Expand Down
2 changes: 1 addition & 1 deletion appium/webdriver/extensions/location.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def location(self) -> Dict[str, float]:
- longitude (float)
- altitude (float)
"""
return self.execute(Command.GET_LOCATION)['value'] # pylint: disable=unsubscriptable-object
return self.execute(Command.GET_LOCATION)['value']

def _add_commands(self) -> None:
"""Add location endpoints. They are not int w3c spec."""
Expand Down
4 changes: 0 additions & 4 deletions appium/webdriver/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# pylint: disable=too-many-lines,too-many-public-methods,too-many-statements,no-self-use

from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union

from selenium import webdriver
Expand Down Expand Up @@ -212,11 +210,9 @@ def __init__(
options: Union[AppiumOptions, List[AppiumOptions], None] = None,
):
if strict_ssl is False:
# pylint: disable=E1101
# noinspection PyPackageRequirements
import urllib3

# pylint: disable=E1101
# noinspection PyPackageRequirements
import urllib3.exceptions

Expand Down
18 changes: 2 additions & 16 deletions ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,13 @@

EXIT_STATUS=0

if ! make black ARGS=--check ; then
echo "Please run command 'make black' on your local and commit the result"
if ! make ruff ; then
echo "Please run command 'make ruff' on your local and commit the result"
EXIT_STATUS=1
fi
if ! make isort ARGS=--check-only ; then
echo "Please run command 'make isort' on your local and commit the result"
EXIT_STATUS=1
fi

if ! make pylint ; then
echo "Please run command 'make pylint' on your local and fix errors"
# TODO: pylint erroneously complains about many things it should not complain about
# EXIT_STATUS=1
fi

if ! make unittest ARGS=--junitxml=./test/unit/junit.xml ; then
EXIT_STATUS=1
fi

if ! make mypy ; then
EXIT_STATUS=1
fi

exit $EXIT_STATUS
19 changes: 0 additions & 19 deletions setup.cfg

This file was deleted.

Loading