Skip to content

Commit

Permalink
modernize dev tools, drop python 3.7 support, move all configs from s…
Browse files Browse the repository at this point in the history
…etup.cfg to pyproject.toml, update rtd build to use poetry
  • Loading branch information
bckohan committed Dec 22, 2023
1 parent 2abe33c commit 6fbffb3
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 144 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
django-version:
- 'Django~=3.2.0' # LTS April 2024
- 'Django~=4.2.0' # LTS April 2026
Expand All @@ -65,10 +65,6 @@ jobs:
django-version: 'Django~=3.2.0'
- python-version: '3.12'
django-version: 'Django~=3.2.0'
- python-version: '3.7'
django-version: 'Django~=4.2.0'
- python-version: '3.7'
django-version: 'Django~=5.0.0'
- python-version: '3.8'
django-version: 'Django~=5.0.0'
- python-version: '3.9'
Expand All @@ -87,7 +83,6 @@ jobs:
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.5.1
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install Release Dependencies
Expand Down
10 changes: 0 additions & 10 deletions doc/requirements.txt

This file was deleted.

124 changes: 91 additions & 33 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand All @@ -44,13 +43,8 @@ exclude = ["render_static/tests"]
# django-renderstatic = 'render_static.console:main'

[tool.poetry.dependencies]
python = ">=3.7,<4.0"
python = ">=3.8,<4.0"
Django = ">=3.2,<6.0"
#Django = [
# { version = "<4.0.0", python = ">=3.7,<=3.10" },
# { version = ">4.0.0,<4.1.0", python = ">=3.8,<3.11" },
# { version = ">4.1.0", python = ">=3.8" }
#]
importlib-resources = { version = ">=1.3.0", python = "<3.9" }
Jinja2 = { version = ">=2.9,<4.0", optional = true }
PyYAML = { version = ">=5.1,<7.0", optional = true }
Expand All @@ -59,37 +53,27 @@ PyYAML = { version = ">=5.1,<7.0", optional = true }
django-enum = "^1.1.0"
enum-properties = "^1.1.1"
pytest = "^7.0"
pytest-django = "^4.1.0"
Sphinx = [
{ version = "<7.0", markers = "python_version < '3.9'" },
{ version = "^7.0", markers = "python_version >= '3.9'" },
]
pytest-django = "^4.7.0"
Sphinx = "^7.0.0"
sphinx-js = [
{ version = "<3.0", markers = "python_version < '3.8'" },
{ version = "^3.0", markers = "python_version >= '3.8'" },
]
sphinx-rtd-theme = "^1.1.1"
mypy = ">=0.991,<1.5"
isort = "^5.6.4"
doc8 = "^0.11.0"
darglint = "^1.5.7"
pytest-cov = "^4.0.0"
pylint = [
{ version = "<3.0", markers = "python_version <= '3.7'" },
{ version = "^3.0", markers = "python_version > '3.7'" },
]
sphinx-argparse = "^0.3.0"
deepdiff = "^5.2.3"
safety = "^2.0.0"
readme-renderer = ">=34,<38"
pygount = "^1.2.4"
sphinx-rtd-theme = "^2.0.0"
mypy = "^1.8"
isort = "^5.13.0"
doc8 = "^1.1.0"
pytest-cov = "^4.1.0"
pylint = "^3.0.0"
sphinx-argparse = "^0.4.0"
deepdiff = "^6.7.0"
safety = "^2.3.0"
readme-renderer = ">=42"
pygount = "^1.6"
types-PyYAML = "^6.0"
coverage = ">=6.2,<8.0"
importlib-metadata = [
{ version = "<5.0", python = "<=3.7" },
{ version = ">=5.0", python = ">3.7" },
]
selenium = "^4.7.2"
coverage = "^7.3.0"
importlib-metadata = "^7.0.0"
selenium = "^4.16.0"
python-dateutil = "^2.8.2"
ipdb = "^0.13.13"

Expand All @@ -101,3 +85,77 @@ build-backend = "poetry.core.masonry.api"
yaml = ["PyYAML"]
jinja2 = ["Jinja2"]
all = ["PyYAML", "Jinja2"]


[tool.mypy]
allow_redefinition = false
check_untyped_defs = true
disallow_untyped_decorators = false
disallow_any_explicit = false
disallow_any_generics = false
disallow_untyped_calls = true
ignore_errors = false
ignore_missing_imports = true
implicit_reexport = false
strict_optional = true
strict_equality = true
local_partial_types = true
no_implicit_optional = true
warn_unused_ignores = true
warn_redundant_casts = true
warn_unused_configs = true
warn_unreachable = true
warn_no_return = true
exclude = "tests"

[tool.doc8]
ignore-path = "doc/_build"
max-line-length = 100
sphinx = true

[tool.isort]
# isort configuration:
# https://github.com/timothycrosley/isort/wiki/isort-Settings
include_trailing_comma = true
use_parentheses = true
# See https://github.com/timothycrosley/isort#multi-line-output-modes
multi_line_output = 3
default_section = "FIRSTPARTY"
line_length = 79


[tool.pylint]
output-format = "colorized"
max-line-length = 79 # PEP 8
max-args = 6

[tool.pylint.'MESSAGES CONTROL']
disable = "R0903, R0801"


[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "render_static.tests.settings"
python_files = [
"tests.py",
"yaml_tests.py",
"jinja2_tests.py",
"js_tests.py",
"examples_tests.py",
"traverse_tests.py"
# "web_tests.py"
]
norecursedirs = "*.egg .eggs dist build docs .tox .git __pycache__"
addopts = [
"--strict-markers",
"--cov=render_static",
"--cov-branch",
"--cov-report=term-missing:skip-covered",
"--cov-report=html",
"--cov-report=xml",
"--cov-fail-under=100"
]

[tool.coverage.run]
omit = [
"render_static/tests/app1/static_jinja2/batch_test/**/*"
]
19 changes: 11 additions & 8 deletions readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,21 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.11"
nodejs: "18"
python: "3.12"
nodejs: "20"
jobs:
post_create_environment:
# Install poetry
# https://python-poetry.org/docs/#installing-manually
- pip install poetry
# Tell poetry to not use a virtual environment
- poetry config virtualenvs.create false
post_install:
# Install any other extra dependencies to build the docs
# Install dependencies with 'docs' dependency group
# https://python-poetry.org/docs/managing-dependencies/#dependency-groups
- poetry install -E all
- npm install -g jsdoc

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: doc/source/conf.py

# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: doc/requirements.txt
87 changes: 0 additions & 87 deletions setup.cfg

This file was deleted.

0 comments on commit 6fbffb3

Please sign in to comment.