Skip to content

Commit

Permalink
refactor: rename blueprints
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobi-De committed Sep 1, 2024
1 parent 49f7610 commit 5db60c7
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 23 deletions.
15 changes: 9 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[submodule "blueprints/falco_blueprint_basic"]
path = blueprints/falco_blueprint_basic
url = [email protected]:Tobi-De/falco_blueprint_basic.git
[submodule "blueprints/falco_blueprint_basic_bootstrap"]
path = blueprints/falco_blueprint_basic_bootstrap
url = [email protected]:Tobi-De/falco_blueprint_basic_bootstrap.git
[submodule "blueprints/falco_tailwind"]
path = blueprints/falco_tailwind
url = [email protected]:tobi-de/falco_tailwind.git
[submodule "blueprints/tailwind"]
path = blueprints/tailwind
url = [email protected]:tobi-de/falco_tailwind.git
[submodule "blueprints/bootstrap"]
path = blueprints/bootstrap
url = [email protected]:tobi-de/falco_bootstrap.git
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ pip install falco-cli

**Templates**

- [tailwind](https://github.com/Tobi-De/falco_blueprint_basic) (default)
- [bootstrap](https://github.com/Tobi-De/falco_blueprint_basic_bootstrap)
- [tailwind](https://github.com/Tobi-De/falco_tailwind) (default)
- [bootstrap](https://github.com/Tobi-De/falco_bootstrap)

## The guides

Expand Down
1 change: 1 addition & 0 deletions blueprints/bootstrap
Submodule bootstrap added at 8bfe5c
1 change: 0 additions & 1 deletion blueprints/falco_blueprint_basic
Submodule falco_blueprint_basic deleted from b16c88
1 change: 0 additions & 1 deletion blueprints/falco_blueprint_basic_bootstrap
Submodule falco_blueprint_basic_bootstrap deleted from 677f5a
1 change: 1 addition & 0 deletions blueprints/tailwind
Submodule tailwind added at ffc525
2 changes: 1 addition & 1 deletion docs/guides/deployment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ WSGI server
The WSGI server, also known as the **application server**, is responsible for running your Django application. This server is needed because some web servers, like nginx, are not capable of
executing Python code directly. `Gunicorn <https://gunicorn.org/>`_, a popular WSGI server for Django, fulfills this role.

Gunicorn can be configured using a Python file, such as `this one <https://github.com/Tobi-De/falco_blueprint_basic/blob/main/%7B%7B%20cookiecutter.project_name%20%7D%7D/deploy/gunicorn.conf.py>`_ provided with a generated Falco project.
Gunicorn can be configured using a Python file, such as `this one <https://github.com/Tobi-De/falco_tailwind/blob/main/%7B%7B%20cookiecutter.project_name%20%7D%7D/deploy/gunicorn.conf.py>`_ provided with a generated Falco project.
However, its most basic usage is:

.. code-block:: bash
Expand Down
4 changes: 2 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default := "blueprints/falco_blueprint_basic"
default := "blueprints/falco_tailwind"

# List all available commands
_default:
Expand Down Expand Up @@ -59,7 +59,7 @@ set-remote:
fi
echo "$(basename $dir)"
cd "$dir"
git remote add upstream "[email protected]:Tobi-De/falco_blueprint_basic.git"
git remote add upstream "[email protected]:Tobi-De/falco_tailwind.git"
cd -
fi
done
Expand Down
5 changes: 2 additions & 3 deletions src/falco/commands/start_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,8 @@ def find_local_cookiecutter(repo: str) -> Path | None:

def resolve_blueprint(blueprint: str, *, use_local: bool = False) -> tuple[str, str]:
name_to_urls = {
"tailwind": "https://github.com/Tobi-De/falco_blueprint_basic.git",
"bootstrap": "https://github.com/Tobi-De/falco_blueprint_basic_bootstrap.git",
"pico": "https://github.com/Tobi-De/falco_blueprint_basic_pico.git",
"tailwind": "https://github.com/Tobi-De/falco_tailwind.git",
"bootstrap": "https://github.com/Tobi-De/falco_bootstrap.git",
}
repo = name_to_urls.get(blueprint, blueprint)

Expand Down
40 changes: 33 additions & 7 deletions tests/commands/test_start_project.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from pathlib import Path

import pytest
from cappa.testing import CommandRunner
from falco.config import read_falco_config

Expand All @@ -23,10 +24,14 @@ def all_files_are_correctly_generated(project_name, project_dir: Path) -> bool:
return all((project_dir / file).exists() for file in required_files)


blueprint_path = Path("blueprints/falco_blueprint_basic").resolve(strict=True)


def test_start_project(runner: CommandRunner):
@pytest.mark.parametrize(
"blueprint_path",
[
Path("blueprints/tailwind").resolve(strict=True),
Path("blueprints/bootstrap").resolve(strict=True),
],
)
def test_start_project(blueprint_path, runner: CommandRunner):
runner.invoke(
"start-project",
"dotfm",
Expand Down Expand Up @@ -65,7 +70,14 @@ def test_start_project(runner: CommandRunner):
# assert all_files_are_correctly_generated("dotfm", project_dir=Path("dotfm"))


def test_start_project_in_directory(runner: CommandRunner, tmp_path):
@pytest.mark.parametrize(
"blueprint_path",
[
Path("blueprints/tailwind").resolve(strict=True),
Path("blueprints/bootstrap").resolve(strict=True),
],
)
def test_start_project_in_directory(blueprint_path, runner: CommandRunner, tmp_path):
runner.invoke(
"start-project",
"dotfm",
Expand All @@ -79,7 +91,14 @@ def test_start_project_in_directory(runner: CommandRunner, tmp_path):
assert all_files_are_correctly_generated("dotfm", project_dir=project_dir)


def test_start_project_in_directory_with_root(runner: CommandRunner, tmp_path):
@pytest.mark.parametrize(
"blueprint_path",
[
Path("blueprints/tailwind").resolve(strict=True),
Path("blueprints/bootstrap").resolve(strict=True),
],
)
def test_start_project_in_directory_with_root(blueprint_path, runner: CommandRunner, tmp_path):
runner.invoke(
"start-project",
"dotfm",
Expand All @@ -94,7 +113,14 @@ def test_start_project_in_directory_with_root(runner: CommandRunner, tmp_path):
assert all_files_are_correctly_generated("dotfm", project_dir=project_dir)


def test_user_name_and_email(runner: CommandRunner, git_user_infos):
@pytest.mark.parametrize(
"blueprint_path",
[
Path("blueprints/tailwind").resolve(strict=True),
Path("blueprints/bootstrap").resolve(strict=True),
],
)
def test_user_name_and_email(blueprint_path, runner: CommandRunner, git_user_infos):
name, email = git_user_infos
runner.invoke(
"start-project",
Expand Down

0 comments on commit 5db60c7

Please sign in to comment.