# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['auto_pytabs']

package_data = \
{'': ['*']}

install_requires = \
['autoflake>=2.0.0,<3.0.0', 'pyupgrade>=3.3.1,<4.0.0']

extras_require = \
{'markdown': ['markdown>=3.2.1,<3.4'],
 'mkdocs': ['mkdocs>=1.4.2,<2.0.0'],
 'sphinx': ['sphinx>=4,<6']}

entry_points = \
{'mkdocs.plugins': ['auto_pytabs = auto_pytabs.mkdocs_plugin:AutoPyTabsPlugin']}

setup_kwargs = {
    'name': 'auto-pytabs',
    'version': '0.1.1',
    'description': 'Automatically generate tabbed code blocks for multiple Python versions in mkdocs, markdown and Sphinx',
    'long_description': '# AutoPyTabs\n\nTooling to automatically generate tabbed code examples for different Python versions in\n[mkdocs](https://www.mkdocs.org) or [Sphinx](https://www.sphinx-doc.org) based documentations, or a plain\n[markdown](https://python-markdown.github.io/) workflow, making use of the\n[pymdown "tabbed"](https://facelessuser.github.io/pymdown-extensions/extensions/tabbed/) markdown extension for markdown,\nand [sphinx{design} tabs](https://sphinx-design.readthedocs.io/en/latest/tabs.html) for Sphinx.\n\n# Work in progress\n\nThis library is work in progress. Approach with caution\n\n## Table of contents\n\n1. [Mkdocs / markdown](#mkdocs-markdown)\n   1. [Plugin or extension?](#plugin-or-extension)\n   1. [Configuration](#mkdocs-config)\n   1. [Examples](#mkdocs-examples)\n   1. [Selectively disable](#selectively-disable)\n   1. [Compatibility with `pymdownx.snippets`](#compatibility-with-pymdownxsnippets)\n1. [Sphinx](#sphinx)\n   1. [Configuration](#sphinx-config)\n   1. [Directives](#directives)\n   1. [Examples](#sphinx-examples)\n   1. [Compatibility with other extensions](#compatibility-with-other-extensions)\n\n# Usage\n\n<h2 id="mkdocs-markdown">Mkdocs / markdown</h2>\n\n### Installation\n\n`pip install auto-pytabs[mkdocs]` or `pip install auto-pytabs[markdown]` if only using\nthe markdown extension.\n\n### Plugin or extension?\n\nWhen using mkdocs, you have the choice to either use AutoPyTabs as a plugin, or a markdown extension.\nThe result is the same, with the main difference being how they integrate into the rendering workflow.\nBehind the scenes, AutoPyTabs makes use of [pyupgrade](https://github.com/asottile/pyupgrade) and\n[autoflake](https://github.com/PyCQA/autoflake) to generate the upgraded code, which is a relatively costly process.\nWhile AutoPyTabs tries to cache as much as possible, due to the limitations of mkdocs, it can still result in a considerable\namount of additional build time.\n\nThe main issues are that the core process of mkdocs is inherently linear and only supports limited incremental builds. To\nsomewhat alleviate these issues, the mkdocs plugin provided by AutPyTabs employs parallelized source-file level transformations:\n\n- After mkdocs has collected all source files, collect the ones that contain code blocks which need upgrading\n- Create temporary files for all collected files and tell mkdocs to use those instead\n- Transform the temporary files, using multiple worker processes\n\n<h3 id="mkdocs-config">Configuration</h3>\n\n**Mkdocs plugin**\n\n```yaml\nsite_name: My Docs\nmarkdown_extensions:\n  - pymdownx.tabbed:\nplugins:\n  - auto_pytabs:\n      min_version: "3.7"  # optional\n      max_version: "3.11" # optional\n      tab_title_template: "Python {min_version}+"  # optional\n      no_cache: false  # optional\n```\n\nOr using the markdown extension directly:\n\n**Markdown extension in mkdocs**\n\n```yaml\nsite_name: My Docs\nmarkdown_extensions:\n  - pymdownx.tabbed:\n  - auto_pytabs:\n      min_version: "3.7"  # optional\n      max_version: "3.11" # optional\n      tab_title_template: "Python {min_version}+"  # optional\n      no_cache: false  # optional\n```\n\n**Markdown extension**\n\n```python\nimport markdown\n\nmd = markdown.Markdown(\n    extensions=["auto_pytabs.markdown_ext"],\n    extension_configs={\n        "auto_pytabs": {\n            "min_version": "3.7",  # optional\n            "max_version": "3.11",  # optional\n            "tab_title_template": "Python {min_version}+",  # optional\n            "no_cache": False,  # optional\n        }\n    },\n)\n\n```\n\n<h3 id="mkdocs-examples">Examples</h3>\n\n**Input**\n\n<pre>\n```python\nfrom typing import Optional, Dict\n\ndef foo(bar: Optional[str]) -> Dict[str, str]:\n    ...\n```\n</pre>\n\n**Equivalent markdown**\n\n<pre>\n=== "Python 3.7+"\n    ```python\n    from typing import Optional, Dict\n\n    def foo(bar: Optional[str]) -> Dict[str, str]:\n        ...\n    ```\n\n=== "Python 3.9+"\n    ```python\n    from typing import Optional\n    \n    \n    def foo(bar: Optional[str]) -> dict[str, str]:\n        ...\n    ```\n\n==== "Python 3.10+"\n    ```python\n    def foo(bar: str | None) -> dict[str, str]:\n        ...\n    ```\n</pre>\n\n#### Nested blocks\n\nNested tabs are supported as well:\n\n**Input**\n\n<pre>\n=== "Level 1-1"\n\n    === "Level 2-1"\n\n        ```python\n        from typing import List\n        x: List[str]\n        ```\n\n    === "Level 2-2"\n    \n        Hello, world!\n\n=== "Level 1-2"\n\n    Goodbye, world!\n</pre>\n\n**Equivalent markdown**\n\n<pre>\n=== "Level 1-1"\n\n    === "Level 2-1"\n\n        === "Python 3.7+"\n            ```python\n            from typing import List\n            x: List[str]\n            ```\n        \n        === "Python 3.9+"\n            ```python\n            x: list[str]\n            ```\n\n    === "Level 2-2"\n\n        Goodbye, world!\n\n=== "Level 1-2"\n    Hello, world!\n    \n</pre>\n\n### Selectively disable\n\nYou can disable conversion for a single code block:\n\n````\n<!-- autopytabs: disable-block -->\n```python\nfrom typing import Set, Optional\n\ndef bar(baz: Optional[str]) -> Set[str]:\n    ...\n```\n````\n\nOr for whole sections / files\n\n```\n<!-- autopytabs: disable -->\neverything after this will be ignored\n<!-- autopytabs: enable -->\nre-enables conversion again\n```\n\n### Compatibility with `pymdownx.snippets`\n\nIf the `pymdownx.snippets` extension is used, make sure that it runs **before** AutoPyTab\n\n## Sphinx\n\nAutPyTabs provides a Sphinx extension `auto_pytabs.sphinx_ext`, enabling its functionality\nfor the `.. code-block` and `.. literalinclude` directives.\n\n### Installation\n\n`pip install auto-pytabs[sphinx]`\n\n### Usage\n\n<h4 id="sphinx-config">Configuration</h4>\n\n```python\nextensions = ["auto_pytabs.sphinx_ext", "sphinx_design"]\n\nauto_pytabs_min_version = (3, 7)  # optional\nauto_pytabs_max_version = (3, 11)  # optional\nauto_pytabs_tab_title_template = "Python {min_version}+"  # optional \nauto_pytabs_no_cache = True  # disabled caching\n```\n\n<h3 id="sphinx-examples">Examples</h3>\n\n**Input**\n\n```rst\n.. code-block:: python\n\n   from typing import Optional, Dict\n   \n   def foo(bar: Optional[str]) -> Dict[str, str]:\n       ...\n```\n\n**Equivalent ReST**\n\n```rst\n.. tab-set::\n\n   .. tab-item:: Python 3.7+\n   \n       .. code-block:: python\n       \n          from typing import Optional, Dict\n      \n          def foo(bar: Optional[str]) -> Dict[str, str]:\n              ...\n\n   .. tab-item:: Python 3.9+\n   \n      .. code-block:: python\n      \n          from typing import Optional\n          \n          \n          def foo(bar: Optional[str]) -> dict[str, str]:\n              ...\n\n   .. tab-item:: Python 3.10+\n   \n      .. code-block:: python\n      \n          def foo(bar: str | None) -> dict[str, str]:\n              ...\n\n```\n\n### Directives\n\nAutoPyTabs overrides the built-in `code-block` and `literal-include` directives,\nextending them with auto-upgrade and tabbing functionality, which means no special\ndirectives, and therefore changes to existing documents are needed.\n\nAdditionally, a `:no-upgrade:` option is added to the directives, which can be used to\nselectively fall back the default behaviour.\n\nTwo new directives are provided as well:\n\n- `.. pytabs-code-block::`\n- `.. pytabs-literalinclude::`\n\nwhich by default act exactly like `.. code-block` and `.. literalinclude` respectively,\nand are mainly to provide AutoPyTab\'s functionality in [compatibility mode](#compatibility-mode).\n\n### Compatibility mode\n\nIf you don\'t want the default behaviour of directive overrides, and instead wish to use the\n`.. pytabs-` directives manually (e.g. because of compatibility issues with other extensions\nor because you only want to apply it to select code blocks) you can make use AutoPyTabs\' compatibility\nmode. To enable it, simply use the `auto_pytabs.sphinx_ext_compat` extension instead of\n`auto_pytabs.sphinx_ext`. Now, only content within `.. pytabs-` directives will be upgraded.\n\n### Compatibility with other extensions\n\nNormally the directive overrides don\'t cause any problems and are very convenient,\nsince no changes to existing documents have to be made. However, if other extensions are included,\nwhich themselves override one of those directives, one of them will inadvertently override the other,\ndepending on the order they\'re defined in `extensions`.\n\nTo combat this, you can use the [compatibility mode](#compatibility-mode) extension instead, which\nonly includes the new directives.\n\nIf you control the conflicting overrides, you can alternatively inherit from\n`auto_py_tabs.sphinx_ext.CodeBlockOverride` and `auto_py_tabs.sphinx_ext.LiteralIncludeOverride`\ninstead of `sphinx.directives.code.CodeBlock` and `sphinx.directives.code.LiteralInclude` respectively.\n',
    'author': 'Janek Nouvertné',
    'author_email': 'provinzkraut@posteo.de',
    'maintainer': 'None',
    'maintainer_email': 'None',
    'url': 'None',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'extras_require': extras_require,
    'entry_points': entry_points,
    'python_requires': '>=3.8,<4.0',
}


setup(**setup_kwargs)
