diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9c554d9e..4c3fa8e6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,15 @@ repos: -- repo: https://github.com/ambv/black + +- repo: https://github.com/psf/black rev: stable hooks: - - id: black - language_version: python3 + - id: black + args: [--safe, --quiet] + language_version: python3 + +- repo: https://gitlab.com/pycqa/flake8 + rev: 3.7.7 + hooks: + - id: flake8 + exclude: docs + language_version: python3 diff --git a/.travis.yml b/.travis.yml index 69af5d00..f158b3dd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,10 @@ jobs: sudo: required before_install: skip addons: skip - env: TOXENV=flake8 + env: TOXENV=linting + cache: + directories: + - $HOME/.cache/pre-commit - name: Docs @@ -37,10 +40,15 @@ jobs: env: TOXENV=py37 - - name: pypy 5.6.0 - python: pypy-5.6.0 + name: pypy + python: pypy env: TOXENV=pypy + - + name: pypy3 + python: pypy3 + env: TOXENV=pypy3 + - stage: deploy python: 3.7 dist: xenial diff --git a/Pipfile b/Pipfile index 8e210022..715aa0cd 100644 --- a/Pipfile +++ b/Pipfile @@ -11,4 +11,4 @@ black = "*" pre-commit = "*" [packages] -pytest-selenium = {editable = true,path = "."} +pytest-selenium = {editable = true,extras = ["appium"],path = "."} diff --git a/docs/development.rst b/docs/development.rst index 6937da9f..57ecf6b1 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -1,6 +1,25 @@ Development =========== +To contribute to `pytest-selenium` you can use `Pipenv`_ to manage +a python virtual environment and `pre-commit `_ to help you with +styling and formatting. + +To setup the virtual environment and pre-commit, run: + +.. code-block:: bash + + $ pipenv install --dev + $ pipenv run pre-commit install + +If you're not using `Pipenv`_, to install `pre-commit`, run: + +.. code-block:: bash + + $ pip install pre-commit + $ pre-commit install + + Automated Testing ----------------- @@ -14,11 +33,22 @@ not, you can find it on the The only way to trigger Travis CI to run again for a pull request, is to submit another change to the pull branch. +You can do this with `git commit --allow-empty` + Running Tests ------------- You will need `Tox `_ installed to run the tests -against the supported Python versions. +against the supported Python versions. If you're using `Pipenv`_ it will be +installed for you. + +With `Pipenv`_, run: + +.. code-block:: bash + + $ pipenv run tox + +Otherwise, to install and run, do: .. code-block:: bash @@ -60,3 +90,19 @@ Instructions for `edgedriver `_. + +Releasing a new version +----------------------- + +Follow these steps to release a new version of the project: + +1. Update your local master with the upstream master (``git pull --rebase upstream master``) +2. Create a new branch and update ``news.rst`` with the new version, today's date, and all changes/new features +3. Commit and push the new branch and then create a new pull request +4. Wait for tests and reviews and then merge the branch +5. Once merged, update your local master again (``git pull --rebase upstream master``) +6. Tag the release with the new release version (``git tag v``) +7. Push the tag (``git push upstream --tags``) +8. Done. You can monitor the progress on `Travis `_ + +.. _Pipenv: https://docs.pipenv.org/en/latest/ diff --git a/docs/news.rst b/docs/news.rst index 2dfc3d46..9b49191b 100644 --- a/docs/news.rst +++ b/docs/news.rst @@ -1,10 +1,18 @@ Release Notes ============= +1.17.0 (2019-07-13) +------------------- + +* Added support for `Appium `_ + +* Deprecate support for `PhantomJS` + 1.16.0 (2019-02-12) ------------------- * ``pytest-selenium`` now requires pytest 3.6 or later. + * Fixed `issue `_ with TestingBot local tunnel. 1.15.1 (2019-01-07) diff --git a/pytest_selenium/pytest_selenium.py b/pytest_selenium/pytest_selenium.py index cb02e2ec..c6fa7661 100644 --- a/pytest_selenium/pytest_selenium.py +++ b/pytest_selenium/pytest_selenium.py @@ -47,7 +47,7 @@ def _merge(a, b): """ merges b and a configurations. Based on http://bit.ly/2uFUHgb - """ + """ for key in b: if key in a: if isinstance(a[key], dict) and isinstance(b[key], dict): diff --git a/tox.ini b/tox.ini index 951883e8..395c3401 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = py{27,36,37,py,py3}, docs, flake8 +envlist = py{27,36,37,py,py3}, docs, linting [testenv] passenv = PYTEST_ADDOPTS @@ -22,11 +22,11 @@ changedir = docs deps = sphinx commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html -[testenv:flake8] -skip_install = true -basepython = python -deps = flake8 -commands = flake8 {posargs:.} +[testenv:linting] +skip_install = True +basepython = python3 +deps = pre-commit +commands = pre-commit run --all-files --show-diff-on-failure [flake8] max-line-length = 88