Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
17 changes: 0 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,3 @@ jobs:

- name: Run tox targets for ${{ matrix.python-version }}
run: tox run -f py$(echo ${{ matrix.python-version }} | tr -d .)

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Install dependencies
run: |
python -m pip install --upgrade pip tox
- name: Run lint
run: tox -e lint
25 changes: 25 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-vcs-permalinks
- id: check-yaml
- id: debug-statements
- id: destroyed-symlinks
- id: end-of-file-fixer

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.8
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
1 change: 0 additions & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Community Participation Guidelines

This repository is governed by Django's code of conduct. See https://www.djangoproject.com/conduct/.

38 changes: 36 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description = "Python library to integrate axe and selenium for web accessibilit
dynamic = ["version"]
readme = "README.rst"
authors = [
{name="Kimberly Sereduck", email="ksereduck@mozilla.com"}
{name="Kimberly Sereduck", email="ksereduck@mozilla.com"}
]
license = {"text" = "Mozilla Public License 2.0 (MPL 2.0)"}
keywords = ["axe-core", "selenium", "pytest-selenium", "accessibility" , "automation", "mozilla"]
Expand All @@ -18,8 +18,42 @@ dependencies = [
"pytest>=3.0",
]

[project.optional-dependencies]
lint = [
"pre-commit",
]

[project.urls]
"Homepage" = "https://github.com/axe-selenium-python/axe-selenium-python"
"Issues" = "https://github.com/axe-selenium-python/axe-selenium-python/issues"

[tool.setuptools_scm]
[tool.ruff.lint]
select = [
"A",
"B",
"BLE",
"C4",
"DTZ",
"E",
"ERA",
"F",
"FA",
"FLY",
"FURB",
"I",
"N",
"PERF",
"PIE",
"PT",
"RSE",
"RUF",
"SIM",
"T10",
"T20",
"W",
]

[tool.ruff.lint.isort]
force-single-line = true

[tool.setuptools_scm]
3 changes: 0 additions & 3 deletions tests/requirements/lint.txt

This file was deleted.

2 changes: 1 addition & 1 deletion tests/requirements/tests.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pytest
selenium
pytest-html
pytest-mock
pytest-mock
2 changes: 1 addition & 1 deletion tests/src/axe.min.js

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion tests/test_axe.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# You can obtain one at http://mozilla.org/MPL/2.0/.

import json
from os import getcwd, getenv, path
from os import getcwd
from os import getenv
from os import path

import pytest
from selenium import webdriver
Expand Down
12 changes: 1 addition & 11 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
[tox]
envlist = py312, py313, lint
envlist = py312, py313
skipsdist = true

[testenv]
setenv =
MOZ_HEADLESS = 1
deps = -rtests/requirements/tests.txt
commands = pytest -rsx --verbose

[testenv:lint]
deps = -rtests/requirements/lint.txt
commands =
flake8 axe_selenium_python tests
isort axe_selenium_python tests --check --dif
black axe_selenium_python tests --check

[flake8]
max-line-length = 88