-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into swithc-project-poetry-to-non-package-mode
- Loading branch information
Showing
8 changed files
with
761 additions
and
692 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 was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
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 |
---|---|---|
@@ -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"] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,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) |