Skip to content

Commit

Permalink
chore: template fixes (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterschutt authored Sep 20, 2023
1 parent 7d9c55f commit 633ba38
Show file tree
Hide file tree
Showing 11 changed files with 1,448 additions and 248 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ jobs:
- name: Check out repository
uses: actions/checkout@v4

- name: Install Microsoft ODBC Drivers
run: sudo ACCEPT_EULA=Y apt-get install msodbcsql18 -y

- uses: pdm-project/setup-pdm@v3
name: Set up PDM
with:
Expand All @@ -57,7 +54,7 @@ jobs:
run: pdm install

- name: Test
run: pdm run pytest -m "" -n auto
run: pdm run pytest -m ""

build-docs:
needs:
Expand All @@ -68,9 +65,6 @@ jobs:
- name: Check out repository
uses: actions/checkout@v4

- name: Install Microsoft ODBC
run: sudo ACCEPT_EULA=Y apt-get install msodbcsql18 -y

- name: Set up Python
uses: actions/setup-python@v4
with:
Expand Down
21 changes: 2 additions & 19 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,25 +59,8 @@ repos:
rev: "v1.5.1"
hooks:
- id: mypy
exclude: "test_apps|tools|docs|tests/examples|"
additional_dependencies:
[
annotated_types,
hypothesis,
polyfactory,
pydantic-extra-types,
pydantic>=2,
pytest,
pytest-lazy-fixture,
pytest-mock,
pytest-timeout,
pytest_docker,
redis,
rich,
rich-click,
click,
uvicorn,
]
exclude: "tools|docs"
additional_dependencies: [pytest]
- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: "v0.6.8"
hooks:
Expand Down
4 changes: 2 additions & 2 deletions docs/PYPI_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ any project that is a part of the Jolt organization.
> [!IMPORTANT]\
>
> - [Create a new repository][newrepo] using this template repository.
> - Run the [new_project.py][tools/new_project.py] script to initialize the project and set the project name.
> - Update the [README.md][README.md] file with the project-specific information.
> - Run the [new_project.py](tools/new_project.py) script to initialize the project and set the project name.
> - Update the [README.md](README.md) file with the project-specific information.
> - (Optional if not using docs) Create the `$project-name-docs-preview` repository.
> - If the project does not utilize docs, remove the `.github/workflows/docs-preview.yaml`.
> - Remove any template-specific sections from the repos
Expand Down
27 changes: 4 additions & 23 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
# Configuration file for the Sphinx documentation builder.
import os

from project-template.__metadata__ import __project__ as project
from project-template.__metadata__ import __version__ as version
from project_template.__metadata__ import __project__ as project
from project_template.__metadata__ import __version__ as version

# -- Environmental Data ------------------------------------------------------


# -- Project information -----------------------------------------------------
project = project
author = "Jolt Org"
release = version
release = os.getenv("_PROJECT-TEMPLATE_DOCS_BUILD_VERSION", version.rsplit(".")[0])
copyright = "2023, Jolt Org"

Expand Down Expand Up @@ -41,25 +39,8 @@
PY_OBJ = "py:obj"

nitpicky = True
nitpick_ignore = [
# external library / undocumented external
(PY_CLASS, "ExternalType"),
(PY_CLASS, "TypeEngine"),
(PY_CLASS, "UserDefinedType"),
(PY_CLASS, "_types.TypeDecorator"),
(PY_METH, "_types.TypeDecorator.process_bind_param"),
(PY_METH, "_types.TypeDecorator.process_result_value"),
(PY_METH, "type_engine"),
# type vars and aliases / intentionally undocumented
(PY_CLASS, "CollectionT"),
(PY_CLASS, "EmptyType"),
(PY_CLASS, "ModelT"),
(PY_CLASS, "T"),
(PY_CLASS, "AsyncSession"),
(PY_CLASS, "Select"),
]
nitpick_ignore_regex = [
]
nitpick_ignore = []
nitpick_ignore_regex = []

napoleon_google_docstring = True
napoleon_include_special_with_doc = True
Expand Down
1,434 changes: 1,434 additions & 0 deletions pdm.lock

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
9 changes: 3 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ line-length = 120
include = '\.pyi?$'

[tool.codespell]
ignore-words-list = "selectin"
skip = 'pdm.lock'

[tool.coverage.run]
Expand All @@ -112,23 +111,21 @@ exclude_lines = [
asyncio_mode = "auto"

[tool.pyright]
include = ["src"]
include = ["project_template"]
exclude = ["tools"]

[tool.slotscheck]
strict-imports = false

[tool.mypy]
plugins = ["pydantic.mypy"]

warn_unused_ignores = true
warn_redundant_casts = true
warn_unused_configs = true
warn_unreachable = true
warn_return_any = true
strict = true
disallow_untyped_decorators = true
disallow_any_generics = false
disallow_any_generics = true
implicit_reexport = false
show_error_codes = true

Expand All @@ -152,7 +149,7 @@ ignore = [
"PLW2901" # pylint - for loop variable overwritten by assignment target
]
line-length = 120
src = ["src", "tests", "docs/examples"]
src = ["project_template", "tests", "docs/examples"]
target-version = "py38"

[tool.ruff.pydocstyle]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_src.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from src import return_three
from project_template import return_three


def test_return_three() -> None:
Expand Down
3 changes: 1 addition & 2 deletions tools/sphinx_ext/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

from typing import TYPE_CHECKING

from . import changelog, missing_references, run_examples
from . import changelog, missing_references

if TYPE_CHECKING:
from sphinx.application import Sphinx


def setup(app: Sphinx) -> dict[str, bool]:
ext_config = {}
ext_config.update(run_examples.setup(app))
ext_config.update(missing_references.setup(app))
ext_config.update(changelog.setup(app))

Expand Down
188 changes: 0 additions & 188 deletions tools/sphinx_ext/run_examples.py

This file was deleted.

0 comments on commit 633ba38

Please sign in to comment.