pax_global_header00006660000000000000000000000064140145247460014521gustar00rootroot0000000000000052 comment=e2290416a0c07ae3dccb3e0862a1aafd3253c816 jaraco.classes-3.2.1/000077500000000000000000000000001401452474600144175ustar00rootroot00000000000000jaraco.classes-3.2.1/.coveragerc000066400000000000000000000000621401452474600165360ustar00rootroot00000000000000[run] omit = .tox/* [report] show_missing = True jaraco.classes-3.2.1/.flake8000066400000000000000000000002101401452474600155630ustar00rootroot00000000000000[flake8] max-line-length = 88 # jaraco/skeleton#34 max-complexity = 10 extend-ignore = # Black creates whitespace before colon E203 jaraco.classes-3.2.1/.github/000077500000000000000000000000001401452474600157575ustar00rootroot00000000000000jaraco.classes-3.2.1/.github/workflows/000077500000000000000000000000001401452474600200145ustar00rootroot00000000000000jaraco.classes-3.2.1/.github/workflows/automerge.yml000066400000000000000000000007611401452474600225330ustar00rootroot00000000000000name: automerge on: pull_request: types: - labeled - unlabeled - synchronize - opened - edited - ready_for_review - reopened - unlocked pull_request_review: types: - submitted check_suite: types: - completed status: {} jobs: automerge: runs-on: ubuntu-latest steps: - name: automerge uses: "pascalgn/automerge-action@v0.12.0" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" jaraco.classes-3.2.1/.github/workflows/main.yml000066400000000000000000000020061401452474600214610ustar00rootroot00000000000000name: tests on: [push, pull_request] jobs: test: strategy: matrix: python: [3.6, 3.8, 3.9] platform: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@v2 - name: Setup Python uses: actions/setup-python@v2 with: python-version: ${{ matrix.python }} - name: Install tox run: | python -m pip install tox - name: Run tests run: tox release: needs: test if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Setup Python uses: actions/setup-python@v2 with: python-version: 3.9 - name: Install tox run: | python -m pip install tox - name: Release run: tox -e release env: TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} jaraco.classes-3.2.1/.pre-commit-config.yaml000066400000000000000000000002571401452474600207040ustar00rootroot00000000000000repos: - repo: https://github.com/psf/black rev: 20.8b1 hooks: - id: black - repo: https://github.com/asottile/blacken-docs rev: v1.9.1 hooks: - id: blacken-docs jaraco.classes-3.2.1/.readthedocs.yml000066400000000000000000000001171401452474600175040ustar00rootroot00000000000000version: 2 python: install: - path: . extra_requirements: - docs jaraco.classes-3.2.1/CHANGES.rst000066400000000000000000000025241401452474600162240ustar00rootroot00000000000000v3.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.2.1/LICENSE000066400000000000000000000020321401452474600154210ustar00rootroot00000000000000Copyright Jason R. Coombs Permission 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.2.1/README.rst000066400000000000000000000013001401452474600161000ustar00rootroot00000000000000.. image:: https://img.shields.io/pypi/v/jaraco.classes.svg :target: `PyPI link`_ .. image:: https://img.shields.io/pypi/pyversions/jaraco.classes.svg :target: `PyPI link`_ .. _PyPI link: https://pypi.org/project/jaraco.ui .. image:: https://github.com/jaraco/jaraco.classes/workflows/tests/badge.svg :target: https://github.com/jaraco/jaraco.classes/actions?query=workflow%3A%22tests%22 :alt: tests .. image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/psf/black :alt: Code style: Black .. .. image:: https://readthedocs.org/projects/skeleton/badge/?version=latest .. :target: https://skeleton.readthedocs.io/en/latest/?badge=latest jaraco.classes-3.2.1/docs/000077500000000000000000000000001401452474600153475ustar00rootroot00000000000000jaraco.classes-3.2.1/docs/conf.py000066400000000000000000000013641401452474600166520ustar00rootroot00000000000000#!/usr/bin/env python3 # -*- coding: utf-8 -*- extensions = ['sphinx.ext.autodoc', 'jaraco.packaging.sphinx', 'rst.linker'] master_doc = "index" link_files = { '../CHANGES.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://www.python.org/dev/peps/pep-{pep_number:0>4}/', ), ], ) } jaraco.classes-3.2.1/docs/history.rst000066400000000000000000000001211401452474600175740ustar00rootroot00000000000000:tocdepth: 2 .. _changes: History ******* .. include:: ../CHANGES (links).rst jaraco.classes-3.2.1/docs/index.rst000066400000000000000000000007651401452474600172200ustar00rootroot00000000000000Welcome to |project| documentation! =================================== .. toctree:: :maxdepth: 1 history .. 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.2.1/jaraco/000077500000000000000000000000001401452474600156565ustar00rootroot00000000000000jaraco.classes-3.2.1/jaraco/classes/000077500000000000000000000000001401452474600173135ustar00rootroot00000000000000jaraco.classes-3.2.1/jaraco/classes/__init__.py000066400000000000000000000000001401452474600214120ustar00rootroot00000000000000jaraco.classes-3.2.1/jaraco/classes/ancestry.py000066400000000000000000000026701401452474600215220ustar00rootroot00000000000000""" Routines for obtaining the class names of an object and its parent classes. """ from more_itertools import unique_everseen def all_bases(c): """ 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): """ 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): """ 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): try: subs = cls.__subclasses__() except TypeError: # fails only when cls is type subs = cls.__subclasses__(cls) for sub in subs: yield sub yield from iter_subclasses(sub) jaraco.classes-3.2.1/jaraco/classes/meta.py000066400000000000000000000034751401452474600206240ustar00rootroot00000000000000""" meta.py Some useful metaclasses. """ 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 """ def __init__(cls, name, bases, attrs): 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, bases, namespace): 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.2.1/jaraco/classes/properties.py000066400000000000000000000076141401452474600220710ustar00rootroot00000000000000class NonDataProperty: """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): assert fget is not None, "fget cannot be none" assert callable(fget), "fget must be callable" self.fget = fget def __get__(self, obj, objtype=None): if obj is None: return self return self.fget(obj) class classproperty: """ 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 """ class Meta(type): def __setattr__(self, key, value): 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, fset=None): self.fget = self._fix_function(fget) self.fset = fset fset and self.setter(fset) def __get__(self, instance, owner=None): return self.fget.__get__(None, owner)() def __set__(self, owner, value): 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, owner)(value) def setter(self, fset): self.fset = self._fix_function(fset) return self @classmethod def _fix_function(cls, fn): """ Ensure fn is a classmethod or staticmethod. """ if not isinstance(fn, (classmethod, staticmethod)): return classmethod(fn) return fn jaraco.classes-3.2.1/mypy.ini000066400000000000000000000000451401452474600161150ustar00rootroot00000000000000[mypy] ignore_missing_imports = True jaraco.classes-3.2.1/pyproject.toml000066400000000000000000000005571401452474600173420ustar00rootroot00000000000000[build-system] requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4.1"] build-backend = "setuptools.build_meta" [tool.black] skip-string-normalization = true [tool.setuptools_scm] [pytest.enabler.black] addopts = "--black" [pytest.enabler.mypy] addopts = "--mypy" [pytest.enabler.flake8] addopts = "--flake8" [pytest.enabler.cov] addopts = "--cov" jaraco.classes-3.2.1/pytest.ini000066400000000000000000000005151401452474600164510ustar00rootroot00000000000000[pytest] norecursedirs=dist build .tox .eggs addopts=--doctest-modules doctest_optionflags=ALLOW_UNICODE ELLIPSIS # workaround for warning pytest-dev/pytest#6178 junit_family=xunit2 filterwarnings= # https://github.com/pytest-dev/pytest/issues/6928 ignore:direct construction of .*Item has been deprecated:DeprecationWarning jaraco.classes-3.2.1/setup.cfg000066400000000000000000000020551401452474600162420ustar00rootroot00000000000000[metadata] license_files = LICENSE 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] packages = find_namespace: include_package_data = true python_requires = >=3.6 install_requires = more_itertools setup_requires = setuptools_scm[toml] >= 3.4.1 [options.packages.find] exclude = build* dist* docs* tests* [options.extras_require] testing = # upstream pytest >= 3.5, !=3.7.3 pytest-checkdocs >= 1.2.3 pytest-flake8 pytest-black >= 0.3.7; python_implementation != "PyPy" pytest-cov pytest-mypy; python_implementation != "PyPy" pytest-enabler # local docs = # upstream sphinx jaraco.packaging >= 8.2 rst.linker >= 1.9 # local [options.entry_points] jaraco.classes-3.2.1/setup.py000066400000000000000000000001341401452474600161270ustar00rootroot00000000000000#!/usr/bin/env python import setuptools if __name__ == "__main__": setuptools.setup() jaraco.classes-3.2.1/skeleton.md000066400000000000000000000236331401452474600165740ustar00rootroot00000000000000# Overview This project is merged with [skeleton](https://github.com/jaraco/skeleton). What is skeleton? It's the scaffolding of a Python project jaraco [introduced in his blog](https://blog.jaraco.com/a-project-skeleton-for-python-projects/). It seeks to provide a means to re-use techniques and inherit advances when managing projects for distribution. ## An SCM-Managed Approach While maintaining dozens of projects in PyPI, jaraco derives best practices for project distribution and publishes them in the [skeleton repo](https://github.com/jaraco/skeleton), a Git repo capturing the evolution and culmination of these best practices. It's intended to be used by a new or existing project to adopt these practices and honed and proven techniques. Adopters are encouraged to use the project directly and maintain a small deviation from the technique, make their own fork for more substantial changes unique to their environment or preferences, or simply adopt the skeleton once and abandon it thereafter. The primary advantage to using an SCM for maintaining these techniques is that those tools help facilitate the merge between the template and its adopting projects. Another advantage to using an SCM-managed approach is that tools like GitHub recognize that a change in the skeleton is the _same change_ across all projects that merge with that skeleton. Without the ancestry, with a traditional copy/paste approach, a [commit like this](https://github.com/jaraco/skeleton/commit/12eed1326e1bc26ce256e7b3f8cd8d3a5beab2d5) would produce notifications in the upstream project issue for each and every application, but because it's centralized, GitHub provides just the one notification when the change is added to the skeleton. # Usage ## new projects To use skeleton for a new project, simply pull the skeleton into a new project: ``` $ git init my-new-project $ cd my-new-project $ git pull gh://jaraco/skeleton ``` Now customize the project to suit your individual project needs. ## existing projects If you have an existing project, you can still incorporate the skeleton by merging it into the codebase. ``` $ git merge skeleton --allow-unrelated-histories ``` The `--allow-unrelated-histories` is necessary because the history from the skeleton was previously unrelated to the existing codebase. Resolve any merge conflicts and commit to the master, and now the project is based on the shared skeleton. ## Updating Whenever a change is needed or desired for the general technique for packaging, it can be made in the skeleton project and then merged into each of the derived projects as needed, recommended before each release. As a result, features and best practices for packaging are centrally maintained and readily trickle into a whole suite of packages. This technique lowers the amount of tedious work necessary to create or maintain a project, and coupled with other techniques like continuous integration and deployment, lowers the cost of creating and maintaining refined Python projects to just a few, familiar Git operations. For example, here's a session of the [path project](https://pypi.org/project/path) pulling non-conflicting changes from the skeleton: Thereafter, the target project can make whatever customizations it deems relevant to the scaffolding. The project may even at some point decide that the divergence is too great to merit renewed merging with the original skeleton. This approach applies maximal guidance while creating minimal constraints. ## Periodic Collapse In late 2020, this project [introduced](https://github.com/jaraco/skeleton/issues/27) the idea of a periodic but infrequent (O(years)) collapse of commits to limit the number of commits a new consumer will need to accept to adopt the skeleton. The full history of commits is collapsed into a single commit and that commit becomes the new mainline head. When one of these collapse operations happens, any project that previously pulled from the skeleton will no longer have a related history with that new main branch. For those projects, the skeleton provides a "handoff" branch that reconciles the two branches. Any project that has previously merged with the skeleton but now gets an error "fatal: refusing to merge unrelated histories" should instead use the handoff branch once to incorporate the new main branch. ``` $ git pull https://github.com/jaraco/skeleton 2020-handoff ``` This handoff needs to be pulled just once and thereafter the project can pull from the main head. The archive and handoff branches from prior collapses are indicate here: | refresh | archive | handoff | |---------|-----------------|--------------| | 2020-12 | archive/2020-12 | 2020-handoff | # Features The features/techniques employed by the skeleton include: - PEP 517/518-based build relying on Setuptools as the build tool - Setuptools declarative configuration using setup.cfg - tox for running tests - A README.rst as reStructuredText with some popular badges, but with Read the Docs and AppVeyor badges commented out - A CHANGES.rst file intended for publishing release notes about the project - Use of [Black](https://black.readthedocs.io/en/stable/) for code formatting (disabled on unsupported Python 3.5 and earlier) - Integrated type checking through [mypy](https://github.com/python/mypy/). ## Packaging Conventions A pyproject.toml is included to enable PEP 517 and PEP 518 compatibility and declares the requirements necessary to build the project on Setuptools (a minimum version compatible with setup.cfg declarative config). The setup.cfg file implements the following features: - Assumes universal wheel for release - Advertises the project's LICENSE file (MIT by default) - Reads the README.rst file into the long description - Some common Trove classifiers - Includes all packages discovered in the repo - Data files in the package are also included (not just Python files) - Declares the required Python versions - Declares install requirements (empty by default) - Declares setup requirements for legacy environments - Supplies two 'extras': - testing: requirements for running tests - docs: requirements for building docs - these extras split the declaration into "upstream" (requirements as declared by the skeleton) and "local" (those specific to the local project); these markers help avoid merge conflicts - Placeholder for defining entry points Additionally, the setup.py file declares `use_scm_version` which relies on [setuptools_scm](https://pypi.org/project/setuptools_scm) to do two things: - derive the project version from SCM tags - ensure that all files committed to the repo are automatically included in releases ## Running Tests The skeleton assumes the developer has [tox](https://pypi.org/project/tox) installed. The developer is expected to run `tox` to run tests on the current Python version using [pytest](https://pypi.org/project/pytest). Other environments (invoked with `tox -e {name}`) supplied include: - a `docs` environment to build the documentation - a `release` environment to publish the package to PyPI A pytest.ini is included to define common options around running tests. In particular: - rely on default test discovery in the current directory - avoid recursing into common directories not containing tests - run doctests on modules and invoke Flake8 tests - in doctests, allow Unicode literals and regular literals to match, allowing for doctests to run on Python 2 and 3. Also enable ELLIPSES, a default that would be undone by supplying the prior option. - filters out known warnings caused by libraries/functionality included by the skeleton Relies on a .flake8 file to correct some default behaviors: - disable mutually incompatible rules W503 and W504 - support for Black format ## Continuous Integration The project is pre-configured to run Continuous Integration tests. ### Github Actions [Github Actions](https://docs.github.com/en/free-pro-team@latest/actions) are the preferred provider as they provide free, fast, multi-platform services with straightforward configuration. Configured in `.github/workflows`. Features include: - test against multiple Python versions - run on late (and updated) platform versions - automated releases of tagged commits - [automatic merging of PRs](https://github.com/marketplace/actions/merge-pull-requests) (requires [protecting branches with required status checks](https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/enabling-required-status-checks), [not possible through API](https://github.community/t/set-all-status-checks-to-be-required-as-branch-protection-using-the-github-api/119493)) ### Continuous Deployments In addition to running tests, an additional publish stage is configured to automatically release tagged commits to PyPI using [API tokens](https://pypi.org/help/#apitoken). The release process expects an authorized token to be configured with each Github project (or org) `PYPI_TOKEN` [secret](https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets). Example: ``` pip-run -q jaraco.develop -- -m jaraco.develop.add-github-secrets ``` ## Building Documentation Documentation is automatically built by [Read the Docs](https://readthedocs.org) when the project is registered with it, by way of the .readthedocs.yml file. To test the docs build manually, a tox env may be invoked as `tox -e docs`. Both techniques rely on the dependencies declared in `setup.cfg/options.extras_require.docs`. In addition to building the Sphinx docs scaffolded in `docs/`, the docs build a `history.html` file that first injects release dates and hyperlinks into the CHANGES.rst before incorporating it as history in the docs. ## Cutting releases By default, tagged commits are released through the continuous integration deploy stage. Releases may also be cut manually by invoking the tox environment `release` with the PyPI token set as the TWINE_PASSWORD: ``` TWINE_PASSWORD={token} tox -e release ``` jaraco.classes-3.2.1/tox.ini000066400000000000000000000013171401452474600157340ustar00rootroot00000000000000[tox] envlist = python minversion = 3.2 # https://github.com/jaraco/skeleton/issues/6 tox_pip_extensions_ext_venv_update = true toxworkdir={env:TOX_WORK_DIR:.tox} [testenv] deps = commands = pytest {posargs} usedevelop = True extras = testing [testenv:docs] extras = docs testing changedir = docs commands = python -m sphinx . {toxinidir}/build/html [testenv:release] skip_install = True deps = build twine[keyring]>=1.13 path jaraco.develop>=7.1 passenv = TWINE_PASSWORD GITHUB_TOKEN setenv = TWINE_USERNAME = {env:TWINE_USERNAME:__token__} commands = python -c "import path; path.Path('dist').rmtree_p()" python -m build python -m twine upload dist/* python -m jaraco.develop.create-github-release