Skip to content

Commit

Permalink
Update pre-commit, add pyproject-fmt, run on all files
Browse files Browse the repository at this point in the history
  • Loading branch information
robhudson committed Apr 25, 2024
1 parent 4899179 commit eabd326
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 50 deletions.
10 changes: 7 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,20 @@
repos:
# Note: hooks that add content must run before ones which check formatting, lint, etc
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0 # Use the ref you want to point at
rev: v4.6.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.1.14
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.1
hooks:
# Run the linter
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
# Run the formatter
- id: ruff-format
- repo: https://github.com/tox-dev/pyproject-fmt
rev: 1.8.0
hooks:
- id: pyproject-fmt
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ python:
install:
- method: pip
path: .
- requirements: docs/requirements.txt
- requirements: docs/requirements.txt
2 changes: 1 addition & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CHANGES
Unreleased
==========

- Nothing, currently
- Add pyproject-fmt to pre-commit, and update pre-commit versions.

3.8
===
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Django-CSP

Django-CSP adds Content-Security-Policy_ headers to Django.

The code lives on GitHub_, where you can report Issues_.
The code lives on GitHub_, where you can report Issues_.

The full documentation is available on ReadTheDocs_.

Expand Down
4 changes: 1 addition & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,7 @@

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
("index", "django-csp", "Django-CSP Documentation", ["James Socol, Mozilla"], 1)
]
man_pages = [("index", "django-csp", "Django-CSP Documentation", ["James Socol, Mozilla"], 1)]

# If true, show URL addresses after external links.
# man_show_urls = False
Expand Down
2 changes: 1 addition & 1 deletion docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,4 @@ These settings control the behavior of django-csp. Defaults are in
.. _block-all-mixed-content: https://w3c.github.io/webappsec-mixed-content/
.. _block-all-mixed-content_mdn: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/block-all-mixed-content
.. _plugin_types_mdn: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/plugin-types
.. _prefetch_src_mdn: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/prefetch-src
.. _prefetch_src_mdn: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/prefetch-src
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sphinx_rtd_theme
sphinx_rtd_theme
82 changes: 43 additions & 39 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,55 +1,59 @@
[build-system]
requires = ["setuptools>=61.2"]
build-backend = "setuptools.build_meta"
requires = [
"setuptools>=61.2",
]

[project]
name = "django_csp"
name = "django-csp"
version = "3.8"
description = "Django Content Security Policy support."
readme = "README.rst"
authors = [{name = "James Socol", email = "[email protected]"}]
maintainers = [{name = "Mozilla MEAO team", email = "[email protected]"}]
license = {text = "BSD"}
maintainers = [{name = "Mozilla MEAO team", email = "[email protected]"}]
authors = [{name = "James Socol", email = "[email protected]"}]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Environment :: Web Environment :: Mozilla",
"Programming Language :: Python",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
"Topic :: Software Development :: Libraries :: Python Modules",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python :: Implementation :: CPython",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Environment :: Web Environment :: Mozilla",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"Django>=3.2",
]
dependencies = ["Django>=3.2"]

[project.urls]
Homepage = "http://github.com/mozilla/django-csp"
Documentation = "http://django-csp.readthedocs.org/"
Changelog = "https://github.com/mozilla/django-csp/blob/main/CHANGES"
"Bug Tracker" = "https://github.com/mozilla/django-csp/issues"
"Source Code" = "https://github.com/mozilla/django-csp"

[project.optional-dependencies]
jinja2 = [
"jinja2>=2.9.6",
]
tests = [
"pytest",
"pytest-cov",
"pytest-django",
"pytest-ruff",
"jinja2>=2.9.6",
"jinja2>=2.9.6",
"pytest",
"pytest-cov",
"pytest-django",
"pytest-ruff",
]
jinja2 = ["jinja2>=2.9.6"]
[project.urls]
"Bug Tracker" = "https://github.com/mozilla/django-csp/issues"
Changelog = "https://github.com/mozilla/django-csp/blob/main/CHANGES"
Documentation = "http://django-csp.readthedocs.org/"
Homepage = "http://github.com/mozilla/django-csp"
"Source Code" = "https://github.com/mozilla/django-csp"

[tool.setuptools]
zip-safe = false
Expand Down

0 comments on commit eabd326

Please sign in to comment.