Skip to content

Latest commit

 

History

History
94 lines (53 loc) · 2.49 KB

README.md

File metadata and controls

94 lines (53 loc) · 2.49 KB

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 a dependency-less .pyz! 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

First make sure you have uv installed and updated:

uv self update

Furthermore if you haven't already created a project run:

uv init

Then to install effectual run:

uv add effectual --dev

Finally add the following lines to your pyproject.toml and configure to your hearts desire

[tool.effectual]

sourceDirectory = "./src/"
outputDirectory =  "./dist/"
outputFileName = "bundle.pyz"
minification = true
compressionLevel = 5

Note you must have a __main__.py entrypoint for this to work

Template

If you want a simple minimal setup process then just use the effectual-template

Bundling

Development

To bundle in dev mode use:

uv run efec dev

This is like what esBuild does for vite

Production

To build a distributable .pyz file run:

uv run efec dist

This is like what what Rollup does for vite

To be added

  • Treeshaking
  • Rewriting some time critical parts in Rust 🚀🦀
  • Cross platform compatibility (multiple output bundles)
  • Bundle python version shebang and bytecode compilation
  • Plugin and loader system (like rollup and webpack)

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

Building the project from source

Requirements

To build the project from source you need two tools:

  1. uv
  2. TaskFile

Process

  1. CD to your effectual directory and run:

     task setup
    
  2. Then to build an distributable tar.gz and wheel:

     task build