pax_global_header00006660000000000000000000000064146022073300014507gustar00rootroot0000000000000052 comment=0b64201a42adc3ee2b2a994a86f11eb0df1459c6 jaraco.classes-3.4.0/000077500000000000000000000000001460220733000144065ustar00rootroot00000000000000jaraco.classes-3.4.0/.coveragerc000066400000000000000000000003101460220733000165210ustar00rootroot00000000000000[run] omit = # leading `*/` for pytest-dev/pytest-cov#456 */.tox/* disable_warnings = couldnt-parse [report] show_missing = True exclude_also = # jaraco/skeleton#97 @overload if TYPE_CHECKING: jaraco.classes-3.4.0/.editorconfig000066400000000000000000000003661460220733000170700ustar00rootroot00000000000000root = true [*] charset = utf-8 indent_style = tab indent_size = 4 insert_final_newline = true end_of_line = lf [*.py] indent_style = space max_line_length = 88 [*.{yml,yaml}] indent_style = space indent_size = 2 [*.rst] indent_style = space jaraco.classes-3.4.0/.github/000077500000000000000000000000001460220733000157465ustar00rootroot00000000000000jaraco.classes-3.4.0/.github/FUNDING.yml000066400000000000000000000000361460220733000175620ustar00rootroot00000000000000tidelift: pypi/jaraco.classes jaraco.classes-3.4.0/.github/dependabot.yml000066400000000000000000000002241460220733000205740ustar00rootroot00000000000000version: 2 updates: - package-ecosystem: "pip" directory: "/" schedule: interval: "daily" allow: - dependency-type: "all" jaraco.classes-3.4.0/.github/workflows/000077500000000000000000000000001460220733000200035ustar00rootroot00000000000000jaraco.classes-3.4.0/.github/workflows/main.yml000066400000000000000000000054471460220733000214640ustar00rootroot00000000000000name: tests on: merge_group: push: branches-ignore: # temporary GH branches relating to merge queues (jaraco/skeleton#93) - gh-readonly-queue/** tags: # required if branches-ignore is supplied (jaraco/skeleton#103) - '**' pull_request: permissions: contents: read env: # Environment variable to support color support (jaraco/skeleton#66) FORCE_COLOR: 1 # Suppress noisy pip warnings PIP_DISABLE_PIP_VERSION_CHECK: 'true' PIP_NO_PYTHON_VERSION_WARNING: 'true' PIP_NO_WARN_SCRIPT_LOCATION: 'true' # Ensure tests can sense settings about the environment TOX_OVERRIDE: >- testenv.pass_env+=GITHUB_*,FORCE_COLOR jobs: test: strategy: matrix: python: - "3.8" - "3.12" platform: - ubuntu-latest - macos-latest - windows-latest include: - python: "3.9" platform: ubuntu-latest - python: "3.10" platform: ubuntu-latest - python: "3.11" platform: ubuntu-latest - python: pypy3.10 platform: ubuntu-latest runs-on: ${{ matrix.platform }} continue-on-error: ${{ matrix.python == '3.13' }} steps: - uses: actions/checkout@v4 - name: Setup Python uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} allow-prereleases: true - name: Install tox run: python -m pip install tox - name: Run run: tox collateral: strategy: fail-fast: false matrix: job: - diffcov - docs runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup Python uses: actions/setup-python@v4 with: python-version: 3.x - name: Install tox run: python -m pip install tox - name: Eval ${{ matrix.job }} run: tox -e ${{ matrix.job }} check: # This job does nothing and is only used for the branch protection if: always() needs: - test - collateral runs-on: ubuntu-latest steps: - name: Decide whether the needed jobs succeeded or failed uses: re-actors/alls-green@release/v1 with: jobs: ${{ toJSON(needs) }} release: permissions: contents: write needs: - check if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Setup Python uses: actions/setup-python@v4 with: python-version: 3.x - name: Install tox run: python -m pip install tox - name: Run run: tox -e release env: TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} jaraco.classes-3.4.0/.pre-commit-config.yaml000066400000000000000000000001641460220733000206700ustar00rootroot00000000000000repos: - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.1.8 hooks: - id: ruff - id: ruff-format jaraco.classes-3.4.0/.readthedocs.yaml000066400000000000000000000005171460220733000176400ustar00rootroot00000000000000version: 2 python: install: - path: . extra_requirements: - docs # required boilerplate readthedocs/readthedocs.org#10401 build: os: ubuntu-lts-latest tools: python: latest # post-checkout job to ensure the clone isn't shallow jaraco/skeleton#114 jobs: post_checkout: - git fetch --unshallow || true jaraco.classes-3.4.0/LICENSE000066400000000000000000000017771460220733000154270ustar00rootroot00000000000000Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. jaraco.classes-3.4.0/NEWS.rst000066400000000000000000000032331460220733000157150ustar00rootroot00000000000000v3.4.0 ====== Features -------- - Better type hints for NonDataProperty. (#13) v3.3.1 ====== No significant changes. v3.3.0 ====== Features -------- - Require Python 3.8 or later. v3.2.3 ====== #7: Enabled badge with link to docs in the readme. v3.2.2 ====== Refreshed package metadata. Enrolled with Tidelift. v3.2.1 ====== Refreshed package metadata. v3.2.0 ====== Switched to native namespace for jaraco package. v3.1.1 ====== Packaging refresh and associated cleanups, including fix for #4 (failing black check). v3.1.0 ====== ``classproperty`` decorator now supplies a ``classproperty.Meta`` class. Classes that wish to have a class property should derive from that metaclass. This approach solves the unintended behavior of the property only being set on a given instance. For compatibility, the old behavior is retained if the metaclass is not used. v3.0.0 ====== Project now requires Python 3.6 or later. 2.0 === Switch to `pkgutil namespace technique `_ for the ``jaraco`` namespace. 1.5 === Refresh packaging. Use Python 3 syntax for new-style classes. 1.4.3 ===== Corrected namespace package declaration to match ``jaraco`` namespaced packages. 1.4.2 ===== #1: Added a project description. 1.4.1 ===== Refresh packaging. 1.4 === Added documentation. Project is now automatically released by Travis CI. 1.3 === Move hosting to Github. Use setuptools_scm for version detection. 1.2 === Limit dependencies in setup_requires. 1.1 === Added ``properties`` module from jaraco.util 10.8. 1.0 === Initial release based on jaraco.util 10.8. jaraco.classes-3.4.0/README.rst000066400000000000000000000026161460220733000161020ustar00rootroot00000000000000.. image:: https://img.shields.io/pypi/v/jaraco.classes.svg :target: https://pypi.org/project/jaraco.classes .. image:: https://img.shields.io/pypi/pyversions/jaraco.classes.svg .. image:: https://github.com/jaraco/jaraco.classes/actions/workflows/main.yml/badge.svg :target: https://github.com/jaraco/jaraco.classes/actions?query=workflow%3A%22tests%22 :alt: tests .. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json :target: https://github.com/astral-sh/ruff :alt: Ruff .. image:: https://readthedocs.org/projects/jaracoclasses/badge/?version=latest :target: https://jaracoclasses.readthedocs.io/en/latest/?badge=latest .. image:: https://img.shields.io/badge/skeleton-2024-informational :target: https://blog.jaraco.com/skeleton .. image:: https://tidelift.com/badges/package/pypi/jaraco.classes :target: https://tidelift.com/subscription/pkg/pypi-jaraco.classes?utm_source=pypi-jaraco.classes&utm_medium=readme For Enterprise ============== Available as part of the Tidelift Subscription. This project and the maintainers of thousands of other packages are working with Tidelift to deliver one enterprise subscription that covers all of the open source you use. `Learn more `_. jaraco.classes-3.4.0/SECURITY.md000066400000000000000000000002641460220733000162010ustar00rootroot00000000000000# Security Contact To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. jaraco.classes-3.4.0/docs/000077500000000000000000000000001460220733000153365ustar00rootroot00000000000000jaraco.classes-3.4.0/docs/conf.py000066400000000000000000000030131460220733000166320ustar00rootroot00000000000000extensions = [ 'sphinx.ext.autodoc', 'jaraco.packaging.sphinx', ] master_doc = "index" html_theme = "furo" # Link dates and other references in the changelog extensions += ['rst.linker'] link_files = { '../NEWS.rst': dict( using=dict(GH='https://github.com'), replace=[ dict( pattern=r'(Issue #|\B#)(?P\d+)', url='{package_url}/issues/{issue}', ), dict( pattern=r'(?m:^((?Pv?\d+(\.\d+){1,2}))\n[-=]+\n)', with_scm='{text}\n{rev[timestamp]:%d %b %Y}\n', ), dict( pattern=r'PEP[- ](?P\d+)', url='https://peps.python.org/pep-{pep_number:0>4}/', ), ], ) } # Be strict about any broken references nitpicky = True nitpick_ignore = [ ('py:class', 'Self'), ('py:class', '_T'), ('py:class', '_U'), ('py:obj', 'jaraco.classes.properties._T'), ('py:obj', 'jaraco.classes.properties._U'), ('py:class', '_ClassPropertyAttribute'), ('py:class', '_GetterCallable'), ('py:class', '_GetterClassMethod'), ('py:class', '_SetterCallable'), ('py:class', '_SetterClassMethod'), ] # Include Python intersphinx mapping to prevent failures # jaraco/skeleton#51 extensions += ['sphinx.ext.intersphinx'] intersphinx_mapping = { 'python': ('https://docs.python.org/3', None), } # Preserve authored syntax for defaults autodoc_preserve_defaults = True extensions += ['jaraco.tidelift'] jaraco.classes-3.4.0/docs/history.rst000066400000000000000000000001161460220733000175670ustar00rootroot00000000000000:tocdepth: 2 .. _changes: History ******* .. include:: ../NEWS (links).rst jaraco.classes-3.4.0/docs/index.rst000066400000000000000000000010731460220733000172000ustar00rootroot00000000000000Welcome to |project| documentation! =================================== .. sidebar-links:: :home: :pypi: .. toctree:: :maxdepth: 1 history .. tidelift-referral-banner:: .. automodule:: jaraco.classes.ancestry :members: :undoc-members: :show-inheritance: .. automodule:: jaraco.classes.meta :members: :undoc-members: :show-inheritance: .. automodule:: jaraco.classes.properties :members: :undoc-members: :show-inheritance: Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` jaraco.classes-3.4.0/jaraco/000077500000000000000000000000001460220733000156455ustar00rootroot00000000000000jaraco.classes-3.4.0/jaraco/classes/000077500000000000000000000000001460220733000173025ustar00rootroot00000000000000jaraco.classes-3.4.0/jaraco/classes/__init__.py000066400000000000000000000000001460220733000214010ustar00rootroot00000000000000jaraco.classes-3.4.0/jaraco/classes/ancestry.py000066400000000000000000000033731460220733000215120ustar00rootroot00000000000000""" Routines for obtaining the class names of an object and its parent classes. """ from __future__ import annotations from typing import TYPE_CHECKING, cast from more_itertools import unique_everseen if TYPE_CHECKING: from collections.abc import Iterator from typing import Any def all_bases(c: type[object]) -> list[type[Any]]: """ return a tuple of all base classes the class c has as a parent. >>> object in all_bases(list) True """ return c.mro()[1:] def all_classes(c: type[object]) -> list[type[Any]]: """ return a tuple of all classes to which c belongs >>> list in all_classes(list) True """ return c.mro() # borrowed from # http://code.activestate.com/recipes/576949-find-all-subclasses-of-a-given-class/ def iter_subclasses(cls: type[object]) -> Iterator[type[Any]]: """ Generator over all subclasses of a given class, in depth-first order. >>> bool in list(iter_subclasses(int)) True >>> class A(object): pass >>> class B(A): pass >>> class C(A): pass >>> class D(B,C): pass >>> class E(D): pass >>> >>> for cls in iter_subclasses(A): ... print(cls.__name__) B D E C >>> # get ALL classes currently defined >>> res = [cls.__name__ for cls in iter_subclasses(object)] >>> 'type' in res True >>> 'tuple' in res True >>> len(res) > 100 True """ return unique_everseen(_iter_all_subclasses(cls)) def _iter_all_subclasses(cls: type[object]) -> Iterator[type[Any]]: try: subs = cls.__subclasses__() except TypeError: # fails only when cls is type subs = cast('type[type]', cls).__subclasses__(cls) for sub in subs: yield sub yield from iter_subclasses(sub) jaraco.classes-3.4.0/jaraco/classes/meta.py000066400000000000000000000042261460220733000206060ustar00rootroot00000000000000""" meta.py Some useful metaclasses. """ from __future__ import annotations from typing import TYPE_CHECKING if TYPE_CHECKING: from typing import Any class LeafClassesMeta(type): """ A metaclass for classes that keeps track of all of them that aren't base classes. >>> Parent = LeafClassesMeta('MyParentClass', (), {}) >>> Parent in Parent._leaf_classes True >>> Child = LeafClassesMeta('MyChildClass', (Parent,), {}) >>> Child in Parent._leaf_classes True >>> Parent in Parent._leaf_classes False >>> Other = LeafClassesMeta('OtherClass', (), {}) >>> Parent in Other._leaf_classes False >>> len(Other._leaf_classes) 1 """ _leaf_classes: set[type[Any]] def __init__( cls, name: str, bases: tuple[type[object], ...], attrs: dict[str, object], ) -> None: if not hasattr(cls, '_leaf_classes'): cls._leaf_classes = set() leaf_classes = getattr(cls, '_leaf_classes') leaf_classes.add(cls) # remove any base classes leaf_classes -= set(bases) class TagRegistered(type): """ As classes of this metaclass are created, they keep a registry in the base class of all classes by a class attribute, indicated by attr_name. >>> FooObject = TagRegistered('FooObject', (), dict(tag='foo')) >>> FooObject._registry['foo'] is FooObject True >>> BarObject = TagRegistered('Barobject', (FooObject,), dict(tag='bar')) >>> FooObject._registry is BarObject._registry True >>> len(FooObject._registry) 2 '...' below should be 'jaraco.classes' but for pytest-dev/pytest#3396 >>> FooObject._registry['bar'] """ attr_name = 'tag' def __init__( cls, name: str, bases: tuple[type[object], ...], namespace: dict[str, object], ) -> None: super(TagRegistered, cls).__init__(name, bases, namespace) if not hasattr(cls, '_registry'): cls._registry = {} meta = cls.__class__ attr = getattr(cls, meta.attr_name, None) if attr: cls._registry[attr] = cls jaraco.classes-3.4.0/jaraco/classes/properties.py000066400000000000000000000140571460220733000220570ustar00rootroot00000000000000from __future__ import annotations from typing import TYPE_CHECKING, Generic, TypeVar, cast, overload _T = TypeVar('_T') _U = TypeVar('_U') if TYPE_CHECKING: from collections.abc import Callable from typing import Any, Protocol from typing_extensions import Self, TypeAlias # TODO(coherent-oss/granary#4): Migrate to PEP 695 by 2027-10. _GetterCallable: TypeAlias = Callable[..., _T] _GetterClassMethod: TypeAlias = classmethod[Any, [], _T] _SetterCallable: TypeAlias = Callable[[type[Any], _T], None] _SetterClassMethod: TypeAlias = classmethod[Any, [_T], None] class _ClassPropertyAttribute(Protocol[_T]): def __get__(self, obj: object, objtype: type[Any] | None = None) -> _T: ... def __set__(self, obj: object, value: _T) -> None: ... class NonDataProperty(Generic[_T, _U]): """Much like the property builtin, but only implements __get__, making it a non-data property, and can be subsequently reset. See http://users.rcn.com/python/download/Descriptor.htm for more information. >>> class X(object): ... @NonDataProperty ... def foo(self): ... return 3 >>> x = X() >>> x.foo 3 >>> x.foo = 4 >>> x.foo 4 '...' below should be 'jaraco.classes' but for pytest-dev/pytest#3396 >>> X.foo <....properties.NonDataProperty object at ...> """ def __init__(self, fget: Callable[[_T], _U]) -> None: assert fget is not None, "fget cannot be none" assert callable(fget), "fget must be callable" self.fget = fget @overload def __get__( self, obj: None, objtype: None, ) -> Self: ... @overload def __get__( self, obj: _T, objtype: type[_T] | None = None, ) -> _U: ... def __get__( self, obj: _T | None, objtype: type[_T] | None = None, ) -> Self | _U: if obj is None: return self return self.fget(obj) class classproperty(Generic[_T]): """ Like @property but applies at the class level. >>> class X(metaclass=classproperty.Meta): ... val = None ... @classproperty ... def foo(cls): ... return cls.val ... @foo.setter ... def foo(cls, val): ... cls.val = val >>> X.foo >>> X.foo = 3 >>> X.foo 3 >>> x = X() >>> x.foo 3 >>> X.foo = 4 >>> x.foo 4 Setting the property on an instance affects the class. >>> x.foo = 5 >>> x.foo 5 >>> X.foo 5 >>> vars(x) {} >>> X().foo 5 Attempting to set an attribute where no setter was defined results in an AttributeError: >>> class GetOnly(metaclass=classproperty.Meta): ... @classproperty ... def foo(cls): ... return 'bar' >>> GetOnly.foo = 3 Traceback (most recent call last): ... AttributeError: can't set attribute It is also possible to wrap a classmethod or staticmethod in a classproperty. >>> class Static(metaclass=classproperty.Meta): ... @classproperty ... @classmethod ... def foo(cls): ... return 'foo' ... @classproperty ... @staticmethod ... def bar(): ... return 'bar' >>> Static.foo 'foo' >>> Static.bar 'bar' *Legacy* For compatibility, if the metaclass isn't specified, the legacy behavior will be invoked. >>> class X: ... val = None ... @classproperty ... def foo(cls): ... return cls.val ... @foo.setter ... def foo(cls, val): ... cls.val = val >>> X.foo >>> X.foo = 3 >>> X.foo 3 >>> x = X() >>> x.foo 3 >>> X.foo = 4 >>> x.foo 4 Note, because the metaclass was not specified, setting a value on an instance does not have the intended effect. >>> x.foo = 5 >>> x.foo 5 >>> X.foo # should be 5 4 >>> vars(x) # should be empty {'foo': 5} >>> X().foo # should be 5 4 """ fget: _ClassPropertyAttribute[_GetterClassMethod[_T]] fset: _ClassPropertyAttribute[_SetterClassMethod[_T] | None] class Meta(type): def __setattr__(self, key: str, value: object) -> None: obj = self.__dict__.get(key, None) if type(obj) is classproperty: return obj.__set__(self, value) return super().__setattr__(key, value) def __init__( self, fget: _GetterCallable[_T] | _GetterClassMethod[_T], fset: _SetterCallable[_T] | _SetterClassMethod[_T] | None = None, ) -> None: self.fget = self._ensure_method(fget) self.fset = fset # type: ignore[assignment] # Corrected in the next line. fset and self.setter(fset) def __get__(self, instance: object, owner: type[object] | None = None) -> _T: return self.fget.__get__(None, owner)() def __set__(self, owner: object, value: _T) -> None: if not self.fset: raise AttributeError("can't set attribute") if type(owner) is not classproperty.Meta: owner = type(owner) return self.fset.__get__(None, cast('type[object]', owner))(value) def setter(self, fset: _SetterCallable[_T] | _SetterClassMethod[_T]) -> Self: self.fset = self._ensure_method(fset) return self @overload @classmethod def _ensure_method( cls, fn: _GetterCallable[_T] | _GetterClassMethod[_T], ) -> _GetterClassMethod[_T]: ... @overload @classmethod def _ensure_method( cls, fn: _SetterCallable[_T] | _SetterClassMethod[_T], ) -> _SetterClassMethod[_T]: ... @classmethod def _ensure_method( cls, fn: _GetterCallable[_T] | _GetterClassMethod[_T] | _SetterCallable[_T] | _SetterClassMethod[_T], ) -> _GetterClassMethod[_T] | _SetterClassMethod[_T]: """ Ensure fn is a classmethod or staticmethod. """ needs_method = not isinstance(fn, (classmethod, staticmethod)) return classmethod(fn) if needs_method else fn # type: ignore[arg-type,return-value] jaraco.classes-3.4.0/jaraco/classes/py.typed000066400000000000000000000000001460220733000207670ustar00rootroot00000000000000jaraco.classes-3.4.0/mypy.ini000066400000000000000000000002321460220733000161020ustar00rootroot00000000000000[mypy] ignore_missing_imports = True # required to support namespace packages # https://github.com/python/mypy/issues/14057 explicit_package_bases = True jaraco.classes-3.4.0/pyproject.toml000066400000000000000000000002131460220733000173160ustar00rootroot00000000000000[build-system] requires = ["setuptools>=56", "setuptools_scm[toml]>=3.4.1"] build-backend = "setuptools.build_meta" [tool.setuptools_scm] jaraco.classes-3.4.0/pytest.ini000066400000000000000000000010141460220733000164330ustar00rootroot00000000000000[pytest] norecursedirs=dist build .tox .eggs addopts=--doctest-modules filterwarnings= ## upstream # Ensure ResourceWarnings are emitted default::ResourceWarning # realpython/pytest-mypy#152 ignore:'encoding' argument not specified::pytest_mypy # python/cpython#100750 ignore:'encoding' argument not specified::platform # pypa/build#615 ignore:'encoding' argument not specified::build.env # dateutil/dateutil#1284 ignore:datetime.datetime.utcfromtimestamp:DeprecationWarning:dateutil.tz.tz ## end upstream jaraco.classes-3.4.0/ruff.toml000066400000000000000000000006431460220733000162500ustar00rootroot00000000000000[lint] extend-select = [ "C901", "W", ] ignore = [ # https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules "W191", "E111", "E114", "E117", "D206", "D300", "Q000", "Q001", "Q002", "Q003", "COM812", "COM819", "ISC001", "ISC002", ] [format] # Enable preview, required for quote-style = "preserve" preview = true # https://docs.astral.sh/ruff/settings/#format-quote-style quote-style = "preserve" jaraco.classes-3.4.0/setup.cfg000066400000000000000000000015601460220733000162310ustar00rootroot00000000000000[metadata] name = jaraco.classes author = Jason R. Coombs author_email = jaraco@jaraco.com description = Utility functions for Python class constructs long_description = file:README.rst url = https://github.com/jaraco/jaraco.classes classifiers = Development Status :: 5 - Production/Stable Intended Audience :: Developers License :: OSI Approved :: MIT License Programming Language :: Python :: 3 Programming Language :: Python :: 3 :: Only [options] include_package_data = true python_requires = >=3.8 install_requires = more_itertools [options.extras_require] testing = # upstream pytest >= 6 pytest-checkdocs >= 2.4 pytest-cov pytest-mypy pytest-enabler >= 2.2 pytest-ruff >= 0.2.1 # local docs = # upstream sphinx >= 3.5 jaraco.packaging >= 9.3 rst.linker >= 1.9 furo sphinx-lint # tidelift jaraco.tidelift >= 1.4 # local [options.entry_points] jaraco.classes-3.4.0/towncrier.toml000066400000000000000000000000541460220733000173160ustar00rootroot00000000000000[tool.towncrier] title_format = "{version}" jaraco.classes-3.4.0/tox.ini000066400000000000000000000025241460220733000157240ustar00rootroot00000000000000[testenv] description = perform primary checks (tests, style, types, coverage) deps = setenv = PYTHONWARNDEFAULTENCODING = 1 commands = pytest {posargs} usedevelop = True extras = testing [testenv:diffcov] description = run tests and check that diff from main is covered deps = {[testenv]deps} diff-cover commands = pytest {posargs} --cov-report xml diff-cover coverage.xml --compare-branch=origin/main --html-report diffcov.html diff-cover coverage.xml --compare-branch=origin/main --fail-under=100 [testenv:docs] description = build the documentation extras = docs testing changedir = docs commands = python -m sphinx -W --keep-going . {toxinidir}/build/html python -m sphinxlint \ # workaround for sphinx-contrib/sphinx-lint#83 --jobs 1 [testenv:finalize] description = assemble changelog and tag a release skip_install = True deps = towncrier jaraco.develop >= 7.23 pass_env = * commands = python -m jaraco.develop.finalize [testenv:release] description = publish the package to PyPI and GitHub skip_install = True deps = build twine>=3 jaraco.develop>=7.1 pass_env = TWINE_PASSWORD GITHUB_TOKEN setenv = TWINE_USERNAME = {env:TWINE_USERNAME:__token__} commands = python -c "import shutil; shutil.rmtree('dist', ignore_errors=True)" python -m build python -m twine upload dist/* python -m jaraco.develop.create-github-release