falco-cli 0.26.1__tar.gz → 0.26.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {falco_cli-0.26.1 → falco_cli-0.26.2}/PKG-INFO +4 -2
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/conf.py +9 -5
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/guides/deployment.rst +7 -7
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/the_cli/crud.rst +4 -4
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/the_cli/htmx.rst +2 -2
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/the_cli/index.rst +1 -1
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/the_cli/migrations.rst +2 -2
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/the_cli/start_app.rst +1 -1
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/the_cli/start_project/index.rst +4 -4
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/the_cli/sync_dotenv.rst +1 -1
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/the_cli/work.rst +1 -1
- {falco_cli-0.26.1 → falco_cli-0.26.2}/pyproject.toml +14 -12
- {falco_cli-0.26.1/src/falco → falco_cli-0.26.2/src/falco_cli}/__about__.py +1 -1
- {falco_cli-0.26.1/src/falco → falco_cli-0.26.2/src/falco_cli}/__init__.py +1 -1
- {falco_cli-0.26.1/src/falco → falco_cli-0.26.2/src/falco_cli}/__main__.py +12 -12
- {falco_cli-0.26.1/src/falco → falco_cli-0.26.2/src/falco_cli}/commands/crud/model_crud.py +8 -8
- {falco_cli-0.26.1/src/falco → falco_cli-0.26.2/src/falco_cli}/commands/crud/utils.py +2 -2
- {falco_cli-0.26.1/src/falco → falco_cli-0.26.2/src/falco_cli}/commands/htmx.py +4 -4
- {falco_cli-0.26.1/src/falco → falco_cli-0.26.2/src/falco_cli}/commands/htmx_extension.py +4 -4
- {falco_cli-0.26.1/src/falco → falco_cli-0.26.2/src/falco_cli}/commands/reset_migrations.py +3 -3
- {falco_cli-0.26.1/src/falco → falco_cli-0.26.2/src/falco_cli}/commands/rm_migrations.py +4 -4
- {falco_cli-0.26.1/src/falco → falco_cli-0.26.2/src/falco_cli}/commands/start_app.py +4 -4
- {falco_cli-0.26.1/src/falco → falco_cli-0.26.2/src/falco_cli}/commands/start_project.py +10 -16
- {falco_cli-0.26.1/src/falco → falco_cli-0.26.2/src/falco_cli}/commands/sync_dotenv.py +1 -1
- {falco_cli-0.26.1/src/falco → falco_cli-0.26.2/src/falco_cli}/commands/update_project.py +18 -20
- {falco_cli-0.26.1/src/falco → falco_cli-0.26.2/src/falco_cli}/commands/work.py +1 -1
- {falco_cli-0.26.1/src/falco → falco_cli-0.26.2/src/falco_cli}/config.py +5 -1
- {falco_cli-0.26.1/src/falco → falco_cli-0.26.2/src/falco_cli}/utils.py +10 -2
- {falco_cli-0.26.1 → falco_cli-0.26.2}/tests/commands/test_crud.py +1 -1
- {falco_cli-0.26.1 → falco_cli-0.26.2}/tests/commands/test_htmx.py +4 -4
- {falco_cli-0.26.1 → falco_cli-0.26.2}/tests/commands/test_htmx_extension.py +1 -1
- {falco_cli-0.26.1 → falco_cli-0.26.2}/tests/commands/test_reset_migrations.py +1 -1
- {falco_cli-0.26.1 → falco_cli-0.26.2}/tests/commands/test_start_project.py +1 -1
- {falco_cli-0.26.1 → falco_cli-0.26.2}/tests/commands/test_work.py +8 -5
- {falco_cli-0.26.1 → falco_cli-0.26.2}/tests/conftest.py +2 -2
- {falco_cli-0.26.1 → falco_cli-0.26.2}/.all-contributorsrc +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/.editorconfig +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/.github/workflows/ci.yml +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/.github/workflows/pre-commit-auto-update.yml +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/.github/workflows/publish.yml +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/.gitignore +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/.gitmodules +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/.pre-commit-config.yaml +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/.readthedocs.yaml +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/.vscode/settings.json +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/CODE_OF_CONDUCT.md +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/LICENSE +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/README.md +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/all-contributorsrc +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/.rich-codex.yml +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/Makefile +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/_static/add-og-title-to-home.js +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/_static/custom.css +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/_static/deployment.png +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/_static/falco-logo.png +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/_static/falco-logo.svg +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/_static/logo_with_text.svg +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/_static/og-image.jpg +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/_static/snippets/entry_model.py +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/_static/snippets/tree-1.txt +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/_static/snippets/tree-2.txt +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/_static/snippets/tree-3.txt +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/_static/snippets/types.py +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/_static/snippets/urls.py +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/_static/snippets/utils.py +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/_static/task_queue.png +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/_templates/components/nav-versions.html +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/_templates/sidebars/buy-me-a-coffee.html +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/_templates/sidebars/consulting.html +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/changelog.rst +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/codeofconduct.rst +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/contributing.rst +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/guides/avoiding_god_models.rst +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/guides/database_tips.rst +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/guides/dynamic_model_schema.rst +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/guides/index.rst +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/guides/interactive_user_interfaces.rst +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/guides/logging_and_monitoring.rst +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/guides/multitenancy.rst +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/guides/optimizing_database_access.rst +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/guides/permissions_and_authorization.rst +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/guides/realtime.rst +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/guides/running_project_in_a_container.rst +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/guides/task_queues_and_schedulers.rst +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/guides/tips_and_extra.rst +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/guides/use_sqlite_in_production.rst +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/guides/writing_async_code.rst +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/guides/writing_documentation.rst +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/guides/writing_tests.rst +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/index.rst +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/install.rst +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/license.rst +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/make.bat +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/requirements.txt +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/the_cli/start_project/dependency.rst +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/the_cli/start_project/deploy.rst +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/the_cli/start_project/issues.rst +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/the_cli/start_project/packages.rst +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/the_cli/start_project/structure.rst +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/docs/the_cli/usage.rst +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/justfile +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/requirements.txt +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/scripts/update_readme_guides.py +0 -0
- {falco_cli-0.26.1/src/falco → falco_cli-0.26.2/src/falco_cli}/checks.py +0 -0
- {falco_cli-0.26.1/src/falco → falco_cli-0.26.2/src/falco_cli}/commands/__init__.py +0 -0
- {falco_cli-0.26.1/src/falco → falco_cli-0.26.2/src/falco_cli}/commands/crud/__init__.py +0 -0
- {falco_cli-0.26.1/src/falco → falco_cli-0.26.2/src/falco_cli}/crud/html/create.html.jinja +0 -0
- {falco_cli-0.26.1/src/falco → falco_cli-0.26.2/src/falco_cli}/crud/html/detail.html.jinja +0 -0
- {falco_cli-0.26.1/src/falco → falco_cli-0.26.2/src/falco_cli}/crud/html/list.html.jinja +0 -0
- {falco_cli-0.26.1/src/falco → falco_cli-0.26.2/src/falco_cli}/crud/html/update.html.jinja +0 -0
- {falco_cli-0.26.1/src/falco → falco_cli-0.26.2/src/falco_cli}/crud/python/forms.py.jinja +0 -0
- {falco_cli-0.26.1/src/falco → falco_cli-0.26.2/src/falco_cli}/crud/python/views.py.jinja +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/tests/__init__.py +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/tests/commands/test_rm_migrations.py +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/tests/commands/test_start_app.py +0 -0
- {falco_cli-0.26.1 → falco_cli-0.26.2}/tests/commands/test_sync_dotenv.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: falco-cli
|
|
3
|
-
Version: 0.26.
|
|
3
|
+
Version: 0.26.2
|
|
4
4
|
Summary: Enhance your Django developer experience: CLI and Guides for the Modern Developer.
|
|
5
5
|
Project-URL: Documentation, https://falco.oluwatobi.dev/
|
|
6
6
|
Project-URL: Homepage, https://falco.oluwatobi.dev/
|
|
@@ -20,10 +20,12 @@ Classifier: Intended Audience :: Developers
|
|
|
20
20
|
Classifier: Natural Language :: English
|
|
21
21
|
Classifier: Programming Language :: Python
|
|
22
22
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
25
|
Classifier: Programming Language :: Python :: 3.12
|
|
24
26
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
25
27
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
26
|
-
Requires-Python: >=3.
|
|
28
|
+
Requires-Python: >=3.10
|
|
27
29
|
Requires-Dist: autoflake
|
|
28
30
|
Requires-Dist: black
|
|
29
31
|
Requires-Dist: cappa
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import falco_cli
|
|
2
2
|
|
|
3
3
|
# Configuration file for the Sphinx documentation builder.
|
|
4
4
|
#
|
|
@@ -11,7 +11,7 @@ import falco
|
|
|
11
11
|
project = "Falco"
|
|
12
12
|
copyright = "Copyright © 2023, Tobi DEGNON"
|
|
13
13
|
author = "Tobi DEGNON"
|
|
14
|
-
version =
|
|
14
|
+
version = falco_cli.falco_cli_version
|
|
15
15
|
release = version
|
|
16
16
|
|
|
17
17
|
# -- General configuration ---------------------------------------------------
|
|
@@ -66,7 +66,7 @@ html_theme_options = {
|
|
|
66
66
|
"og_image_url": "https://raw.githubusercontent.com/Tobi-De/falco/main/docs/images/og-image.jpg",
|
|
67
67
|
"nav_links": [
|
|
68
68
|
{"title": "Home", "url": "index"},
|
|
69
|
-
|
|
69
|
+
{
|
|
70
70
|
"title": "Community",
|
|
71
71
|
"children": [
|
|
72
72
|
{
|
|
@@ -89,8 +89,12 @@ html_theme_options = {
|
|
|
89
89
|
},
|
|
90
90
|
],
|
|
91
91
|
},
|
|
92
|
-
{
|
|
93
|
-
|
|
92
|
+
{
|
|
93
|
+
"title": "Support",
|
|
94
|
+
"url": "https://buymeacoffee.com/oluwa.tobi",
|
|
95
|
+
"icon": "heart",
|
|
96
|
+
},
|
|
97
|
+
],
|
|
94
98
|
}
|
|
95
99
|
html_logo = "_static/logo_with_text.svg"
|
|
96
100
|
html_favicon = "_static/falco-logo.svg"
|
|
@@ -446,7 +446,7 @@ I can recommend, some of which even offer some kind of free usage to reduce your
|
|
|
446
446
|
|
|
447
447
|
|
|
448
448
|
Managed solutions
|
|
449
|
-
|
|
449
|
+
*****************
|
|
450
450
|
|
|
451
451
|
These are the platforms that handle much of the infrastructure for you, in exchange for a higher cost. Typically, these require the least amount of work once you become familiar with how they work.
|
|
452
452
|
Even though my experience with these platforms is limited, they are generally similarly priced and quite user-friendly. The descriptions provided below are directly sourced from their respective websites.
|
|
@@ -466,7 +466,7 @@ Even though my experience with these platforms is limited, they are generally si
|
|
|
466
466
|
|
|
467
467
|
|
|
468
468
|
Self-Managed solutions
|
|
469
|
-
|
|
469
|
+
**********************
|
|
470
470
|
|
|
471
471
|
If you're new to the concept, the term **self-hosting** might be misleading. Typically, **self-hosting** is used to refer to the practice of renting a Virtual Private Server (VPS)
|
|
472
472
|
and handling all the work yourself, rather than paying someone else to do it for you. While this method might be cheaper, true **self-hosting** technically requires owning your
|
|
@@ -475,7 +475,7 @@ encourage you to do your own research. If your budget allows, consider trying bo
|
|
|
475
475
|
|
|
476
476
|
|
|
477
477
|
Self-hostable P.A.A.S
|
|
478
|
-
|
|
478
|
+
^^^^^^^^^^^^^^^^^^^^^
|
|
479
479
|
|
|
480
480
|
These P.A.A.S solutions necessitate the purchase of your own server (unless you utilize their offerings), but they simplify your tasks by providing an experience akin to that of a managed solution.
|
|
481
481
|
|
|
@@ -493,7 +493,7 @@ In case it wasn't clear, caprover is my PaaS of choice.
|
|
|
493
493
|
|
|
494
494
|
|
|
495
495
|
Bare-bone VPS
|
|
496
|
-
|
|
496
|
+
^^^^^^^^^^^^^
|
|
497
497
|
|
|
498
498
|
This section introduces bare-metal solutions: a list of Virtual Private Servers (VPS) providers. This is likely the most affordable option, but it also requires the most effort on your part.
|
|
499
499
|
The offerings in this category are diverse in range and price, so you have plenty of choices. However, be prepared to invest more time unless you opt to automate some processes,
|
|
@@ -511,7 +511,7 @@ for instance, by using a tool like `ansible <https://www.ansible.com>`_.
|
|
|
511
511
|
* `Contabo <https://contabo.com/>`_
|
|
512
512
|
|
|
513
513
|
Personal Recommendations
|
|
514
|
-
|
|
514
|
+
************************
|
|
515
515
|
|
|
516
516
|
If you're feeling a bit overwhelmed by the options provided above, here are my personal recommendations:
|
|
517
517
|
|
|
@@ -541,7 +541,7 @@ Alternative strategies
|
|
|
541
541
|
The web is not the only medium to distribute your app. It's the most popular one, but certainly not the sole option.
|
|
542
542
|
|
|
543
543
|
Serverless
|
|
544
|
-
|
|
544
|
+
**********
|
|
545
545
|
|
|
546
546
|
The serverless trend appears to have slowed down lately, but there are still use cases. I have almost no experience with this approach, but it promises to run
|
|
547
547
|
your app without constantly active servers at the lowest possible cost.
|
|
@@ -552,7 +552,7 @@ and then the server is stopped. A server is still involved, but it is not runnin
|
|
|
552
552
|
The most popular solution in the Python ecosystem seems to be `zappa <https://github.com/zappa/Zappa>`_.
|
|
553
553
|
|
|
554
554
|
Desktop / Mobile app
|
|
555
|
-
|
|
555
|
+
*********************
|
|
556
556
|
|
|
557
557
|
Packaging your apps as mobile or desktop applications remains an option, though the use cases for this are quite niche. If your project was better suited as a desktop app from the outset,
|
|
558
558
|
perhaps Django wasn't the appropriate tool to begin with.
|
|
@@ -8,7 +8,7 @@ Accelerate prototyping with basic CRUD (Create, Read, Update, Delete) python vie
|
|
|
8
8
|
CRUD
|
|
9
9
|
----
|
|
10
10
|
|
|
11
|
-
.. cappa::
|
|
11
|
+
.. cappa:: falco_cli.commands.ModelCRUD
|
|
12
12
|
|
|
13
13
|
.. warning::
|
|
14
14
|
|
|
@@ -196,9 +196,9 @@ Below is an example of the context each template will receive.
|
|
|
196
196
|
.. jupyter-execute::
|
|
197
197
|
:hide-code:
|
|
198
198
|
|
|
199
|
-
from
|
|
200
|
-
from
|
|
201
|
-
from
|
|
199
|
+
from falco_cli.commands.crud.model_crud import HtmlBlueprintContext
|
|
200
|
+
from falco_cli.commands.crud.model_crud import get_html_blueprint_context
|
|
201
|
+
from falco_cli.commands.crud.model_crud import DjangoModel
|
|
202
202
|
from pprint import pprint
|
|
203
203
|
|
|
204
204
|
dj_model = DjangoModel(
|
|
@@ -8,7 +8,7 @@ A set of handy utilities for easily obtaining the htmx library and its extension
|
|
|
8
8
|
htmx
|
|
9
9
|
----
|
|
10
10
|
|
|
11
|
-
.. cappa::
|
|
11
|
+
.. cappa:: falco_cli.commands.Htmx
|
|
12
12
|
|
|
13
13
|
Download the htmx javascript library. You won’t have to download htmx or its extensions often but at least if you need it, I think this
|
|
14
14
|
is an easy way to get the file available locally.
|
|
@@ -42,7 +42,7 @@ the command without specifying any arguments, it will list all the available ext
|
|
|
42
42
|
Similar to the `htmx` commands, this will also use your ``pyproject.toml`` file if it's found. However,
|
|
43
43
|
it's solely for downloading the extensions file next to your ``htmx.min.js`` file, in case no path was specified in the command.
|
|
44
44
|
|
|
45
|
-
.. cappa::
|
|
45
|
+
.. cappa:: falco_cli.commands.HtmxExtension
|
|
46
46
|
|
|
47
47
|
**Example**
|
|
48
48
|
|
|
@@ -24,7 +24,7 @@ Additionally, these commands require acces to your virtual environment, so make
|
|
|
24
24
|
experienced it a few times myself. The simplest solution for now is to install the ``falco-cli`` in the same virtual environment as your project.
|
|
25
25
|
This should resolve the issue.
|
|
26
26
|
|
|
27
|
-
.. cappa::
|
|
27
|
+
.. cappa:: falco_cli.__main__.FalcoCLI
|
|
28
28
|
|
|
29
29
|
.. toctree::
|
|
30
30
|
:hidden:
|
|
@@ -10,7 +10,7 @@ Remove / Reset your migrations
|
|
|
10
10
|
rm-migrations
|
|
11
11
|
-------------
|
|
12
12
|
|
|
13
|
-
.. cappa::
|
|
13
|
+
.. cappa:: falco_cli.commands.RmMigrations
|
|
14
14
|
|
|
15
15
|
.. warning::
|
|
16
16
|
This command will delete all your migrations files, be sure to commit your changes before running this command.
|
|
@@ -41,7 +41,7 @@ then the following command might be a better option than running ``rm-migrations
|
|
|
41
41
|
reset-migrations
|
|
42
42
|
----------------
|
|
43
43
|
|
|
44
|
-
.. cappa::
|
|
44
|
+
.. cappa:: falco_cli.commands.ResetMigrations
|
|
45
45
|
|
|
46
46
|
.. note::
|
|
47
47
|
Before running this command, make sure you have applied any pending migrations, ``makemigrations && migrate``. The idea is to reset the migrations while keeping the data. If your current database does not have up to date migrations, it will fail.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Start project
|
|
4
4
|
=============
|
|
5
5
|
|
|
6
|
-
.. cappa::
|
|
6
|
+
.. cappa:: falco_cli.commands.StartProject
|
|
7
7
|
|
|
8
8
|
Initialize a new django project the falco way. This project-starter makes several assumptions; we'll go through the most important choices I made in the next couples of sections.
|
|
9
9
|
I'll list some alternatives below in case you don't agree with my choices. But even if you choose to use an alternative, most commands
|
|
@@ -35,13 +35,13 @@ can still bring you value.
|
|
|
35
35
|
.. admonition:: Experimental
|
|
36
36
|
:class: important
|
|
37
37
|
|
|
38
|
-
You can update your project to stay current with the latest changes in the project starter. Please note that this is an experimental feature. Ensure you commit your
|
|
39
|
-
changes before running the command. If there are conflicts, ``.rej`` files will be generated, which you will need to review and manually update the corresponding files
|
|
38
|
+
You can update your project to stay current with the latest changes in the project starter. Please note that this is an experimental feature. Ensure you commit your
|
|
39
|
+
changes before running the command. If there are conflicts, ``.rej`` files will be generated, which you will need to review and manually update the corresponding files
|
|
40
40
|
if necessary.
|
|
41
41
|
|
|
42
42
|
.. code-block:: shell
|
|
43
43
|
|
|
44
|
-
falco update-project
|
|
44
|
+
falco update-project
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
The subsequent sections will delve deeper into the folder structure, package choices, and provide guidance on deploying your project.
|
|
@@ -4,7 +4,7 @@ Sync Dotenv files
|
|
|
4
4
|
=================
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
.. cappa::
|
|
7
|
+
.. cappa:: falco_cli.commands.SyncDotenv
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
Any Django project created with the `start-project </guides/start_project.html>`_ command comes with a ``.env.template`` file. It serves as an example for the environment variables that
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Work - Running multiple process in one session
|
|
4
4
|
==============================================
|
|
5
5
|
|
|
6
|
-
.. cappa::
|
|
6
|
+
.. cappa:: falco_cli.commands.Work
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
This command allows you to run multiple commands simultaneously. Typically, when working with a large or growing django project, you
|
|
@@ -18,7 +18,7 @@ license = "MIT"
|
|
|
18
18
|
authors = [
|
|
19
19
|
{ name = "Tobi DEGNON", email = "tobidegnon@proton.me" },
|
|
20
20
|
]
|
|
21
|
-
requires-python = ">=3.
|
|
21
|
+
requires-python = ">=3.10"
|
|
22
22
|
classifiers = [
|
|
23
23
|
"Development Status :: 4 - Beta",
|
|
24
24
|
"Framework :: Django :: 4",
|
|
@@ -30,6 +30,8 @@ classifiers = [
|
|
|
30
30
|
"Natural Language :: English",
|
|
31
31
|
"Programming Language :: Python",
|
|
32
32
|
"Programming Language :: Python :: 3 :: Only",
|
|
33
|
+
"Programming Language :: Python :: 3.10",
|
|
34
|
+
"Programming Language :: Python :: 3.11",
|
|
33
35
|
"Programming Language :: Python :: 3.12",
|
|
34
36
|
"Programming Language :: Python :: Implementation :: CPython",
|
|
35
37
|
"Programming Language :: Python :: Implementation :: PyPy",
|
|
@@ -58,11 +60,11 @@ urls.Homepage = "https://falco.oluwatobi.dev/"
|
|
|
58
60
|
urls.Issues = "https://github.com/tobi-de/falco/issues"
|
|
59
61
|
urls.Source = "https://github.com/tobi-de/falco"
|
|
60
62
|
|
|
61
|
-
scripts.falco = "
|
|
63
|
+
scripts.falco = "falco_cli.__main__:main"
|
|
62
64
|
|
|
63
65
|
[tool.hatch.build.targets.wheel]
|
|
64
66
|
packages = [
|
|
65
|
-
"src/
|
|
67
|
+
"src/falco_cli",
|
|
66
68
|
]
|
|
67
69
|
|
|
68
70
|
[tool.hatch.env]
|
|
@@ -120,7 +122,7 @@ lock-filename = "docs/requirements.txt"
|
|
|
120
122
|
allow-direct-references = true
|
|
121
123
|
|
|
122
124
|
[tool.hatch.version]
|
|
123
|
-
path = "src/
|
|
125
|
+
path = "src/falco_cli/__about__.py"
|
|
124
126
|
|
|
125
127
|
[tool.ruff]
|
|
126
128
|
exclude = [
|
|
@@ -145,11 +147,11 @@ lint.extend-per-file-ignores."demo/config/settings.py" = [
|
|
|
145
147
|
lint.extend-per-file-ignores."demo/demo/orders/migrations/*.py" = [
|
|
146
148
|
"RUF012",
|
|
147
149
|
]
|
|
148
|
-
lint.extend-per-file-ignores."docs/
|
|
149
|
-
"A001",
|
|
150
|
+
lint.extend-per-file-ignores."docs/_static/snippets/entry_model.py" = [
|
|
150
151
|
"INP001",
|
|
151
152
|
]
|
|
152
|
-
lint.extend-per-file-ignores."docs/
|
|
153
|
+
lint.extend-per-file-ignores."docs/conf.py" = [
|
|
154
|
+
"A001",
|
|
153
155
|
"INP001",
|
|
154
156
|
]
|
|
155
157
|
lint.extend-per-file-ignores."src/falco/commands/crud/model_crud.py" = [
|
|
@@ -178,11 +180,11 @@ testpaths = [
|
|
|
178
180
|
[tool.coverage.paths]
|
|
179
181
|
falco = [
|
|
180
182
|
"src/falco",
|
|
181
|
-
"*/
|
|
183
|
+
"*/falco_cli/src/falco",
|
|
182
184
|
]
|
|
183
185
|
tests = [
|
|
184
186
|
"tests",
|
|
185
|
-
"*/
|
|
187
|
+
"*/falco_cli/tests",
|
|
186
188
|
]
|
|
187
189
|
|
|
188
190
|
[tool.coverage.report]
|
|
@@ -195,7 +197,7 @@ exclude_lines = [
|
|
|
195
197
|
[tool.coverage.run]
|
|
196
198
|
branch = true
|
|
197
199
|
omit = [
|
|
198
|
-
"src/
|
|
200
|
+
"src/falco_cli/__about__.py",
|
|
199
201
|
]
|
|
200
202
|
parallel = true
|
|
201
203
|
source_pkgs = [
|
|
@@ -207,7 +209,7 @@ source_pkgs = [
|
|
|
207
209
|
allow_dirty = false
|
|
208
210
|
commit = true
|
|
209
211
|
commit_args = "--no-verify"
|
|
210
|
-
current_version = "0.26.
|
|
212
|
+
current_version = "0.26.2"
|
|
211
213
|
ignore_missing_files = false
|
|
212
214
|
ignore_missing_version = false
|
|
213
215
|
message = "Bump version: {current_version} → {new_version}"
|
|
@@ -224,6 +226,6 @@ tag_message = "Bump version: {current_version} → {new_version}"
|
|
|
224
226
|
tag_name = "v{new_version}"
|
|
225
227
|
|
|
226
228
|
[[tool.bumpversion.files]]
|
|
227
|
-
filename = "src/
|
|
229
|
+
filename = "src/falco_cli/__about__.py"
|
|
228
230
|
replace = '__version__ = "{new_version}"'
|
|
229
231
|
search = '__version__ = "{current_version}"'
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import cappa
|
|
2
|
-
from
|
|
3
|
-
from
|
|
4
|
-
from
|
|
5
|
-
from
|
|
6
|
-
from
|
|
7
|
-
from
|
|
8
|
-
from
|
|
9
|
-
from
|
|
10
|
-
from
|
|
11
|
-
from
|
|
2
|
+
from falco_cli.commands import Htmx
|
|
3
|
+
from falco_cli.commands import HtmxExtension
|
|
4
|
+
from falco_cli.commands import ModelCRUD
|
|
5
|
+
from falco_cli.commands import ResetMigrations
|
|
6
|
+
from falco_cli.commands import RmMigrations
|
|
7
|
+
from falco_cli.commands import StartApp
|
|
8
|
+
from falco_cli.commands import StartProject
|
|
9
|
+
from falco_cli.commands import SyncDotenv
|
|
10
|
+
from falco_cli.commands import UpdateProject
|
|
11
|
+
from falco_cli.commands import Work
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
@cappa.command(
|
|
15
15
|
help="Enhance your Django developer experience: CLI and Guides for the Modern Django Developer.",
|
|
16
16
|
)
|
|
17
|
-
class
|
|
17
|
+
class FalcoCLI:
|
|
18
18
|
subcommand: cappa.Subcommands[
|
|
19
19
|
StartProject
|
|
20
20
|
| UpdateProject
|
|
@@ -30,7 +30,7 @@ class Falco:
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
def main():
|
|
33
|
-
cappa.invoke(
|
|
33
|
+
cappa.invoke(FalcoCLI)
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
if __name__ == "__main__":
|
|
@@ -5,14 +5,14 @@ from typing import TypedDict
|
|
|
5
5
|
|
|
6
6
|
import cappa
|
|
7
7
|
import parso
|
|
8
|
-
from
|
|
9
|
-
from
|
|
10
|
-
from
|
|
11
|
-
from
|
|
12
|
-
from
|
|
13
|
-
from
|
|
14
|
-
from
|
|
15
|
-
from
|
|
8
|
+
from falco_cli import checks
|
|
9
|
+
from falco_cli.config import CRUDConfig
|
|
10
|
+
from falco_cli.config import read_falco_config
|
|
11
|
+
from falco_cli.utils import get_project_name
|
|
12
|
+
from falco_cli.utils import RICH_ERROR_MARKER
|
|
13
|
+
from falco_cli.utils import RICH_SUCCESS_MARKER
|
|
14
|
+
from falco_cli.utils import run_in_shell
|
|
15
|
+
from falco_cli.utils import simple_progress
|
|
16
16
|
from rich import print as rich_print
|
|
17
17
|
|
|
18
18
|
from .utils import extract_python_file_templates
|
|
@@ -3,7 +3,7 @@ import subprocess
|
|
|
3
3
|
from pathlib import Path
|
|
4
4
|
|
|
5
5
|
import cappa
|
|
6
|
-
from
|
|
6
|
+
from falco_cli.utils import simple_progress
|
|
7
7
|
from jinja2 import Template
|
|
8
8
|
|
|
9
9
|
|
|
@@ -18,7 +18,7 @@ def render_to_string(template_content: str, context: dict):
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
def get_crud_blueprints_path() -> Path:
|
|
21
|
-
package = importlib.util.find_spec("
|
|
21
|
+
package = importlib.util.find_spec("falco_cli")
|
|
22
22
|
if package is None:
|
|
23
23
|
raise cappa.Exit("The falco base install path could not be found.", code=1)
|
|
24
24
|
return Path(package.submodule_search_locations[0]) / "crud"
|
|
@@ -4,10 +4,10 @@ from pathlib import Path
|
|
|
4
4
|
from typing import Annotated
|
|
5
5
|
|
|
6
6
|
import cappa
|
|
7
|
-
from
|
|
8
|
-
from
|
|
9
|
-
from
|
|
10
|
-
from
|
|
7
|
+
from falco_cli.config import read_falco_config
|
|
8
|
+
from falco_cli.config import write_falco_config
|
|
9
|
+
from falco_cli.utils import get_pyproject_file
|
|
10
|
+
from falco_cli.utils import network_request_with_progress
|
|
11
11
|
from httpx import codes
|
|
12
12
|
from rich import print as rich_print
|
|
13
13
|
from rich.panel import Panel
|
|
@@ -3,10 +3,10 @@ from typing import Annotated
|
|
|
3
3
|
|
|
4
4
|
import cappa
|
|
5
5
|
import httpx
|
|
6
|
-
from
|
|
7
|
-
from
|
|
8
|
-
from
|
|
9
|
-
from
|
|
6
|
+
from falco_cli.config import read_falco_config
|
|
7
|
+
from falco_cli.utils import get_pyproject_file
|
|
8
|
+
from falco_cli.utils import network_request_with_progress
|
|
9
|
+
from falco_cli.utils import simple_progress
|
|
10
10
|
from rich import print as rich_print
|
|
11
11
|
from rich.console import Console
|
|
12
12
|
from rich.panel import Panel
|
|
@@ -3,9 +3,9 @@ from pathlib import Path
|
|
|
3
3
|
from typing import Annotated
|
|
4
4
|
|
|
5
5
|
import cappa
|
|
6
|
-
from
|
|
7
|
-
from
|
|
8
|
-
from
|
|
6
|
+
from falco_cli.utils import get_project_name
|
|
7
|
+
from falco_cli.utils import run_in_shell
|
|
8
|
+
from falco_cli.utils import simple_progress
|
|
9
9
|
from rich import print as rich_print
|
|
10
10
|
|
|
11
11
|
from .rm_migrations import RmMigrations
|
|
@@ -2,10 +2,10 @@ from pathlib import Path
|
|
|
2
2
|
from typing import Annotated
|
|
3
3
|
|
|
4
4
|
import cappa
|
|
5
|
-
from
|
|
6
|
-
from
|
|
7
|
-
from
|
|
8
|
-
from
|
|
5
|
+
from falco_cli import checks
|
|
6
|
+
from falco_cli.utils import get_project_name
|
|
7
|
+
from falco_cli.utils import run_in_shell
|
|
8
|
+
from falco_cli.utils import simple_progress
|
|
9
9
|
from rich import print as rich_print
|
|
10
10
|
|
|
11
11
|
|
|
@@ -4,10 +4,10 @@ from typing import Annotated
|
|
|
4
4
|
|
|
5
5
|
import cappa
|
|
6
6
|
import parso
|
|
7
|
-
from
|
|
8
|
-
from
|
|
9
|
-
from
|
|
10
|
-
from
|
|
7
|
+
from falco_cli.commands.crud.utils import run_python_formatters
|
|
8
|
+
from falco_cli.utils import get_project_name
|
|
9
|
+
from falco_cli.utils import run_in_shell
|
|
10
|
+
from falco_cli.utils import simple_progress
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
def get_settings_file_path() -> str:
|
|
@@ -12,21 +12,19 @@ import cappa
|
|
|
12
12
|
from cookiecutter.config import get_user_config
|
|
13
13
|
from cookiecutter.exceptions import CookiecutterException
|
|
14
14
|
from cookiecutter.main import cookiecutter
|
|
15
|
-
from
|
|
16
|
-
from
|
|
17
|
-
from
|
|
18
|
-
from
|
|
19
|
-
from
|
|
20
|
-
from
|
|
21
|
-
from
|
|
15
|
+
from falco_cli.commands.crud.utils import run_html_formatters
|
|
16
|
+
from falco_cli.config import write_falco_config
|
|
17
|
+
from falco_cli.utils import clean_project_name
|
|
18
|
+
from falco_cli.utils import is_new_falco_cli_available
|
|
19
|
+
from falco_cli.utils import RICH_INFO_MARKER
|
|
20
|
+
from falco_cli.utils import RICH_SUCCESS_MARKER
|
|
21
|
+
from falco_cli.utils import simple_progress
|
|
22
|
+
from falco_cli.utils import get_username
|
|
22
23
|
from rich import print as rich_print
|
|
23
24
|
from rich.prompt import Prompt
|
|
24
25
|
|
|
25
26
|
|
|
26
|
-
DEFAULT_SKIP = [
|
|
27
|
-
"playground.ipynb",
|
|
28
|
-
"README.md",
|
|
29
|
-
]
|
|
27
|
+
DEFAULT_SKIP = ["playground.ipynb", "README.md", "*/static/*"]
|
|
30
28
|
|
|
31
29
|
|
|
32
30
|
@cappa.command(help="Initialize a new django project the falco way.")
|
|
@@ -126,10 +124,6 @@ class StartProject:
|
|
|
126
124
|
author_name, author_email = get_authors_info()
|
|
127
125
|
with simple_progress("Initializing your new django project... :sunglasses:"):
|
|
128
126
|
try:
|
|
129
|
-
try:
|
|
130
|
-
username = os.getlogin()
|
|
131
|
-
except OSError:
|
|
132
|
-
username = "tobi"
|
|
133
127
|
project_dir = cookiecutter(
|
|
134
128
|
self.blueprint,
|
|
135
129
|
no_input=True,
|
|
@@ -139,7 +133,7 @@ class StartProject:
|
|
|
139
133
|
"project_name": self.project_name,
|
|
140
134
|
"author_name": author_name,
|
|
141
135
|
"author_email": author_email,
|
|
142
|
-
"username":
|
|
136
|
+
"username": get_username(),
|
|
143
137
|
"secret_key": f"django-insecure-{secrets.token_urlsafe(32)}",
|
|
144
138
|
},
|
|
145
139
|
)
|
|
@@ -4,9 +4,6 @@ from contextlib import contextmanager
|
|
|
4
4
|
from pathlib import Path
|
|
5
5
|
from typing import Annotated
|
|
6
6
|
from typing import Any
|
|
7
|
-
from typing import Dict
|
|
8
|
-
from typing import Optional
|
|
9
|
-
from typing import Set
|
|
10
7
|
|
|
11
8
|
import cappa
|
|
12
9
|
import tomlkit
|
|
@@ -15,11 +12,12 @@ from cruft import diff as cruft_diff
|
|
|
15
12
|
from cruft._commands import utils
|
|
16
13
|
from cruft._commands.update import _apply_project_updates
|
|
17
14
|
from cruft._commands.utils.iohelper import AltTemporaryDirectory
|
|
18
|
-
from
|
|
19
|
-
from
|
|
20
|
-
from
|
|
21
|
-
from
|
|
22
|
-
from
|
|
15
|
+
from falco_cli import checks
|
|
16
|
+
from falco_cli.config import FalcoConfig
|
|
17
|
+
from falco_cli.utils import get_project_name
|
|
18
|
+
from falco_cli.utils import get_username
|
|
19
|
+
from falco_cli.utils import RICH_INFO_MARKER
|
|
20
|
+
from falco_cli.utils import RICH_SUCCESS_MARKER
|
|
23
21
|
from rich import print as rich_print
|
|
24
22
|
|
|
25
23
|
|
|
@@ -44,6 +42,7 @@ def cruft_state_from(config: FalcoConfig, project_name: str, author_name: str, a
|
|
|
44
42
|
"project_name": project_name,
|
|
45
43
|
"author_name": author_name,
|
|
46
44
|
"author_email": author_email,
|
|
45
|
+
"username": get_username(),
|
|
47
46
|
"secret_key": secrets.token_hex(24),
|
|
48
47
|
"_template": config["blueprint"],
|
|
49
48
|
}
|
|
@@ -58,13 +57,12 @@ class UpdateProject:
|
|
|
58
57
|
bool,
|
|
59
58
|
cappa.Arg(default=False, short="-d", long="--diff", help="Show diff of changes."),
|
|
60
59
|
]
|
|
60
|
+
interactive: Annotated[
|
|
61
|
+
bool,
|
|
62
|
+
cappa.Arg(default=False, short="-i", long="--interactive", help="Interactive mode"),
|
|
63
|
+
]
|
|
61
64
|
|
|
62
65
|
def __call__(self, project_name: Annotated[str, cappa.Dep(get_project_name)]) -> None:
|
|
63
|
-
# if is_new_falco_cli_available(fail_on_error=True):
|
|
64
|
-
# raise cappa.Exit(
|
|
65
|
-
# "You need have the latest version of falco-cli to update.", code=1
|
|
66
|
-
# )
|
|
67
|
-
|
|
68
66
|
checks.clean_git_repo()
|
|
69
67
|
|
|
70
68
|
pyproject_path = Path("pyproject.toml")
|
|
@@ -86,7 +84,7 @@ class UpdateProject:
|
|
|
86
84
|
raise cappa.Exit(code=0)
|
|
87
85
|
|
|
88
86
|
with cruft_file(cruft_state):
|
|
89
|
-
last_commit = cruft_update(allow_untracked_files=True)
|
|
87
|
+
last_commit = cruft_update(allow_untracked_files=True, skip_apply_ask=not self.interactive)
|
|
90
88
|
if last_commit is None:
|
|
91
89
|
rich_print(f"{RICH_INFO_MARKER} Nothing to do, project is already up to date!")
|
|
92
90
|
raise cappa.Exit(code=0)
|
|
@@ -99,13 +97,13 @@ def cruft_update(
|
|
|
99
97
|
project_dir: Path = Path("."),
|
|
100
98
|
cookiecutter_input: bool = False,
|
|
101
99
|
refresh_private_variables: bool = False,
|
|
102
|
-
skip_apply_ask: bool =
|
|
100
|
+
skip_apply_ask: bool = True,
|
|
103
101
|
skip_update: bool = False,
|
|
104
|
-
checkout:
|
|
102
|
+
checkout: str | None = None,
|
|
105
103
|
strict: bool = True,
|
|
106
104
|
allow_untracked_files: bool = False,
|
|
107
|
-
extra_context:
|
|
108
|
-
extra_context_file:
|
|
105
|
+
extra_context: dict[str, Any] | None = None,
|
|
106
|
+
extra_context_file: Path | None = None,
|
|
109
107
|
) -> bool:
|
|
110
108
|
"""Update specified project's cruft to the latest and greatest release."""
|
|
111
109
|
cruft_file = utils.cruft.get_cruft_file(project_dir)
|
|
@@ -123,7 +121,7 @@ def cruft_update(
|
|
|
123
121
|
return False
|
|
124
122
|
|
|
125
123
|
extra_context_from_cli = extra_context
|
|
126
|
-
with open(extra_context_file
|
|
124
|
+
with open(extra_context_file) as extra_context_fp:
|
|
127
125
|
extra_context = json.load(extra_context_fp) or {}
|
|
128
126
|
extra_context = extra_context.get("context") or {}
|
|
129
127
|
extra_context = extra_context.get("cookiecutter") or {}
|
|
@@ -154,7 +152,7 @@ def cruft_update(
|
|
|
154
152
|
repo_dir = tmpdir / "repo"
|
|
155
153
|
current_template_dir = tmpdir / "current_template"
|
|
156
154
|
new_template_dir = tmpdir / "new_template"
|
|
157
|
-
deleted_paths:
|
|
155
|
+
deleted_paths: set[Path] = set()
|
|
158
156
|
# Clone the template
|
|
159
157
|
with utils.cookiecutter.get_cookiecutter_repo(cruft_state["template"], repo_dir, checkout) as repo:
|
|
160
158
|
last_commit = repo.head.object.hexsha
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import ast
|
|
2
|
+
import os
|
|
2
3
|
import inspect
|
|
3
4
|
import subprocess
|
|
4
5
|
from collections.abc import Callable
|
|
@@ -9,7 +10,7 @@ from typing import TypeVar
|
|
|
9
10
|
import cappa
|
|
10
11
|
import httpx
|
|
11
12
|
import tomlkit
|
|
12
|
-
from
|
|
13
|
+
from falco_cli import falco_cli_version
|
|
13
14
|
from rich.progress import Progress
|
|
14
15
|
from rich.progress import SpinnerColumn
|
|
15
16
|
from rich.progress import TextColumn
|
|
@@ -26,6 +27,13 @@ def clean_project_name(val: str) -> str:
|
|
|
26
27
|
return val.strip().replace(" ", "_").replace("-", "_")
|
|
27
28
|
|
|
28
29
|
|
|
30
|
+
def get_username() -> str:
|
|
31
|
+
try:
|
|
32
|
+
return os.getlogin()
|
|
33
|
+
except OSError:
|
|
34
|
+
return "tobi"
|
|
35
|
+
|
|
36
|
+
|
|
29
37
|
def get_pyproject_file() -> Path:
|
|
30
38
|
pyproject_path = Path("pyproject.toml")
|
|
31
39
|
if pyproject_path.exists():
|
|
@@ -92,7 +100,7 @@ def is_new_falco_cli_available() -> bool:
|
|
|
92
100
|
"Checking for new falco version...",
|
|
93
101
|
) as response:
|
|
94
102
|
latest_version = response.json()["info"]["version"]
|
|
95
|
-
current_version =
|
|
103
|
+
current_version = falco_cli_version
|
|
96
104
|
return latest_version != current_version
|
|
97
105
|
except cappa.Exit:
|
|
98
106
|
return False
|
|
@@ -4,7 +4,7 @@ from pathlib import Path
|
|
|
4
4
|
import cappa
|
|
5
5
|
import pytest
|
|
6
6
|
from cappa.testing import CommandRunner
|
|
7
|
-
from
|
|
7
|
+
from falco_cli.config import write_falco_config
|
|
8
8
|
|
|
9
9
|
views_functions = ["post_list", "post_detail", "post_update", "post_create"]
|
|
10
10
|
html_templates = [
|
|
@@ -3,9 +3,9 @@ from unittest.mock import patch
|
|
|
3
3
|
|
|
4
4
|
import pytest
|
|
5
5
|
from cappa.testing import CommandRunner
|
|
6
|
-
from
|
|
7
|
-
from
|
|
8
|
-
from
|
|
6
|
+
from falco_cli.commands.htmx import Htmx
|
|
7
|
+
from falco_cli.config import read_falco_config
|
|
8
|
+
from falco_cli.config import write_falco_config
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
@pytest.fixture(autouse=True)
|
|
@@ -13,7 +13,7 @@ def mock_latest_tag_getter():
|
|
|
13
13
|
def _get_latest_tag():
|
|
14
14
|
return "1.9.10"
|
|
15
15
|
|
|
16
|
-
with patch("
|
|
16
|
+
with patch("falco_cli.commands.htmx.get_latest_tag", new=_get_latest_tag):
|
|
17
17
|
yield
|
|
18
18
|
|
|
19
19
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import pytest
|
|
2
|
-
from
|
|
3
|
-
from
|
|
4
|
-
from
|
|
5
|
-
from
|
|
2
|
+
from falco_cli.commands.work import default_address
|
|
3
|
+
from falco_cli.commands.work import default_server_cmd
|
|
4
|
+
from falco_cli.commands.work import Work
|
|
5
|
+
from falco_cli.config import write_falco_config
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
def test_env_resolution(tmp_path):
|
|
@@ -27,7 +27,10 @@ def test_with_pyproject_file(pyproject_toml):
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
def test_override_server(pyproject_toml):
|
|
30
|
-
work = {
|
|
30
|
+
work = {
|
|
31
|
+
"server": "python manage.py runserver",
|
|
32
|
+
"qcluster": "python manage.py qcluster",
|
|
33
|
+
}
|
|
31
34
|
write_falco_config(pyproject_path=pyproject_toml, work=work)
|
|
32
35
|
assert Work().get_commands() == work
|
|
33
36
|
|
|
@@ -7,7 +7,7 @@ from unittest.mock import patch
|
|
|
7
7
|
|
|
8
8
|
import pytest
|
|
9
9
|
from cappa.testing import CommandRunner
|
|
10
|
-
from
|
|
10
|
+
from falco_cli.__main__ import FalcoCLI
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
@pytest.fixture(autouse=True)
|
|
@@ -17,7 +17,7 @@ def change_test_dir(monkeypatch, tmp_path):
|
|
|
17
17
|
|
|
18
18
|
@pytest.fixture
|
|
19
19
|
def runner():
|
|
20
|
-
return CommandRunner(
|
|
20
|
+
return CommandRunner(FalcoCLI)
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
toolbox = Path(__file__).parent.parent / "packages" / "toolbox/src/falco_toolbox"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|