Skip to content

Commit

Permalink
Switch from setuptools to hatch
Browse files Browse the repository at this point in the history
  • Loading branch information
jackrosenthal committed Sep 29, 2024
1 parent e5e4810 commit e402a41
Show file tree
Hide file tree
Showing 9 changed files with 106 additions and 205 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: "3.10"
architecture: x64
- run: pip install -e ".[docs]"
- run: sphinx-build -a docs/ docs/_build/html
- uses: actions/checkout@v4
- name: Install Hatch
uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc
- run: hatch run docs:build
- run: touch docs/_build/html/.nojekyll
- name: Upload Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: htmldocs
path: docs/_build/html
Expand All @@ -24,9 +21,9 @@ jobs:
if: "github.event_name == 'push' && github.ref == 'refs/heads/master'"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Download Artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: htmldocs
path: html
Expand Down
23 changes: 0 additions & 23 deletions .github/workflows/lint.yaml

This file was deleted.

42 changes: 6 additions & 36 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,10 @@ name: Unit Tests
on: [push, pull_request]
jobs:
unit-tests:
name: "Python ${{ matrix.versions.python }}"
runs-on: "${{ matrix.versions.os }}"
strategy:
matrix:
versions:
- python: 3.4.10
os: ubuntu-18.04
- python: 3.5.10
os: ubuntu-20.04
- python: 3.6.15
os: ubuntu-20.04
- python: 3.7.12
os: ubuntu-20.04
- python: 3.8.12
os: ubuntu-20.04
- python: 3.9.12
os: ubuntu-20.04
- python: 3.10.4
os: ubuntu-20.04
- python: 3.11.0-alpha - 3.11.0
os: ubuntu-20.04
- python: pypy-3.6
os: ubuntu-20.04
- python: pypy-3.7
os: ubuntu-20.04
- python: pypy-3.8
os: ubuntu-20.04
- python: pypy-3.9
os: ubuntu-20.04
runs-on: "ubuntu-24.04"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: "${{ matrix.versions.python }}"
architecture: x64
- run: pip install -e ".[testing]"
- run: pytest -v
- uses: actions/checkout@v4
- name: Install Hatch
uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc
- name: Run Tests
run: hatch test -a
22 changes: 13 additions & 9 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

from kajiki import version as _version
import site
import subprocess

# 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
# documentation root, use os.path.abspath to make it absolute, like shown here.
# sys.path.append(os.path.abspath('..'))
site.addsitedir("..")

# -- General configuration -----------------------------------------------------

Expand Down Expand Up @@ -51,11 +49,17 @@
# 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 = _version.__version__

# The full version, including alpha/beta/rc tags.
release = _version.__release__
release = subprocess.run(
["hatch", "version"],
check=True,
stdout=subprocess.PIPE,
encoding="utf-8",
).stdout.strip()

# The short X.Y version.
version = ".".join(release.split(".", 2)[:-1])

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
1 change: 0 additions & 1 deletion kajiki/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from .template import Template
from .text import TextTemplate
from .util import expose, flattener
from .version import __release__, __version__
from .xml_template import XMLTemplate

__all__ = [
Expand Down
2 changes: 0 additions & 2 deletions kajiki/version.py

This file was deleted.

80 changes: 80 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "kajiki"
version = "1.0.0.dev1"
description = "Fast XML-based template engine with Genshi syntax and Jinja blocks"
readme = "README.rst"
license = "MIT"
requires-python = ">=3.9"
authors = [
{ name = "Rick Copeland", email = "[email protected]" },
{ name = "Nando Florestan", email = "[email protected]" },
{ name = "Alessandro Molina", email = "[email protected]" },
{ name = "Jack Rosenthal", email = "[email protected]" },
]
maintainers = [
{ name = "Jack Rosenthal", email = "[email protected]" },
]
keywords = [
"chameleon",
"engine",
"genshi",
"html",
"jinja",
"jinja2",
"mako",
"template",
"templating",
"xhtml",
"xml",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"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 :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Text Processing :: Markup :: HTML",
"Topic :: Text Processing :: Markup :: XML",
]
dependencies = [
"linetable",
]

[project.urls]
Homepage = "https://github.com/jackrosenthal/kajiki"

[tool.hatch.build.targets.sdist]
include = [
"/kajiki",
"/tests",
]

[[tool.hatch.envs.hatch-test.matrix]]
python = ["3.9", "3.10", "3.11", "3.12"]

[tool.hatch.envs.default]
installer = "uv"
python = "3.12"

[tool.hatch.envs.docs]
dependencies = [
"sphinx",
]

[tool.hatch.envs.docs.scripts]
build = "sphinx-build -M html docs docs/_build"
48 changes: 0 additions & 48 deletions release_new_version.py

This file was deleted.

76 changes: 0 additions & 76 deletions setup.py

This file was deleted.

0 comments on commit e402a41

Please sign in to comment.