Skip to content

Commit

Permalink
Fixes for Github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Bart van der Schoor committed Feb 28, 2024
1 parent d0d7d97 commit 68b754e
Show file tree
Hide file tree
Showing 9 changed files with 184 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
python: ['3.10', '3.11', '3.12']
django: ['4.2']
django: ['3.2', '4.2']

name: Run the test suite (Python ${{ matrix.python }}, Django ${{ matrix.django }})

Expand Down
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
17 changes: 17 additions & 0 deletions docs/check_sphinx.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import subprocess


def test_linkcheck(tmpdir):
doctrees = tmpdir.join("doctrees")
htmldir = tmpdir.join("html")
subprocess.check_call(
["sphinx-build", "-W", "-blinkcheck", "-d", str(doctrees), ".", str(htmldir)],
)


def test_build_docs(tmpdir):
doctrees = tmpdir.join("doctrees")
htmldir = tmpdir.join("html")
subprocess.check_call(
["sphinx-build", "-W", "-bhtml", "-d", str(doctrees), ".", str(htmldir)],
)
61 changes: 61 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# 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.
#
import sys
from pathlib import Path

current_dir = Path(__file__).parents[1]
code_directory = current_dir / "mail_editor"

sys.path.insert(0, str(code_directory))


# -- Project information -----------------------------------------------------

project = "mail_editor"
copyright = "2024, Maykin Media"
author = "Maykin Media"

# The full version, including alpha/beta/rc tags
release = "0.1.0"


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

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named "sphinx.ext.*") or your custom
# ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.todo",
]

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

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"

# 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 = []
60 changes: 60 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
.. mail_editor documentation master file, created by startproject.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to mail_editor's documentation!
=================================================

|build-status| |code-quality| |black| |coverage| |docs|

|python-versions| |django-versions| |pypi-version|

<One liner describing the project>

Features
========

* ...
* ...

.. toctree::
:maxdepth: 2
:caption: Contents:

quickstart



Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


.. |build-status| image:: https://github.com/maykinmedia/mail_editor/workflows/Run%20CI/badge.svg
:alt: Build status
:target: https://github.com/maykinmedia/mail_editor/actions?query=workflow%3A%22Run+CI%22

.. |code-quality| image:: https://github.com/maykinmedia/mail_editor/workflows/Code%20quality%20checks/badge.svg
:alt: Code quality checks
:target: https://github.com/maykinmedia/mail_editor/actions?query=workflow%3A%22Code+quality+checks%22

.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black

.. |coverage| image:: https://codecov.io/gh/maykinmedia/mail_editor/branch/master/graph/badge.svg
:target: https://codecov.io/gh/maykinmedia/mail_editor
:alt: Coverage status

.. |docs| image:: https://readthedocs.org/projects/mail_editor/badge/?version=latest
:target: https://mail_editor.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

.. |python-versions| image:: https://img.shields.io/pypi/pyversions/mail_editor.svg

.. |django-versions| image:: https://img.shields.io/pypi/djversions/mail_editor.svg

.. |pypi-version| image:: https://img.shields.io/pypi/v/mail_editor.svg
:target: https://pypi.org/project/mail_editor/
18 changes: 18 additions & 0 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
==========
Quickstart
==========

Installation
============

Install from PyPI with pip:

.. code-block:: bash
pip install mail_editor
Usage
=====

<document how to use the app here>
2 changes: 2 additions & 0 deletions fix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ black ./mail_editor
isort --profile black ./tests
autoflake --in-place --remove-all-unused-imports -r ./tests
black ./tests

black ./docs
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ classifiers = [
]
requires-python = ">=3.10"
dependencies = [
"django>=4.2",
"django>=3.2",
"django-choices",
"django-ckeditor",
"requests",
Expand All @@ -50,6 +50,8 @@ tests = [
"isort",
"black",
"flake8",
"autoflake",
"django_webtest",
]
coverage = [
"pytest-cov",
Expand All @@ -76,7 +78,7 @@ sections=["FUTURE", "STDLIB", "DJANGO", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER

[tool.pytest.ini_options]
testpaths = ["tests"]
DJANGO_SETTINGS_MODULE = "testapp.settings"
DJANGO_SETTINGS_MODULE = "tests.settings"

[tool.bumpversion]
current_version = "0.3.5"
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ commands = isort --check-only --diff .
[testenv:black]
extras = tests
skipsdist = True
commands = black --check mail_editor docs testapp tests
commands = black --check mail_editor docs tests

[testenv:flake8]
extras = tests
Expand Down

0 comments on commit 68b754e

Please sign in to comment.