Skip to content

Commit

Permalink
Merge branch 'main' into improve-github-workflow
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/default.yml
  • Loading branch information
denys-chura committed Oct 10, 2024
2 parents a0efcdc + 90f89ae commit 9953c91
Show file tree
Hide file tree
Showing 7 changed files with 737 additions and 677 deletions.
22 changes: 0 additions & 22 deletions contrib/docker/docker-compose-local.yml

This file was deleted.

723 changes: 723 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[tool.poetry]
package-mode = false

[tool.poetry.dependencies]
python = "^3.13"
cookiecutter = "^2.6.0"
pytest = "^8.3.3"
pytest-cov = "^5.0.0"
invoke = "^2.2.0"

[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["tests.py", "test_*.py", "*_tests.py"]
3 changes: 0 additions & 3 deletions pytest.ini

This file was deleted.

8 changes: 0 additions & 8 deletions requirements.in

This file was deleted.

597 changes: 0 additions & 597 deletions requirements.txt

This file was deleted.

48 changes: 1 addition & 47 deletions tasks.py
Original file line number Diff line number Diff line change
@@ -1,57 +1,11 @@
import os
from shutil import rmtree

from invoke import Collection, task


def path(*args):
current_dir = os.path.dirname(os.path.abspath(__file__))
return os.path.join(current_dir, *args)


@task()
def compose_up(ctx, daemon=False):
with ctx.cd(path("contrib", "docker")):
command = "docker-compose --file docker-compose-local.yml --project-name=awesome up"
if daemon:
command = f"{command} -d"
ctx.run(command, pty=True, replace_env=False)


@task()
def compose_down(ctx, volumes=False):
with ctx.cd(path("contrib", "docker")):
command = "docker-compose --file docker-compose-local.yml --project-name=awesome down"
if volumes:
command = f"{command} -v"
ctx.run(command, pty=True, replace_env=False)


@task()
def pip_compile(ctx):
command = (
"pip-compile --upgrade --generate-hashes --allow-unsafe "
"-o ./requirements.txt ./requirements.in"
)
ctx.run(command, pty=True)


@task()
def pip_sync(ctx):
ctx.run("pip-sync ./requirements.txt", pty=True)


@task()
def test_hooks(ctx):
ctx.run("pytest -s --cov=hooks --cov-report=html", pty=True, replace_env=False)


compose_collection = Collection("compose")
compose_collection.add_task(compose_up, name="up")
compose_collection.add_task(compose_down, name="down")
pip_collection = Collection("pip")
pip_collection.add_task(pip_compile, name="compile")
pip_collection.add_task(pip_sync, name="sync")
test_collection = Collection("test")
test_collection.add_task(test_hooks, name="hooks")
namespace = Collection(compose_collection, pip_collection, test_collection, )
namespace = Collection(test_collection)

0 comments on commit 9953c91

Please sign in to comment.