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
7 changes: 4 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ updates:
- package-ecosystem: pip
directory: /
schedule:
interval: monthly
interval: quarterly
ignore:
- dependency-name: ruff
- dependency-name: bandit
- dependency-name: ruff
- dependency-name: ssort

- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
interval: quarterly
42 changes: 22 additions & 20 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,26 @@ on:
permissions: read-all

jobs:
test:
pytest:
name: Pytest testing

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version:
- '3.9'
- '3.10'
- '3.11'
- '3.12'
- '3.13'
- '3.14'
os:
- ubuntu-latest
- windows-latest
- macos-latest
resolution:
- highest
- lowest-direct

permissions:
contents: write
Expand All @@ -47,27 +50,26 @@ jobs:
python-version: ${{ matrix.python-version }}
cache: pip

- uses: install-pinned/uv@3863536aec631cbd0a0d99cc91d32d06292bcb93
- uses: install-pinned/uv@3b52ff50f07de12f5ebcdd31d078466611a008a6

- run: uv pip install --system -e .[dev]
- run: uv pip install --system --resolution ${{ matrix.resolution }} -e .[dev]

- id: cache-pytest
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
with:
path: .pytest_cache
key: ${{ runner.os }}-pytest-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
key: ${{ matrix.os }}-pytest-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}

- name: Run pytest (with headless support)
uses: GabrielBB/xvfb-action@5bcda06da84ba084708898801da79736b88e00a9
- uses: GabrielBB/xvfb-action@5bcda06da84ba084708898801da79736b88e00a9
env:
COVERAGE_FILE: .coverage.${{ runner.os }}.${{ matrix.python-version }}
COVERAGE_FILE: .coverage.${{ matrix.os }}.${{ matrix.python-version }}.${{ matrix.resolution }}
with:
run: pytest

- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
with:
name: coverage-${{ runner.os }}${{ matrix.python-version }}
path: .coverage.${{ runner.os }}.${{ matrix.python-version }}
name: coverage-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.resolution }}
path: .coverage.${{ matrix.os }}.${{ matrix.python-version }}.${{ matrix.resolution }}
include-hidden-files: true

ruff-format:
Expand All @@ -92,7 +94,7 @@ jobs:
python-version: '3.13'
cache: pip

- uses: install-pinned/uv@3863536aec631cbd0a0d99cc91d32d06292bcb93
- uses: install-pinned/uv@3b52ff50f07de12f5ebcdd31d078466611a008a6

- run: uv pip install --system -e .[dev]

Expand Down Expand Up @@ -131,7 +133,7 @@ jobs:
python-version: '3.13'
cache: pip

- uses: install-pinned/uv@3863536aec631cbd0a0d99cc91d32d06292bcb93
- uses: install-pinned/uv@3b52ff50f07de12f5ebcdd31d078466611a008a6

- run: uv pip install --system -e .[dev]

Expand All @@ -145,7 +147,7 @@ jobs:
run: |
ruff check --output-format=sarif -o results.sarif .

- uses: github/codeql-action/upload-sarif@0499de31b99561a6d14a36a5f662c2a54f91beee
- uses: github/codeql-action/upload-sarif@e12f0178983d466f2f6028f5cc7a6d786fd97f4b
if: ( success() || failure() ) && contains('["success", "failure"]', steps.run-ruff-sarif.outcome)
with:
sarif_file: results.sarif
Expand Down Expand Up @@ -178,7 +180,7 @@ jobs:
python-version: '3.13'
cache: pip

- uses: install-pinned/uv@3863536aec631cbd0a0d99cc91d32d06292bcb93
- uses: install-pinned/uv@3b52ff50f07de12f5ebcdd31d078466611a008a6

- run: uv pip install --system -e .[dev]

Expand Down Expand Up @@ -218,15 +220,15 @@ jobs:
python-version: '3.13'
cache: pip

- uses: install-pinned/uv@3863536aec631cbd0a0d99cc91d32d06292bcb93
- uses: install-pinned/uv@3b52ff50f07de12f5ebcdd31d078466611a008a6

- run: uv pip install --system -e .[dev]

- id: run-bandit-sarif
run: |
bandit --confidence-level 'medium' --format 'sarif' --output 'results.sarif' --recursive 'requestium'

- uses: github/codeql-action/upload-sarif@0499de31b99561a6d14a36a5f662c2a54f91beee
- uses: github/codeql-action/upload-sarif@e12f0178983d466f2f6028f5cc7a6d786fd97f4b
if: ( success() || failure() ) && contains('["success", "failure"]', steps.run-bandit-sarif.outcome)
with:
sarif_file: results.sarif
Expand All @@ -238,7 +240,7 @@ jobs:

coverage:
runs-on: ubuntu-latest
needs: test
needs: pytest
permissions:
pull-requests: write
contents: write
Expand All @@ -254,7 +256,7 @@ jobs:

- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3

- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53
with:
pattern: coverage-*
merge-multiple: true
Expand Down Expand Up @@ -300,15 +302,15 @@ jobs:
python-version: '3.13'
cache: pip

- uses: install-pinned/uv@3863536aec631cbd0a0d99cc91d32d06292bcb93
- uses: install-pinned/uv@3b52ff50f07de12f5ebcdd31d078466611a008a6

- run: uv pip install --system -e .[dev]

- id: cache-pre-commit
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
with:
path: .pre-commit-cache
key: ${{ runner.os }}-pre-commit-3.13
key: ${{ runner.os }}-pre-commit-3.13-${{ hashFiles('.pre-commit-config.yaml') }}

- name: Run pre-commit on all files
run: |
Expand Down
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 'v5.0.0'
rev: 'v6.0.0'
hooks:
- id: check-yaml
- id: check-ast
Expand All @@ -13,19 +13,19 @@ repos:
- id: check-toml
- id: debug-statements
- id: mixed-line-ending
- repo: https://github.com/asottile/pyupgrade
rev: 'v3.19.1'
- repo: https://github.com/bwhmather/ssort
rev: 0.16.0
hooks:
- id: pyupgrade
args: ['--py39-plus']
- id: ssort
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.11.11'
rev: 'v0.14.11'
hooks:
- id: ruff
- id: ruff-check
args: ['--fix']
- id: ruff-format
- repo: https://github.com/PyCQA/bandit
rev: '1.8.3'
rev: '1.9.2'
hooks:
- id: bandit
args: ['--confidence-level', 'medium']
files: '^requestium'
files: '^src'
61 changes: 29 additions & 32 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,24 @@
[project]
name = "requestium"
version = "0.5.0"
version = "1.0.0"
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.9"
requires-python = ">=3.10"
license = { file = "LICENSE" }
authors = [
{ name = "Joaquin Alori", email = "[email protected]" }
]
maintainers = [
{ name = "Judson Neer", email = "[email protected]" },
{ name = "Wil T", email = "[email protected]" },
]
dependencies = [
"parsel>=1.0",
"requests>=2.0",
"selenium>=4.0",
"tldextract>=5.3",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Natural Language :: English",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
Expand All @@ -36,6 +29,12 @@ classifiers = [
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Testing",
]
dependencies = [
"parsel>=1.7",
"requests>=2.27",
"selenium>=4.32",
"tldextract>=5.3",
]

[project.urls]
source = "https://github.com/tryolabs/requestium"
Expand All @@ -44,20 +43,21 @@ issues = "https://github.com/tryolabs/requestium/issues"

[project.optional-dependencies]
dev = [
"bandit[sarif]==1.8.3",
"coverage==7.10.7",
"bandit[sarif]==1.9.2",
"mypy==1.19.1",
"pre-commit==4.3.0",
"pytest-cov==7.0.0",
"pytest-xdist==3.8.0",
"pytest==8.4.2",
"ruff==0.11.11",
"pre-commit~=4.5.0",
"pytest-cov~=7.0.0",
"pytest-xdist~=3.8.0",
"pytest~=9.0.0",
"ruff==0.14.11",
"ssort==0.16.0",
"types-requests==2.32.4.20250913",
]

[tool]

[tool.ruff]
line-length = 160
target-version = "py39"
include = [
"requestium/**/*.py",
"tests/**/*.py",
Expand Down Expand Up @@ -90,6 +90,7 @@ extend-select = [
"LOG", # flake8-logging (LOG)
"N", # pep8-naming (N)
"PIE", # flake8-pie (PIE)
"PL", # Pylint (PL)
"PT", # flake8-pytest-style (PT)
"PTH", # flake8-use-pathlib (PTH)
"Q", # flake8-quotes (Q)
Expand Down Expand Up @@ -121,28 +122,24 @@ ignore = [
]

[tool.ruff.lint.per-file-ignores]
"**/{tests,docs}/*" = ["SLF001"]
"**/{tests,docs}/*" = [
"SLF001", # private-member-access (SLF001)
"PLR2004", # magic-value-comparison (PLR2004)
]

[tool.pytest.ini_options]
addopts = "--cov=requestium -n auto"
[tool.pytest]
addopts = ["-n", "auto", "--cov=requestium", "--no-cov-on-fail"]
testpaths = [
"tests/",
"tests",
]

[tool.coverage]

[tool.coverage.run]
branch = true
relative_files = true
command_line = "-m pytest"

[tool.coverage.paths]
source = [
"requestium/",
]
omit = [
"tests/",
]

[tool.coverage.report]
exclude_also = [
"logger.",
"logger\\.",
]
Loading
Loading