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
12 changes: 6 additions & 6 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
strategy:
fail-fast: false
matrix:
tox-environment:
- docs
- linter
- pkglint
hatch-environment:
- docs:build
- test:lint
- test:pkglint

steps:
- uses: actions/checkout@v2
Expand All @@ -26,7 +26,7 @@ jobs:
uses: actions/setup-python@v4

- name: Install dependencies
run: python -m pip install tox
run: python -m pip install hatch

- name: Run
run: tox -e ${{ matrix.tox-environment }}
run: hatch run ${{ matrix.hatch-environment }}
8 changes: 3 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ jobs:
fail-fast: false
matrix:
python-version:
- 3.8
- 3.9
- "3.10"
- "3.11"
- "3.12"
- "3.13"

steps:
- uses: actions/checkout@v2
Expand All @@ -30,7 +28,7 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: python -m pip install tox
run: python -m pip install hatch

- name: Run tests
run: tox -e py
run: hatch run test:test
27 changes: 12 additions & 15 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
pull_request_rules:

- name: Add CI label
conditions:
- or:
Expand All @@ -24,20 +23,18 @@ pull_request_rules:
- name: Automatic merge on approval
conditions:
- and:
- "check-success=build (docs)"
- "check-success=build (linter)"
- "check-success=build (pkglint)"
- "check-success=build (3.8)"
- "check-success=build (3.9)"
- "check-success=build (3.10)"
- "check-success=build (3.11)"
- "check-success=build (3.12)"
- "-draft"
- or:
- "approved-reviews-by=dhellmann"
- "author=dhellmann"
- "approved-reviews-by=janbrohl"
- "author=janbrohl"
- "check-success=build (docs:build)"
- "check-success=build (test:lint)"
- "check-success=build (test:pkglint)"
- "check-success=build (3.11)"
- "check-success=build (3.12)"
- "check-success=build (3.13)"
- "-draft"
- or:
- "approved-reviews-by=dhellmann"
- "author=dhellmann"
- "approved-reviews-by=janbrohl"
- "author=janbrohl"
actions:
merge:
method: merge
76 changes: 45 additions & 31 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import pkg_resources
import importlib.metadata

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand All @@ -28,57 +28,57 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.intersphinx',
'sphinx.ext.autodoc',
'sphinxcontrib.datatemplates',
"sphinx.ext.intersphinx",
"sphinx.ext.autodoc",
"sphinxcontrib.datatemplates",
"sphinxcontrib.runcmd",
]

# Support linking to Python Docs
intersphinx_mapping = {
'python': ('https://docs.python.org/', None),
'python3': ('https://docs.python.org/3', None),
'python2': ('https://docs.python.org/2', None)
"python": ("https://docs.python.org/", None),
"python3": ("https://docs.python.org/3", None),
"python2": ("https://docs.python.org/2", None),
}

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ".rst"

# The encoding of source files.
# source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# General information about the project.
project = u'sphinxcontrib.datatemplates'
copyright = u'2015, Doug Hellmann'
author = u'Doug Hellmann'
project = "sphinxcontrib.datatemplates"
copyright = "2015, Doug Hellmann"
author = "Doug Hellmann"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = pkg_resources.get_distribution('sphinxcontrib.datatemplates').version
version = importlib.metadata.version("sphinxcontrib.datatemplates")
# The full version, including alpha/beta/rc tags.
release = '0.0.0'
release = "0.0.0"

html_context = {
'sample': 'Sample context value set in conf.py',
"sample": "Sample context value set in conf.py",
}

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'
language = "en"

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
Expand Down Expand Up @@ -106,7 +106,7 @@
# show_authors = False

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"

# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []
Expand Down Expand Up @@ -150,7 +150,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
Expand Down Expand Up @@ -213,20 +213,17 @@
# html_search_scorer = 'scorer.js'

# Output file base name for HTML help builder.
htmlhelp_basename = 'sphinxcontribdatatemplatesdoc'
htmlhelp_basename = "sphinxcontribdatatemplatesdoc"

# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
# 'preamble': '',

# Latex figure (float) alignment
# 'figure_align': 'htbp',
}
Expand All @@ -235,8 +232,13 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'sphinxcontribdatatemplates.tex',
u'sphinxcontrib.datatemplates Documentation', u'Doug Hellmann', 'manual'),
(
master_doc,
"sphinxcontribdatatemplates.tex",
"sphinxcontrib.datatemplates Documentation",
"Doug Hellmann",
"manual",
),
]

# The name of an image file (relative to this directory) to place at the top of
Expand All @@ -263,8 +265,15 @@

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [(master_doc, 'sphinxcontribdatatemplates',
u'sphinxcontrib.datatemplates Documentation', [author], 1)]
man_pages = [
(
master_doc,
"sphinxcontribdatatemplates",
"sphinxcontrib.datatemplates Documentation",
[author],
1,
)
]

# If true, show URL addresses after external links.
# man_show_urls = False
Expand All @@ -275,10 +284,15 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'sphinxcontribdatatemplates',
u'sphinxcontrib.datatemplates Documentation', author,
'sphinxcontribdatatemplates', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"sphinxcontribdatatemplates",
"sphinxcontrib.datatemplates Documentation",
author,
"sphinxcontribdatatemplates",
"One line description of project.",
"Miscellaneous",
),
]

# Documents to append as an appendix to all manuals.
Expand Down
6 changes: 6 additions & 0 deletions doc/source/history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
Release History
=================

Next
====

* Switch packaging tool to hatch
* Switch linter to ruff

0.10.0
======

Expand Down
77 changes: 45 additions & 32 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
[build-system]
requires = ["setuptools", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[project]
name = "sphinxcontrib.datatemplates"
readme = "README.rst"
authors = [
{name = "Doug Hellmann", email = "[email protected]"},
]
authors = [{ name = "Doug Hellmann", email = "[email protected]" }]
description = "Sphinx extension for rendering data files as nice HTML"
dynamic = ["version"]

Expand All @@ -20,23 +18,16 @@ classifiers = [
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"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 :: 3.13",
"Topic :: Documentation",
"Topic :: Utilities",
]

requires-python = ">=3.8"
requires-python = ">=3.11"

dependencies = [
"Sphinx",
"PyYAML",
"defusedxml",
"sphinxcontrib-runcmd",
]
dependencies = ["Sphinx", "PyYAML", "defusedxml", "sphinxcontrib-runcmd"]

[project.scripts]
datatemplate = "sphinxcontrib.datatemplates.cli:main"
Expand All @@ -46,23 +37,45 @@ homepage = "https://sphinxcontribdatatemplates.readthedocs.io/en/latest/"
repository = "http://github.com/sphinx-contrib/datatemplates"

[project.optional-dependencies]
linter = [
"flake8",
]
test = [
"pytest",
"beautifulsoup4",
]
build = [
"build",
"twine",
]
linter = ["ruff"]
test = ["pytest", "beautifulsoup4"]
build = ["twine"]

[tool.hatch.version]
source = "vcs"

[tools.setuptools]
packages = [
"sphinxcontrib.datatemplates",
[tool.hatch.build.hooks.vcs]
version-file = "sphinxcontrib/datatemplates/version.py"

[tool.hatch.build.targets.sdist]
include = ["sphinxcontrib/", "README.rst", "LICENSE", "pyproject.toml"]

[tool.hatch.build.targets.wheel]
only-include = ["sphinxcontrib"]

[tool.hatch.build]
exclude = ["/doc", "/tests", "/dist", "/build"]

[tool.hatch.metadata]
allow-direct-references = true

[tool.hatch.envs.test]
features = ["test", "linter", "build"]
dependencies = ["check-python-versions"]
[tool.hatch.envs.test.scripts]
test = "pytest tests"
lint = ["ruff check sphinxcontrib", "ruff format --check sphinxcontrib"]
lint-fix = ["ruff format sphinxcontrib"]
pkglint = [
"hatch build",
"twine check dist/*.tar.gz",
"check-python-versions --only pyproject.toml,.github/workflows/test.yml",
]

# https://github.com/pypa/setuptools_scm/
[tool.setuptools_scm]
write_to = "sphinxcontrib/datatemplates/version.py"
[tool.hatch.envs.docs]
dependencies = ["sphinx"]
[tool.hatch.envs.docs.scripts]
build = "python -m sphinx.cmd.build -E -W -v -T doc/source doc/build"

[tool.ruff]
exclude = ["sphinxcontrib/datatemplates/version.py"]
Loading
Loading