dbcli / mycli

A Terminal Client for MySQL with AutoCompletion and Syntax Highlighting.
http://mycli.net
Other
11.42k stars 661 forks source link

Create a standalone binary build #950

Open gfrlv opened 3 years ago

gfrlv commented 3 years ago

There are several problems with our current deployment through pypi:

  1. It relies on the user's system having python3.6+. Those who are stuck with python 2 will also be stuck with an obsolete mycli version.
  2. It relies on the user's system for dependency management. It can lead to breakages in a lot of ways that we don't control: there may be conflicts with other python applications, or dependencies may be updated in ways that break mycli. Both have happened a lot of times.
  3. To address the problems in (2), we have to specify broad ranges of required versions of packages in our dependency list. But our CI always installs the newest versions, and so users may experience problems with older dependencies that we don't notice until they open an issue.

I propose to create standalone binary builds with PyOxidizer (like iredis does) and then possibly switch our main deployment strategy to just shipping these builds. PyPI packages will of course also remain available.

There are a couple of things to do in preparation:

  1. Refactor code so it no longer depends on __file__. Otherwise, we will need to ship additional text files alongside the binary, which defies the purpose of the trivial deployment.
  2. As binaries are platform-specific, we need to set up more OSes in CI. Github Actions now supports Windows and Mac OS instances, so it should be straightforward to cover the most common architectures. I don't know if we should care about weirder ones.