Skip to content
/ effectual Public template

Easily hackable and configurable python module bundler

License

Notifications You must be signed in to change notification settings

jakewdr/effectual

Repository files navigation

effectual

/ɪˈfek.tʃu.əl/ meaning effective and successful

Why?

Sometimes you want a single portable python file without having to make a platform specific executable or .pyz file! Basically me trying to make Vite for python (badly)

When not to use this

  • The python package requires access to specific files like CustomTkinter and Pillow
  • Incredibly version specific code, for example something that won't run on a slightly different python version or operating system

Setup

Python

Firstly you will need to install a version of Python alongside pip, this project was originally built with Python 3.11.x but supports pretty much any python3 version pipenv does, the version the project uses can be changed from the Pipfile, make sure to change the ruff settings to the output version as well!

Taskfile

Secondly Task is used to run multiple commands together, check the website for the best way to install with your operating system!

Downloading the template

This can be done by pressing the green 'use this template button' on GitHub or running:

git clone https://github.com/jakewdr/effectual <outputDirectory>

Pipenv and installing packages

To install Pipenv simply run (you made need to add the folder to PATH in windows):

pip install --user pipenv

Then navigate to your template folder and enter the following into the command line:

task setup

This will install all development dependencies into a virtual environment allowing the following commands to work

Running the project

In development

To run the source in development mode you can use:

task dev

This will create a bundle in cache and update and rerun every time the source files are changed (if you keep the terminal running), note this will use the dependencies in the virtual env and not effectual's own system

This is like what esBuild does for vite

For production

To bundle the source files and run the output:

task run

This will lint/format the source files, install external dependencies and then bundle the project and any (non development) dependencies specified in the Pipfile.

This is like what what Rollup does for vite

Building

To build an output bundle and not run it simply enter:

task build

To be added

  • Treeshaking
  • Docker integration
  • More config granularity
  • Adding a plugin and loader system
  • Make the Taskfile and bundle more platform agnostic

Contributions

All contributions are welcome, I'm not the best in the world at project management but if you think you can add or improve anything please send over a pull request