# Path: plugins/tasks.py
# def pytest(_):
# def pytest_clean(_):
# def mypy(_):
# def mypy_clean(_):
# def build_clean(_):
# def dist_clean(_):
# def clean_all(_):
# def sdist(_):
# def wheel(_):
# def flake8(_):
# BUILDDIR = 'build'
# DISTDIR = 'dist'


import os
import pathlib
import re
import shutil
import sys
import invoke
from plugins import (
    tasks as plugin_tasks,
)
def wheel(context):
    """Build a wheel distribution"""
    with context.cd(TASK_ROOT_STR):
        context.run('python setup.py bdist_wheel')


namespace.add_task(wheel)


@invoke.task(pre=[validatetag, sdist, wheel])
def pypi(context):
    """Build and upload a distribution to pypi"""
    with context.cd(TASK_ROOT_STR):
        context.run('twine upload dist/*')


namespace.add_task(pypi)


@invoke.task(pre=[validatetag, sdist, wheel])
def pypi_test(context):
    """Build and upload a distribution to https://test.pypi.org"""
    with context.cd(TASK_ROOT_STR):
        context.run('twine upload --repository-url https://test.pypi.org/legacy/ dist/*')


namespace.add_task(pypi_test)


# Flake8 - linter and tool for style guide enforcement and linting

# Path: plugins/tasks.py
# def pytest(_):
# def pytest_clean(_):
# def mypy(_):
# def mypy_clean(_):
# def build_clean(_):
# def dist_clean(_):
# def clean_all(_):
# def sdist(_):
# def wheel(_):
# def flake8(_):
# BUILDDIR = 'build'
# DISTDIR = 'dist'


# Path: tasks.py
import os
import pathlib
import re
import shutil
import sys
import invoke
from plugins import (
    tasks as plugin_tasks,
)

def wheel(context):
    """Build a wheel distribution"""
    with context.cd(TASK_ROOT_STR):
        context.run('python setup.py bdist_wheel')


namespace.add_task(wheel)


@invoke.task(pre=[validatetag, sdist, wheel])
def pypi(context):
    """Build and upload a distribution to pypi"""
    with context.cd(TASK_ROOT_STR):
        context.run('twine upload dist/*')


namespace.add_task(pypi)


@invoke.task(pre=[validatetag, sdist, wheel])
def pypi_test(context):
    """Build and upload a distribution to https://test.pypi.org"""
    with context.cd(TASK_ROOT_STR):
        context.run('twine upload --repository-url https://test.pypi.org/legacy/ dist/*')


namespace.add_task(pypi_test)


# Flake8 - linter and tool for style guide enforcement and linting

@invoke.task(post=[plugin_tasks.flake8])