maint: misc changes to dev and ci by nandgator · Pull Request #251 · python-validators/validators · GitHub
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
41 changes: 11 additions & 30 deletions .github/workflows/main.yml
10 changes: 5 additions & 5 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ jobs:
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.3.2
version: 1.4.1
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install docs dependencies
- name: Install dependencies
run: poetry install --no-interaction --no-root --no-ansi --only docs
- name: Build documentation
run: |
source .venv/bin/activate
python ./docs/gen_docs.py
python docs/gen_docs.py
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
- name: Upload artifacts
uses: actions/upload-pages-artifact@v1
with:
path: "./site/"
path: "site/"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
1 change: 1 addition & 0 deletions docs/gen_docs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Generate docs."""
# -*- coding: utf-8 -*-

# standard
from shutil import rmtree, move, copy
Expand Down
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

75 changes: 41 additions & 34 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ include = ["CHANGES.md", "docs/*"]
python = "^3.8"

[tool.poetry.group.dev.dependencies]
pre-commit = "^3.2.0"
tox = "^4.4.7"

[tool.poetry.group.docs.dependencies]
Expand All @@ -37,6 +36,9 @@ mkdocs-material = "^9.1.3"
mkdocstrings = { extras = ["python"], version = "^0.20.0" }
pyaml = "^21.10.1"

[tool.poetry.group.hooks.dependencies]
pre-commit = "^3.2.0"

[tool.poetry.group.sast.dependencies]
bandit = "^1.7.5"

Expand Down Expand Up @@ -71,7 +73,9 @@ ensure_newline_before_comments = true
extend_skip_glob = ["**/i18n/*"]
force_grid_wrap = 0
force_sort_within_sections = true
ignore_comments = true
import_heading_stdlib = "standard"
import_heading_thirdparty = "external"
import_heading_localfolder = "local"
include_trailing_comma = true
known_local_folder = ["validators"]
length_sort = true
Expand All @@ -92,36 +96,39 @@ typeCheckingMode = "strict"

[tool.tox]
legacy_tox_ini = """
[tox]
requires =
tox >= 4.0
env_list = py{38,39,310,311}
fmt_black, fmt_isort, lint, type

[testenv]
description = run unit tests
deps = pytest
commands = pytest

[testenv:fmt_black]
description = run formatter
deps = black
commands = black .

[testenv:fmt_isort]
description = run formatter
deps = isort
commands = isort .

[testenv:lint]
description = run linters
deps = flake8
commands = flake8

[testenv:type]
description = run type checker
deps =
pyright
pytest
commands = pyright
[tox]
min_version = 4.0
env_list =
py{38,39,310,311}
fmt_black
fmt_isort
lint
type

[testenv]
description = run unit tests
deps = pytest
commands = pytest tests/

[testenv:fmt_black]
description = run formatter
deps = black
commands = black .

[testenv:fmt_isort]
description = run formatter
deps = isort
commands = isort .

[testenv:lint]
description = run linters
deps = flake8
commands = flake8

[testenv:type]
description = run type checker
deps =
pyright
pytest
commands = pyright
"""
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

[flake8]
docstring-convention = google
exclude = __pycache__,.github,.pytest_cache,.tox,.vscode,site,i18n
exclude = __pycache__,.github,.pytest_cache,.tox,.venv,.vscode,site,i18n
max-line-length = 100
3 changes: 3 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
"""Tests."""
# -*- coding: utf-8 -*-

# isort: skip_file
29 changes: 18 additions & 11 deletions validators/__init__.py