-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
57 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
from . import ci, project | ||
from . import ci, docs, project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import pathlib | ||
|
||
import invoke | ||
import saritasa_invocations | ||
|
||
LOCAL_DOCS_DIR = pathlib.Path("docs/_build") | ||
|
||
|
||
@invoke.task | ||
def build(context: invoke.Context): | ||
"""Build documentation.""" | ||
saritasa_invocations.print_success("Start building of local documentation") | ||
context.run(f"sphinx-build -E -a docs {LOCAL_DOCS_DIR}") | ||
saritasa_invocations.print_success("Building completed") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,46 @@ | ||
import pathlib | ||
import shutil | ||
|
||
import invoke | ||
import saritasa_invocations | ||
from invoke import task | ||
|
||
|
||
@task | ||
def init(context, clean=False): | ||
@invoke.task | ||
def init(context: invoke.Context, clean: bool = False): | ||
"""Prepare env for working with project.""" | ||
saritasa_invocations.print_success("Setting up git config") | ||
saritasa_invocations.git.setup(context) | ||
saritasa_invocations.print_success("Initial assembly of all dependencies") | ||
saritasa_invocations.poetry.install(context) | ||
if clean: | ||
saritasa_invocations.docker.clear(context) | ||
clear(context) | ||
saritasa_invocations.django.migrate(context) | ||
saritasa_invocations.pytest.run(context) | ||
saritasa_invocations.django.createsuperuser(context) | ||
|
||
|
||
@invoke.task | ||
def clear(context: invoke.Context): | ||
"""Clear package directory from cache files.""" | ||
saritasa_invocations.print_success("Start clearing") | ||
build_dirs = ("build", "dist", ".eggs") | ||
coverage_dirs = ("htmlcov",) | ||
cache_dirs = (".mypy_cache", ".pytest_cache") | ||
|
||
saritasa_invocations.print_success("Remove cache directories") | ||
for directory in build_dirs + coverage_dirs + cache_dirs: | ||
shutil.rmtree(directory, ignore_errors=True) | ||
|
||
cwd = pathlib.Path(".") | ||
# remove egg paths | ||
saritasa_invocations.print_success("Remove egg directories") | ||
for path in cwd.glob("*.egg-info"): | ||
shutil.rmtree(path, ignore_errors=True) | ||
|
||
for path in cwd.glob("*.egg"): | ||
path.unlink(missing_ok=True) | ||
|
||
# remove last coverage file | ||
saritasa_invocations.print_success("Remove coverage file") | ||
pathlib.Path(".coverage").unlink(missing_ok=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters