Skip to main content

iMake

Tests Python Versions Python Whell PyPI PyPI - Implementation Isort Mypy Code style: Black PyPI - Downloads GitHub license


Built with ❤︎ by: William Canin in free time, to the sound of the playlist: Bursting Of The Tympanum


iMake is a command line tool to simplify commands in Python projects, discarding the usability of a Makefile file. As iMake saves on typed commands, passing them a configuration file.

Requirements

To work correctly, you will first need:

  • Python (v3.9 or recent);
  • Pip (v21.0.1 or recent) must be installed;

Installing

$ pip install imake --user

Configuration

The configuration file must exist at the location where imake will be called. The file must be named .imake, that is, a file hidden on Unix systems.

To create the file use command:

imake init

After creating the file, you should leave it with the following structure. Example:

[build]
commands = ["python setup.py sdist"]

The key with the name commands is an Array and must be mandatory for iMake. In this key you must inform the commands you want to execute using the primary key, in this case, the build.

Option with multiple commands:

[build]
commands = ["rm -rf build", "rm -rf docs/_build;", "python setup.py sdist"]

You can also execute commands in blocks instead of a list, as follows using triple quotes:

[clean]
commands = ["""
            if [[ -d "build" ]]; then
              rm -r build;
            fi
            rm -rf docs/_build;
            rm -rf .pytest_cache;
"""]

iMake settings still have 3 other keys, which are description, initial_message, and final_message. All optional.

The key description you must put only a description for a given command. Example:

[build]
description = "This command compiles the project."
commands = ["rm -rf build", "rm -rf docs/_build;", "python setup.py sdist"]

The initial_message key is a message that will appear before the commands start. Example:

[build]
description = "This command compiles the project."
initial_message = "Starting the build ..."
commands = ["rm -rf build", "rm -rf docs/_build;", "python setup.py sdist"]

The final_message key is a message that will appear after the commands are finished. Example:

[build]
description = "This command compiles the project."
initial_message = "Starting the build ..."
commands = ["rm -rf build", "rm -rf docs/_build;", "python setup.py sdist"]
final_message = "Build command finished!"

Note: The position of the keys does not imply anything, but the values do. The command that you put first in the commands key will be the first to be executed.

Another interesting option is that you can call the execution of a command within another one using imake. Would be like this:

[build]
description = "This command compiles the project."
initial_message = "Starting the build ..."
commands = ["imake clean -q", "python setup.py sdist"]
final_message = "Build command finished!"

Notice that the command imake clean -q is inside commands. Where the -q option means to silence verbose mode.

Using

After making the settings in the file .imake, execute the command imake followed by the primary key, which in our example is build. It will look like this:

$ imake build

You can run the help command, imake -h to show which commands are available to you. Any configuration that is in the .imake file will be shown in help, minus the description of each command, which will be shown only if you run the --desc or -d option, for example:

$ imake build --desc

More Commands

For more command information, use:

$ imake -h

Donation

Click on the image below to be redirected the donation forms:

License

The project is available as open source under the terms of the MIT License ©

Credits

See, AUTHORS.

Metadata

Release files for imake 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for imake 0.3.1
File Size Uploaded
imake-0.3.1.tar.gz 6.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for imake 0.3.1
File Interpreter ABI Platform
imake-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 14.1 kB

Release files / imake-0.3.1.tar.gz

Download URL imake-0.3.1.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b7c92cf8055c7c9568dc6169f6f13a6e887738e15aa52caa47908d785df919d3
BLAKE2b-256 checksum
How to use checksums
8a01b70ec8ae648a61363eb6ae7e9ca44dcbf1ad02570054d03f6e82c74ec433
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.14 CPython/3.10.5 Linux/5.15.54-1-lts

Release files / imake-0.3.1-py3-none-any.whl

Download URL imake-0.3.1-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f75444fae1e72c9421fa73dc5ebe799c0288d319a8455340722e184ea9bedd1a
BLAKE2b-256 checksum
How to use checksums
0951126c3741084f29dbe0d72fecf9009d94e96e651d2ba18869088718b50abc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.14 CPython/3.10.5 Linux/5.15.54-1-lts

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page