Skip to content

Releases: CheeseCake87/pyqwe

2.1.1

25 Nov 08:26
Compare
Choose a tag to compare
  • bug fix - default value of __env_ignore__ set to False

2.1.0

24 Nov 21:44
Compare
Choose a tag to compare
  • Added pyqwe[dotenv] optional extra functionality into pyqwe
  • Added advanced settings to change how env vars are loaded

pyqwe not has 'settings keys'

[tool.pyqwe]
__env_ignore__ = false
__env_marker_start__ = "{{"
__env_marker_end__ = "}}"
__env_files__ = [".env.example"]

These can be used to configure how pyqwe reads, and deals with environment variables.

Here's the updated readme section:

Using environment variables

To use environment variables in the command, use the {{ }}
markers, these markers are the default but can be changed.

pyqwe will evaluate any environment variables that are set before running any commands.

If pyqwe detects an environment variable that is not set, it will raise an error. An error will
also be raised if environment variables are detected, and you do not have python-dotenv installed.

Here's an example of setting an environment variable in a command:

[tool.pyqwe]
talk = "*shell:echo {{MESSAGE}}"

You can change the environment variable markers by changing the __env_marker_start__ and __env_marker_end__ settings
keys.

[tool.pyqwe]
__env_marker_start__ = "*"
__env_marker_end__ = "*"
talk = "*shell:echo *MESSAGE*"

pyqwe uses load_dotenv() from python-dotenv to load the .env file. You can change the name of the file to load, or
add multiple env files by setting the __env_files__ settings key.

[tool.pyqwe]
__env_files__ = [".env", ".env.local"]
talk = "*shell:echo *MESSAGE*"

This is the same as running load_dotenv(".env") and load_dotenv(".env.local").

If you want to disable pyqwe from doing anything with environment variables, you can set the __env_ignore__ settings
key to true.

[tool.pyqwe]
__env_ignore__ = true
talk = "*shell:echo {{MESSAGE}}"

This will disable the environment variable evaluation and loading of the .env file, and result in {{MESSAGE}} being
printed to the console in this case.

2.0.0

24 Nov 17:20
Compare
Choose a tag to compare
  • Fixed CLI coloring in menus
  • Added new group runner mode @step
[tool.pyqwe]
group = [
    "@step",
    "*:echo 'Hello, World! 1'",
    "*:echo 'Hello, World! 2'",
    "*:echo 'Hello, World! 3'"
]

results in:

🟢🏎💨🛑🏎 Starting runners in STEP (ctrl + c to abort)

🚥|🏎️ About to start runner:
*:echo 'Hello, World! 1'
Continue? [Y/n]: y
🏎💨 Starting runner
Hello, World! 1
🏁🏎 Runner done

🚥|🏎️ About to start runner:
*:echo 'Hello, World! 2'
Continue? [Y/n]: n
🚧🏎 Runner skipped

🚥|🏎️ About to start runner:
*:echo 'Hello, World! 3'
Continue? [Y/n]: 

1.9.0

21 Nov 21:13
Compare
Choose a tag to compare

You can now specify how grouped runners should run, either in sequence or parallel.

This will run the commands in the group in sequence, one after the other:

group = [
    "@sync",
    "*:echo 'Hello, World! 1'",
    "*:echo 'Hello, World! 2'",
    "*:echo 'Hello, World! 3'"
]

This will run the commands in the group in parallel:

group = [
    "@async",
    "*:echo 'Hello, World! 1'",
    "*:echo 'Hello, World! 2'",
    "*:echo 'Hello, World! 3'"
]

Of course, you can leave out the @sync or @async to use the default async mode.

1.8.0

07 Sep 08:58
Compare
Choose a tag to compare

Commands can be grouped and run as one using threading.

[tool.pyqwe]
group = [
    "flask_example.module:run",
    "*:gunicorn flask_example.package:create_app()",
    "*:flask --app flask_example/package run --port 5003"
]

Running pyqwe group results in:

🏎💨🏎💨🏎💨 Starting runners
[2024-09-07 09:55:00 +0100] [35190] [INFO] Starting gunicorn 23.0.0
[2024-09-07 09:55:00 +0100] [35190] [INFO] Listening at: http://127.0.0.1:8000 (35190)
[2024-09-07 09:55:00 +0100] [35190] [INFO] Using worker: sync
[2024-09-07 09:55:00 +0100] [35191] [INFO] Booting worker with pid: 35191
 * Serving Flask app 'flask_example.module'
 * Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on http://127.0.0.1:5000
Press CTRL+C to quit
 * Serving Flask app 'flask_example/package'
 * Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on http://127.0.0.1:5003
Press CTRL+C to quit

Pressing ctrl + c will stop all runners as one.

^C 🏁🏎🏎🏎 Runners stopped
[2024-09-07 09:56:35 +0100] [35190] [INFO] Handling signal: int
[2024-09-07 09:56:35 +0100] [35191] [INFO] Worker exiting (pid: 35191)
[2024-09-07 09:56:35 +0100] [35190] [INFO] Shutting down: Master

This tool is intended only to be used in a development environment, say if you want to run Flask + Vite, or Flask + Tailwindcss in one process.

1.7.1

30 Aug 09:42
Compare
Choose a tag to compare

update pyproject description

1.7.0

30 Aug 09:33
Compare
Choose a tag to compare

Now able to load command from a pyqwe.toml file.

This is to allow for the situation that you might want to move the commands out of the pyproject.toml file. Or you might not want to use the pyproject name, in that it might not be a pyproject.

1.6.2

30 Aug 08:49
Compare
Choose a tag to compare

GitHub workflow release