Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#672 Add documentation to the dist. #673

Merged
merged 5 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 0 additions & 2 deletions admin/check_tag_version_match.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
#

import sys

from importlib import metadata


TAG_PREFIX = "refs/tags/"

if len(sys.argv) < 2:
Expand Down
2 changes: 0 additions & 2 deletions bin/towncrier
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
import os.path
import sys


srcdir = os.path.join(os.path.dirname(__file__), "..", "src")
sys.path.insert(0, srcdir)

import towncrier


towncrier._main()
2 changes: 0 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
import os

from datetime import date
from importlib.metadata import version


towncrier_version = version("towncrier")


Expand Down
1 change: 0 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import nox


nox.options.sessions = ["pre_commit", "docs", "typecheck", "tests"]
nox.options.reuse_existing_virtualenvs = True
nox.options.error_on_external_run = True
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ Distribution = "https://pypi.org/project/towncrier"
exclude = [
"admin",
"bin",
"docs",
".github",
".git-blame-ignore-revs",
".pre-commit-config.yaml,
".pre-commit-hooks.yaml",
".readthedocs.yaml",
"src/towncrier/newsfragments",
]
Expand Down
1 change: 0 additions & 1 deletion src/towncrier/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@

from towncrier._shell import cli


cli()
4 changes: 2 additions & 2 deletions src/towncrier/_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
import os
import re
import textwrap

from collections import defaultdict
from fnmatch import fnmatch
from pathlib import Path
from typing import Any, DefaultDict, Iterable, Iterator, Mapping, NamedTuple, Sequence
from typing import (Any, DefaultDict, Iterable, Iterator, Mapping, NamedTuple,
Sequence)

from click import ClickException
from jinja2 import Template
Expand Down
1 change: 0 additions & 1 deletion src/towncrier/_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from __future__ import annotations

import os

from subprocess import STDOUT, CalledProcessError, call, check_output


Expand Down
1 change: 0 additions & 1 deletion src/towncrier/_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import contextlib
import importlib.metadata
import sys

from importlib import import_module
from importlib.metadata import PackageNotFoundError
from types import ModuleType
Expand Down
1 change: 0 additions & 1 deletion src/towncrier/_settings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from towncrier._settings import load


load_config = load.load_config
ConfigError = load.ConfigError
load_config_from_options = load.load_config_from_options
Expand Down
1 change: 0 additions & 1 deletion src/towncrier/_settings/fragment_types.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

import abc

from typing import Any, Iterable, Mapping


Expand Down
2 changes: 0 additions & 2 deletions src/towncrier/_settings/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import os
import re
import sys

from contextlib import ExitStack
from pathlib import Path
from typing import Any, Literal, Mapping, Sequence
Expand All @@ -17,7 +16,6 @@

from .._settings import fragment_types as ft


if sys.version_info < (3, 10):
import importlib_resources as resources
else:
Expand Down
2 changes: 0 additions & 2 deletions src/towncrier/_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
from __future__ import annotations

import sys

from pathlib import Path
from typing import Any


if sys.version_info < (3, 10):
# Compatibility shim for newline parameter to write_text, added in 3.10
def _newline_write_text(path: Path, content: str, **kwargs: Any) -> None:
Expand Down
6 changes: 2 additions & 4 deletions src/towncrier/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,20 @@

import os
import sys

from datetime import date
from pathlib import Path

import click

from click import Context, Option, UsageError

from towncrier import _git

from ._builder import find_fragments, render_fragments, split_fragments
from ._project import get_project_name, get_version
from ._settings import ConfigError, config_option_help, load_config_from_options
from ._settings import (ConfigError, config_option_help,
load_config_from_options)
from ._writer import append_to_newsfile


if sys.version_info < (3, 10):
import importlib_resources as resources
else:
Expand Down
1 change: 0 additions & 1 deletion src/towncrier/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import os
import sys

from subprocess import CalledProcessError
from typing import Container
from warnings import warn
Expand Down
1 change: 0 additions & 1 deletion src/towncrier/click_default_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def bar():

import click


__all__ = ["DefaultGroup"]
__version__ = "1.2.2"

Expand Down
2 changes: 0 additions & 2 deletions src/towncrier/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from __future__ import annotations

import os

from pathlib import Path
from typing import cast

Expand All @@ -17,7 +16,6 @@
from ._builder import FragmentsPath
from ._settings import config_option_help, load_config_from_options


DEFAULT_CONTENT = "Add your info here"


Expand Down
1 change: 1 addition & 0 deletions src/towncrier/newsfragments/672.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The documentation RST source files are now included in the sdist package.
2 changes: 0 additions & 2 deletions src/towncrier/test/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@

import sys
import textwrap

from functools import wraps
from pathlib import Path
from subprocess import call
from typing import Any, Callable

from click.testing import CliRunner


if sys.version_info < (3, 9):
import importlib_resources as resources
else:
Expand Down
4 changes: 2 additions & 2 deletions src/towncrier/test/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import os
import tempfile

from datetime import date
from pathlib import Path
from subprocess import call
Expand All @@ -15,7 +14,8 @@

from .._shell import cli
from ..build import _main
from .helpers import read, read_pkg_resource, with_git_project, with_project, write
from .helpers import (read, read_pkg_resource, with_git_project, with_project,
write)


class TestCli(TestCase):
Expand Down
1 change: 0 additions & 1 deletion src/towncrier/test/test_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import os
import os.path
import warnings

from pathlib import Path
from subprocess import call

Expand Down
1 change: 0 additions & 1 deletion src/towncrier/test/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import os
import string

from pathlib import Path
from textwrap import dedent
from unittest import mock
Expand Down
2 changes: 0 additions & 2 deletions src/towncrier/test/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import os
import sys

from importlib.metadata import version as metadata_version

from click.testing import CliRunner
Expand All @@ -13,7 +12,6 @@
from .._shell import cli as towncrier_cli
from .helpers import write


towncrier_cli.name = "towncrier"


Expand Down
1 change: 0 additions & 1 deletion src/towncrier/test/test_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# See LICENSE for details.

import os

from pathlib import Path
from textwrap import dedent

Expand Down
Loading