Skip to main content

A quick and easy way to distribute your Python projects!

Project description


sailboat
GitHub Repo stars Twitter
GitHub commit activity GitHub Release Date GitHub Workflow Status GitHub code size in bytes GitHub release (latest SemVer including pre-releases) GitHub PyPI - Downloads

View Documentation Site

About

Sailboat is a Python developer's best friend. It's a Python build tool that can do anything you need it to! It suports a countless number of plugins — you can even make your own. Sailboat is made for anyone, whether you are a beginner on your very first project, or a senior software engineer with years of experience.

Let's say that that you have created a basic game, Guess My Number, and you want to send it to all of your friends. There are a lot of different ways you can do this, but using Sailboat is the easiest. All you have to do is type three commands: sail quickstart, sail build, and sail release, and you can have a Homebrew file, a pip installable package, and a PyInstaller desktop app. So easy!

Sailboat also supports custom subcommands. These don't build your project, but they can add features such as a todo list that help speed up your development process.

Installation

Pip:

pip3 install sailboat

Binary:

Download from latest release.

Homebrew:

brew install cole-wilson/taps/Sailboat

Build From Source:

git clone https://github.com/cole-wilson/sailboat
cd sailboat
python3 setup.py install

Usage:

Sailboat is intended to be used from the command line/terminal.

It is suggested to run sail quickstart to get started. Then, use sail build to build your project, and sail release to release it! Be sure to to look at the subcommand docs for more detail. (look in table below)

There are two base commands that can be used: sail and sailboat. These both do exactly the same thing, there is no difference. sail will be used in the documentation, as it's shorter easier to type, but you can do whatever.

To get a list of the availible subcommands type sail help. To refresh the plugin list, type sail -r.

There are countless subcommands, but these are the core ones:

subcommand description
add Add a plugin to your project.
build Build your project for release.
dev Run your project without building it.
git Manage git for your project.
github Manage git for your project.
plugins Plugin manager.
quickstart Get your project up and running.
release Release your project.
remove Remove a plugin from you project.
wizard Configure you project or a plugin.
workflow Generate a GitHub actions workflow file.
help Display this message.

Plugins:

Sailboat uses a plugin based architecture. Every single command or subcommand is a plugin, even the core features. Plugins are registered using the Python entry points system, using the group name sailboat_plugins. There are four types of plugins:

core

This type of plugin is reserved for 1st party plugins - plugins that are part of the actual Sailboat source. They have unreserved access to all project data, and therefore this type should not be used in custom plugins.

command

command plugins are most basic form of a plugin. They are called by typing sail <name of plugin>. They are standalone python scripts that add to the project, like a task list manager.

build

This is perhaps the most common type of plugin, they are run with the build core plugin, and are used to generate or edit project files. An example would be the PyInstaller plugin, which generates frozen binaries of the project. These should store output in the top level dist folder, in a subfolder with the name of the project. For example: the PyInstaller plugin saves output in ./dist/pyinstaller. Build plugins can also contain release plugins within them.

release

This group of plugins is used by the release core plugin. They are used to distribute files. For example: the homebrew release plugin uploads the Homebrew formula to a GitHub repo.

All plugins should be a subclass of sailboat.plugins.Plugin, a basic class that provide the neccesary functions and registration features. An example command plugin might look like this:

from sailboat.plugins import Plugin

class Echo(Plugin):
	description = "A basic command plugin that echos it's input."
	_type = 'command'
	setup = {"string_to_echo":"What string should I echo? "}  # Used by wizard

	def run(self):
		string = self.getData('string_to_echo')  # Get string to echo.
		print(string)
		return

Plugins store their data in the sailboat.toml file, under their type namespace. For example, the above example will store it's data like so:

...
[command.echo]
string_to_echo = "Testing..."
...

A plugin should NEVER edit the sailboat.toml file on it's own. Instead plugins should use the provided functions OR edit self.data, a dictionary of the file. Only data stored in the plugins namespace will be preserved. However, a plugin can read from the top level data.

Plugins can get very complex, and therefore useful, but it is too long to put here. Please look at the sailboat.colewilson.xyz/plugins.html file for details.

Acknowledgements:

Thanks to all the people at PyInstaller, dmgbuild, twine, and GitHub actions who provided ways for me to create this.

Stargazers

Stargazers repo roster for @cole-wilson/sailboat

Contributors

  • Cole Wilson

Contact

Please submit an issue if you have any questions or need help or find a bug. I'm happy to help!

cole@colewilson.xyz

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sailboat-0.26.2.tar.gz (33.8 kB view details)

Uploaded Source

Built Distribution

sailboat-0.26.2-py3-none-any.whl (36.4 kB view details)

Uploaded Python 3

File details

Details for the file sailboat-0.26.2.tar.gz.

File metadata

  • Download URL: sailboat-0.26.2.tar.gz
  • Upload date:
  • Size: 33.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.8.0 tqdm/4.60.0 CPython/3.8.9

File hashes

Hashes for sailboat-0.26.2.tar.gz
Algorithm Hash digest
SHA256 c4673fedfbb3d526599fb602988c82f67c8357cb821e686fd7906831b175637f
MD5 2b93df34aea6e38b65209b6e610d05c0
BLAKE2b-256 3aae08650d566196de2d8c80ba7657692d8ba77bc27665ea98d34f48a2e26675

See more details on using hashes here.

File details

Details for the file sailboat-0.26.2-py3-none-any.whl.

File metadata

  • Download URL: sailboat-0.26.2-py3-none-any.whl
  • Upload date:
  • Size: 36.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.8.0 tqdm/4.60.0 CPython/3.8.9

File hashes

Hashes for sailboat-0.26.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2b2c73753ff00890c390ee1f8091b67577f993dccfc3cf668be6f2d690d25b49
MD5 b58ac6f5f9a3de39d51b8e681dd844b4
BLAKE2b-256 2d801319957ea91e73f4d5d7a48da1b5072e256cbf3bd425bd8076c089fdaf4b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page