Skip to content

Commit 2ba75a4

Browse files
authored
Publish types, classes, and functions. (#197)
1 parent a39476b commit 2ba75a4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+164
-70
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ repos:
8080
rev: 1.5.0
8181
hooks:
8282
- id: interrogate
83-
args: [-v, --fail-under=40, src, tests]
83+
args: [-v, --fail-under=75]
84+
exclude: ^(tests/|docs/)
8485
- repo: https://github.com/codespell-project/codespell
8586
rev: v2.1.0
8687
hooks:
@@ -90,6 +91,8 @@ repos:
9091
rev: "0.47"
9192
hooks:
9293
- id: check-manifest
94+
args: [--no-build-isolation]
95+
additional_dependencies: [setuptools-scm, toml]
9396
- repo: https://github.com/guilatrova/tryceratops
9497
rev: v1.0.1
9598
hooks:
@@ -108,7 +111,6 @@ repos:
108111
types-setuptools
109112
]
110113
pass_filenames: false
111-
language_version: "3.9"
112114
- repo: meta
113115
hooks:
114116
- id: check-hooks-apply

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
include CITATION
22
include LICENSE
33

4+
recursive-include src py.typed
5+
46
exclude .coveragerc
57
exclude *.yaml
68
exclude *.yml

docs/rtd_environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ dependencies:
2727
- pony >=0.7.15
2828
- pexpect
2929
- rich
30+
- typing-extensions
3031

3132
- pip:
3233
- ../

docs/source/changes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ all releases are available on `PyPI <https://pypi.org/project/pytask>`_ and
1010
0.1.9 - 2022-xx-xx
1111
------------------
1212

13+
- :gh:`197` publishes types, and adds classes and functions to the main namespace.
1314
- :gh:`217` enhances the tutorial on how to set up a project.
1415
- :gh:`218` removes ``depends_on`` and ``produces`` from the task function when parsed.
1516
- :gh:`219` removes some leftovers from pytest in :class:`~_pytask.mark.Mark`.

environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ dependencies:
2323
- pluggy
2424
- pony >=0.7.15
2525
- rich
26+
- typing-extensions
2627

2728
# Misc
2829
- black

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[build-system]
22
requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.0"]
3+
build-backend = "setuptools.build_meta"
34

45

56
[tool.setuptools_scm]

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ install_requires =
4242
pluggy
4343
pony>=0.7.15
4444
rich
45+
typing-extensions
4546
python_requires = >=3.7
4647
include_package_data = True
4748
package_dir =

setup.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/_pytask/click.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""This module contains code related to click."""
12
from __future__ import annotations
23

34
from typing import Any
@@ -18,11 +19,16 @@
1819

1920

2021
class OptionHighlighter(RegexHighlighter):
22+
"""A highlighter for help texts."""
23+
2124
highlights = [_SWITCH_REGEX, _OPTION_REGEX, _METAVAR_REGEX]
2225

2326

2427
class ColoredGroup(DefaultGroup):
28+
"""A subclass which colors groups with default commands."""
29+
2530
def format_help(self: DefaultGroup, ctx: Any, formatter: Any) -> None: # noqa: U100
31+
"""Format the help text."""
2632
highlighter = OptionHighlighter()
2733

2834
console.print(
@@ -71,6 +77,7 @@ class ColoredCommand(click.Command):
7177
def format_help(
7278
self: click.Command, ctx: Any, formatter: Any # noqa: U100
7379
) -> None:
80+
"""Format the help text."""
7481
console.print(
7582
f"[b]pytask[/b] [dim]v{version}[/]\n", justify="center", highlight=False
7683
)
@@ -91,6 +98,7 @@ def format_help(
9198

9299

93100
def print_options(group_or_command: click.Command | DefaultGroup, ctx: Any) -> None:
101+
"""Print options formatted with a table in a panel."""
94102
highlighter = OptionHighlighter()
95103

96104
options_table = Table(highlight=True, box=None, show_header=False)

src/_pytask/compat.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
from packaging.version import parse as parse_version
1111

1212

13+
__all__ = ["check_for_optional_program", "import_optional_dependency"]
14+
15+
1316
_MINIMUM_VERSIONS: dict[str, str] = {}
1417
"""Dict[str, str]: A mapping from packages to their minimum versions."""
1518

0 commit comments

Comments
 (0)