gravitybee


Namegravitybee JSON
Version 0.4.6 PyPI version JSON
download
home_pagehttps://github.com/plus3it/gravitybee
SummaryGenerate standalone python applications.
upload_time2022-12-07 16:44:20
maintainer
docs_urlNone
authorYakDriver
requires_python
licenseApache Software License 2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            ==========
GravityBee
==========

.. image:: https://img.shields.io/github/license/plus3it/gravitybee.svg
    :target: ./LICENSE
    :alt: License
.. image:: https://travis-ci.org/plus3it/gravitybee.svg?branch=master
    :target: http://travis-ci.org/plus3it/gravitybee
    :alt: Build Status
.. image:: https://img.shields.io/pypi/pyversions/gravitybee.svg
    :target: https://pypi.python.org/pypi/gravitybee
    :alt: Python Version Compatibility
.. image:: https://img.shields.io/pypi/v/gravitybee.svg
    :target: https://pypi.python.org/pypi/gravitybee
    :alt: Version
.. image:: https://pullreminders.com/badge.svg
    :target: https://pullreminders.com?ref=badge
    :alt: Pull Reminder

GravityBee helps you generate standalone applications for Windows,
Mac, and Linux from your Python applications.

GravityBee is targeted at Python
programs that are already packaged in the standard setuptools
way.

These are some benefits of a GravityBee standalone application:

* You end up with one file that contains everything.
* Your users do not need Python or any packages installed.
* You build separate natively executable applications for each of
  your target platforms.

GravityBee depends on `Pyppyn <https://github.com/plus3it/pyppyn>`_ and
`PyInstaller <http://www.pyinstaller.org>`_ and is subject to their limitations.

To Build A Standalone Application
=================================

Step 1 - Install
----------------

You must install the application you wish to build (e.g.,
``yoursuperapp``), as well as GravityBee.

.. code-block:: bash

    $ pip install yoursuperapp gravitybee

The process will also work fine if you're installing from a local
version of your app.

.. code-block:: bash

    $ cd yoursuperapp
    $ ls setup*
    setup.cfg            setup.py
    $ pip install --editable .
    $ pip install gravitybee

Step 2 - Provide (or gather) information
----------------------------------------

GravityBee will assume all necessary information when run. However,
you may wish to override the assumed
values. You can provide values either through environment variables
or command line flags. If both are
provided, command line flags take precedence.

Local logging can be configured in ``gravitybee/logging.conf``.

Options:

======================= ======================  ==========================================
ENV VAR                 CL Options              Desciption
======================= ======================  ==========================================
GB_APP_NAME             --app-name, -a          The name that will appear as part of the
                                                final standalone application name.
                                                *Default:* ``name`` *from setup.py and/or
                                                setup.cfg.*
GB_PKG_NAME             --pkg-name, -n          The package name for the application you are
                                                building.
                                                *Default: First value in* ``packages`` *from
                                                setup.py and/or setup.cfg,
                                                or if not found, the value from --app-name.*
GB_SCRIPT               --script, -s            The path to the application file installed by
                                                ``pip`` when you installed
                                                your application. Depending on your
                                                configuration, this may be determined by
                                                ``options.entry_points.console_scripts`` from
                                                ``setup.py`` and/or ``setup.cfg``.
                                                *Default:* ``$VIRTUAL_ENV/bin/app_name``
GB_SRC_DIR              --src-dir, -d           The relative path of the package containing
                                                your application.
                                                *Default:* ``.``
GB_PKG_DIR              --pkg-dir, -p           The relative or absolute path of the package
                                                containing your application.
                                                This directory must contain a
                                                ``setup.py`` file.
                                                *Default:* ``.``
GB_EXTRA_DATA           --extra-data, -e        Relative to package directory, any extra
                                                directories or files that need
                                                to be included, that wouldn't normally
                                                be included as Python code. Can be
                                                used multiple times.
                                                *Default: None*
GB_WORK_DIR             --work-dir, -w          Directory for use by GravityBee to build
                                                application. Cannot be an existing
                                                directory as it will be deleted if the
                                                clean voption is used.
                                                *Default:* ``.gravitybee/build/<uuid>``
GB_ONEDIR               --onedir                Instead of packaging into one file,
                                                package in one directory. This option
                                                is not compatible with producing a SHA
                                                hash since a hash is produced on a
                                                single file. This option may be useful
                                                for debugging runtimes errors in built
                                                applications.
                                                *Default: Not*
GB_CLEAN                --clean, -c             Flag indicating whether to
                                                clean up the work directory
                                                after the build.
                                                *Default: Not*
GB_NAME_FORMAT          --name-format, -f       Format to be used in naming the standalone
                                                application. Can include
                                                {an}, {v}, {os}, {m}
                                                for app name, version, os, and machine
                                                type respectively. On Windows, ``.exe``
                                                will be added automatidally.
                                                *Default:* ``{an}-{v}-standalone-{os}-{m}``
GB_SHA_FORMAT           --sha-format            Format to be used in naming the SHA hash
                                                file. Can include
                                                {an}, {v}, {os}, {m}
                                                for app name, version, os, and machine
                                                type respectively.
                                                *Default:* ``{an}-{v}-sha256-{os}-{m}.json``
GB_LABEL_FORMAT         --label-format          Format to be used in labeling the standalone
                                                application in ``gravitybee-files.json``.
                                                Can include {An},
                                                {an}, {v}, {os}, {m}, and {ft}
                                                for capitalized application
                                                name, lowercase app name, version, OS,
                                                machine, and file type ("Standalone
                                                Executable" or
                                                "Standalone Executable SHA256 Hash")
                                                respectively. On Windows, ``.exe``
                                                will be added automatically.
                                                *Default:* ``{An} {v} {ft} for {os} [GravityBee Build]``
GB_NO_FILE              --no-file               Flag indicating to not write
                                                the output files (see below).
                                                If the ``--sha`` option is used to
                                                write a hash to a file, that file will
                                                still be written regardless.
                                                *Default: Will write files*
GB_SHA                  --sha                   Option of where to put SHA256
                                                hash for generated file.
                                                Valid options are ``file``
                                                (create a separate file with
                                                hash), or ``info`` (only
                                                include the hash in the file
                                                info output). *Default:* ``info``
GB_STAGING_DIR          --staging-dir           Option to indicate where GravityBee
                                                should stage build artifacts
                                                (standalone executable and hash
                                                file). Two subdirectories can
                                                be created, one based on version
                                                and the other called "latest."
                                                *Default:* ``.gravitybee/dist``
GB_WITH_LATEST          --with-latest           Flag to indicate if GravityBee
                                                should create a "latest"
                                                directory in the staging area
                                                with a copy of the artifacts.
                                                *Default: Not*
GB_INCLUDE_SETUP_EXTRAS --include-setup-extras  Includes any 'extras' modules listed in
                                                setup.py/cfg standalone application. (Such as
                                                packages marked 'build', 'docs', 'check', etc.)
                                                *Default: False*
GB_EXTRA_MODULES        --extra-modules         Any extra modules to be included with
                                                the standalone executable.
                                                *Default: None*
GB_EXTRA_PKGS           --extra-pkgs            Any extra packages to be included with
                                                the standalone executable.
                                                *Default: None*
VIRTUAL_ENV                                     If using conda env set VIRTUAL_ENV to
                                                conda env directory
======================= ======================  ==========================================

If you are using environment variables, you could set them up like
this.

.. code-block:: bash

    $ export GB_APP_NAME=coolapp
    $ export GB_PKG_NAME=coolapp
    $ export GB_SCRIPT=/usr/var/python/etc/coolapp


Step 3 - Generate
-----------------

Creating the standalone application is easy now.

.. code-block:: bash

    $ gravitybee

If you are not using environment variables, you can combine steps 2 and 3.

.. code-block:: bash

    $ gravitybee --app-name coolapp --script /usr/var/python/etc/coolapp --pkg-dir coolapp

Output Files
------------

If the ``--no-file`` flag is not used, GravityBee will create output
files. These include:

* **gravitybee-files.json**: A JSON file that contains information
  about the standalone application generated by GravityBee including
  ``filename``, ``path``, ``mime-type``, and ``label`` as a list of
  dicts.
* **gravitybee-info.json**: A JSON file that contains information
  extracted
  about the application including ``app_name``, ``app_version``,
  ``console_script``,
  ``script_path``, ``pkg_dir``, ``src_dir``, ``name_format``,
  ``clean``, ``work_dir``,
  ``gen_file``, ``gen_file_w_path``, and ``extra_data``.
* **gravitybee-environs.sh**: A shell file that can be sourced on
  POSIX platforms
  to create environment variables with GravityBee information. Each
  is prefixed
  with ``GB_ENV_``.
* **gravitybee-environs.bat**: A batch file that can be used to
  create environment variables with GravityBee information on
  Windows. Each
  environ is prefixed with ``GB_ENV_``.


The Test Example
----------------

Here is the file/package structure of the included
`test application <https://github.com/plus3it/gravitybee/tree/dev/tests/gbtestapp>`_.

.. code-block:: bash

    gbtestapp
    |-- setup.py
    |-- setup.cfg
    >-- src
    |   >-- gbtestapp
    |       |-- __init__.py
    |       |-- cli.py
    |       >-- gbextradata
    |           |-- __init__.py
    |           |-- data_file.txt

You would build the application as follows. Since the application
package is under the ``src`` directory, you need to let GravityBee
know. Also, since we need to include the ``data_file.txt`` file,
we'll use the ``--extradata`` option to include the containing
directory (``gbextradata``).

.. code-block:: bash

    $ cd gbtestapp
    $ gravitybee --src-dir src --extra-data gbextradata --clean


From Python Example
-------------------

Using GravityBee from a Python script is also possible. Using the
sample test app, here's some example code.

.. code-block:: python

    import gravitybee

    args = gravitybee.Arguments(
        src_dir="src",
        extra_data=["gbextradata"],
        pkg_dir=os.path.join("tests", "gbtestapp"),
        clean=True
    )

    pg = gravitybee.PackageGenerator(args)
    pg.generate()

    # show path (and name) of standalone app
    print("The standalone app: ", pg.gen_file_w_path)


Attribution
===========

The idea for GravityBee's core functionality comes from `Nicholas Chammas <https://github.com/nchammas>`_
and his project `flintrock <https://github.com/nchammas/flintrock>`_. Huge thanks to Nicholas!


Contribute
==========

GravityBee is hosted on `GitHub <http://github.com/plus3it/gravitybee>`_ and is an open source project that welcomes contributions of all kinds from the community.

For more information about contributing, see `the contributor guidelines <https://github.com/plus3it/gravitybee/CONTRIBUTING.rst>`_.



CHANGE LOG
==========

0.3.0 - 2022.04.21
-------------------
* [DEPRECATION] Deprecates Python 3.6 support.

0.2.0 - 2021.08.02
-------------------
* [FEATURE] Add option --hook-template that allows user to specify their own hook
  template for PyInstaller.
* [FIX] Update the included hook-template to work correctly when the pkg_name and
  app_name are different.

0.1.29 - 2020.01.15
-------------------
* [ENHANCEMENT] Remove pipenv files and update setup.cfg dependency versions.

0.1.28 - 2020.01.14
-------------------
* [ENHANCEMENT] Bump version to include updated dependencies.

0.1.27 - 2019.05.06
-------------------
* [ENHANCEMENT] Bump version to include updated dependencies.

0.1.26 - 2019.02.05
-------------------
* [ENHANCEMENT] Fix distutils issue, improve error handling, update versions.

0.1.25 - 2019.01.31
-------------------
* [ENHANCEMENT] Add distutils to builds.

0.1.24 - 2019.01.29
-------------------
* [ENHANCEMENT] Clean up code, add community docs.
* [ENHANCEMENT] Transfer to Plus3IT.

0.1.23 - 2019.01.24
-------------------
* [FIX] Properly pin Pip so all dependencies are installed with pinned
  Pip version.
* [ENHANCEMENT] Restructure Travis CI linting, testing, deploying so
  deploy only happens when other stages complete successfully.
* [ENHANCEMENT] Improve speed of MacOS builds significantly.

0.1.22 - 2019.01.22
-------------------
* [ENHANCEMENT] Pin Pip and Pytest versions, adding ``requirements.txt``.

0.1.21 - 2019.01.10
-------------------
* [ENHANCEMENT] Lint code to conform with pylint and flake8 and add them
  Travis-CI tests.
* [ENHANCEMENT] Use ``pipenv`` and a lock file for dependency management.
* [ENHANCEMENT] Adjust for compatibility with Python 3.7.

0.1.20 - 2018.08.08
-------------------
* [ENHANCEMENT] Add ``--label-format`` option so that users can customize
  the label displayed for their applications in `gravitybee-files.json`.

0.1.19 - 2018.07.11
-------------------
* [ENHANCEMENT] Add ``--extra-pkgs`` and ``--extra-modules`` options for
  including additional packages and modules with standalone executables.

0.1.18 - 2018.07.05
-------------------
* [ENHANCEMENT] Add ``--onedir`` flag for improved debugging.

0.1.17 - 2018.06.27
-------------------
* [FIX] Compatibility issues with CentOS 6 resolved.

0.1.16 - 2018.06.21
-------------------
* [FIX] Compatibility issues with Windows resolved.

0.1.15 - 2018.06.06
-------------------
* [FIX] Losing ``.exe`` extension with Windows executables in the
  latest staging area.

0.1.14 - 2018.06.04
-------------------
* [FIX] ``--with-latest`` was not working as a CL flag.

0.1.13 - 2018.06.04
-------------------
* [ENHANCEMENT] Rearrange files created by GravityBee to all be
  contained in a ``.gravitybee`` subdirectory of the current
  directory.
* [ENHANCEMENT] Place the distribution artifacts in the staging
  directory, with a default value of ``.gravitybee/dist``.
* [ENHANCEMENT] Add option ``--staging-dir`` to specify directory
  where artifact staging should take place and export another
  environment variable ``GB_ENV_STAGING_DIR``.
* [ENHANCEMENT] Add option ``--with-latest`` to allow creation of
  a second artifact staging directory called "latest" containing
  the artifacts renamed with "latest" in the place of the version.
* [ENHANCEMENT] Add option ``--sha-format`` to allow custom naming
  of the SHA hash file.

0.1.12 - 2018.05.29
-------------------
* [ENHANCEMENT] Add OS and machine type to the SHA256 hash file (to
  avoid overwriting files if files from different platforms go to the
  same location).
* [ENHANCEMENT] Cleanup code with better variable names.

0.1.11 - 2018.05.24
-------------------
* [ENHANCEMENT] Create a SHA256 hash for the generated standalone
  file and include hash with file information and optionally in
  a separate file (using --sha flag).
* [ENHANCEMENT] Change names of environment variables produced
  with output scripts to be prefixed with GB_ENV so that the
  environs do not collide with environs consumed by GravityBee.
* [ENHANCEMENT] Provide a convenience cleanup Bash script to
  remove GravityBee output files (e.g., json and generated
  executables).
* [ENHANCEMENT] Cleanup code with more constants.

0.1.10 - 2018.05.21
-------------------
* [ENHANCEMENT] Provide two additional output files for importing
  GravityBee information into the environment on POSIX and Windows
  platforms.

0.1.9 - 2018.05.14
------------------
* [ENHANCEMENT] Output file with run info in json format for easy
  consumption by other tools.

0.1.8 - 2018.05.11
------------------
* [ENHANCEMENT] In non-verbose mode, allow for supressing stdout and
  stderr from pyinstaller, which can be sizeable.
* [ENHANCEMENT] Change name of ``gravitybee.file`` to
  ``gravitybee-files.json``.

0.1.7 - 2018.05.11
------------------
* [FIX] Fix exit code (was returning True).
* [ENHANCEMENT] Automatically find console script installed by
  setuptools on Windows and Linux and variety of places.

0.1.6 - 2018.05.03
------------------
* [ENHANCEMENT] Follow format prescribed by satsuki for output
  file (potential for multiple files).

0.1.5 - 2018.05.01
------------------
* [ENHANCEMENT] Add mime-type and label to .json formatted file
  information stored in gravitybee.file.

0.1.3 - 2018.05.01
------------------
* [ENHANCEMENT] Create gravitybee.file with name of standalone
  application.

0.1.2 - 2018.04.27
------------------
* [ENHANCEMENT] Provide standalone file and path.
* [FIX] Path bug.

0.1.1 - 2018.04.26
------------------
* [FIX] Many bug fixes.

0.1.0 - 2018.04.20
------------------
* Initial release!

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/plus3it/gravitybee",
    "name": "gravitybee",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "YakDriver",
    "author_email": "projects@plus3it.com",
    "download_url": "https://files.pythonhosted.org/packages/93/b5/532fde96c7bb792bed183bb1f3936058690929e7b309357dc24acfff8962/gravitybee-0.4.6.tar.gz",
    "platform": "Linux",
    "description": "==========\nGravityBee\n==========\n\n.. image:: https://img.shields.io/github/license/plus3it/gravitybee.svg\n    :target: ./LICENSE\n    :alt: License\n.. image:: https://travis-ci.org/plus3it/gravitybee.svg?branch=master\n    :target: http://travis-ci.org/plus3it/gravitybee\n    :alt: Build Status\n.. image:: https://img.shields.io/pypi/pyversions/gravitybee.svg\n    :target: https://pypi.python.org/pypi/gravitybee\n    :alt: Python Version Compatibility\n.. image:: https://img.shields.io/pypi/v/gravitybee.svg\n    :target: https://pypi.python.org/pypi/gravitybee\n    :alt: Version\n.. image:: https://pullreminders.com/badge.svg\n    :target: https://pullreminders.com?ref=badge\n    :alt: Pull Reminder\n\nGravityBee helps you generate standalone applications for Windows,\nMac, and Linux from your Python applications.\n\nGravityBee is targeted at Python\nprograms that are already packaged in the standard setuptools\nway.\n\nThese are some benefits of a GravityBee standalone application:\n\n* You end up with one file that contains everything.\n* Your users do not need Python or any packages installed.\n* You build separate natively executable applications for each of\n  your target platforms.\n\nGravityBee depends on `Pyppyn <https://github.com/plus3it/pyppyn>`_ and\n`PyInstaller <http://www.pyinstaller.org>`_ and is subject to their limitations.\n\nTo Build A Standalone Application\n=================================\n\nStep 1 - Install\n----------------\n\nYou must install the application you wish to build (e.g.,\n``yoursuperapp``), as well as GravityBee.\n\n.. code-block:: bash\n\n    $ pip install yoursuperapp gravitybee\n\nThe process will also work fine if you're installing from a local\nversion of your app.\n\n.. code-block:: bash\n\n    $ cd yoursuperapp\n    $ ls setup*\n    setup.cfg            setup.py\n    $ pip install --editable .\n    $ pip install gravitybee\n\nStep 2 - Provide (or gather) information\n----------------------------------------\n\nGravityBee will assume all necessary information when run. However,\nyou may wish to override the assumed\nvalues. You can provide values either through environment variables\nor command line flags. If both are\nprovided, command line flags take precedence.\n\nLocal logging can be configured in ``gravitybee/logging.conf``.\n\nOptions:\n\n======================= ======================  ==========================================\nENV VAR                 CL Options              Desciption\n======================= ======================  ==========================================\nGB_APP_NAME             --app-name, -a          The name that will appear as part of the\n                                                final standalone application name.\n                                                *Default:* ``name`` *from setup.py and/or\n                                                setup.cfg.*\nGB_PKG_NAME             --pkg-name, -n          The package name for the application you are\n                                                building.\n                                                *Default: First value in* ``packages`` *from\n                                                setup.py and/or setup.cfg,\n                                                or if not found, the value from --app-name.*\nGB_SCRIPT               --script, -s            The path to the application file installed by\n                                                ``pip`` when you installed\n                                                your application. Depending on your\n                                                configuration, this may be determined by\n                                                ``options.entry_points.console_scripts`` from\n                                                ``setup.py`` and/or ``setup.cfg``.\n                                                *Default:* ``$VIRTUAL_ENV/bin/app_name``\nGB_SRC_DIR              --src-dir, -d           The relative path of the package containing\n                                                your application.\n                                                *Default:* ``.``\nGB_PKG_DIR              --pkg-dir, -p           The relative or absolute path of the package\n                                                containing your application.\n                                                This directory must contain a\n                                                ``setup.py`` file.\n                                                *Default:* ``.``\nGB_EXTRA_DATA           --extra-data, -e        Relative to package directory, any extra\n                                                directories or files that need\n                                                to be included, that wouldn't normally\n                                                be included as Python code. Can be\n                                                used multiple times.\n                                                *Default: None*\nGB_WORK_DIR             --work-dir, -w          Directory for use by GravityBee to build\n                                                application. Cannot be an existing\n                                                directory as it will be deleted if the\n                                                clean voption is used.\n                                                *Default:* ``.gravitybee/build/<uuid>``\nGB_ONEDIR               --onedir                Instead of packaging into one file,\n                                                package in one directory. This option\n                                                is not compatible with producing a SHA\n                                                hash since a hash is produced on a\n                                                single file. This option may be useful\n                                                for debugging runtimes errors in built\n                                                applications.\n                                                *Default: Not*\nGB_CLEAN                --clean, -c             Flag indicating whether to\n                                                clean up the work directory\n                                                after the build.\n                                                *Default: Not*\nGB_NAME_FORMAT          --name-format, -f       Format to be used in naming the standalone\n                                                application. Can include\n                                                {an}, {v}, {os}, {m}\n                                                for app name, version, os, and machine\n                                                type respectively. On Windows, ``.exe``\n                                                will be added automatidally.\n                                                *Default:* ``{an}-{v}-standalone-{os}-{m}``\nGB_SHA_FORMAT           --sha-format            Format to be used in naming the SHA hash\n                                                file. Can include\n                                                {an}, {v}, {os}, {m}\n                                                for app name, version, os, and machine\n                                                type respectively.\n                                                *Default:* ``{an}-{v}-sha256-{os}-{m}.json``\nGB_LABEL_FORMAT         --label-format          Format to be used in labeling the standalone\n                                                application in ``gravitybee-files.json``.\n                                                Can include {An},\n                                                {an}, {v}, {os}, {m}, and {ft}\n                                                for capitalized application\n                                                name, lowercase app name, version, OS,\n                                                machine, and file type (\"Standalone\n                                                Executable\" or\n                                                \"Standalone Executable SHA256 Hash\")\n                                                respectively. On Windows, ``.exe``\n                                                will be added automatically.\n                                                *Default:* ``{An} {v} {ft} for {os} [GravityBee Build]``\nGB_NO_FILE              --no-file               Flag indicating to not write\n                                                the output files (see below).\n                                                If the ``--sha`` option is used to\n                                                write a hash to a file, that file will\n                                                still be written regardless.\n                                                *Default: Will write files*\nGB_SHA                  --sha                   Option of where to put SHA256\n                                                hash for generated file.\n                                                Valid options are ``file``\n                                                (create a separate file with\n                                                hash), or ``info`` (only\n                                                include the hash in the file\n                                                info output). *Default:* ``info``\nGB_STAGING_DIR          --staging-dir           Option to indicate where GravityBee\n                                                should stage build artifacts\n                                                (standalone executable and hash\n                                                file). Two subdirectories can\n                                                be created, one based on version\n                                                and the other called \"latest.\"\n                                                *Default:* ``.gravitybee/dist``\nGB_WITH_LATEST          --with-latest           Flag to indicate if GravityBee\n                                                should create a \"latest\"\n                                                directory in the staging area\n                                                with a copy of the artifacts.\n                                                *Default: Not*\nGB_INCLUDE_SETUP_EXTRAS --include-setup-extras  Includes any 'extras' modules listed in\n                                                setup.py/cfg standalone application. (Such as\n                                                packages marked 'build', 'docs', 'check', etc.)\n                                                *Default: False*\nGB_EXTRA_MODULES        --extra-modules         Any extra modules to be included with\n                                                the standalone executable.\n                                                *Default: None*\nGB_EXTRA_PKGS           --extra-pkgs            Any extra packages to be included with\n                                                the standalone executable.\n                                                *Default: None*\nVIRTUAL_ENV                                     If using conda env set VIRTUAL_ENV to\n                                                conda env directory\n======================= ======================  ==========================================\n\nIf you are using environment variables, you could set them up like\nthis.\n\n.. code-block:: bash\n\n    $ export GB_APP_NAME=coolapp\n    $ export GB_PKG_NAME=coolapp\n    $ export GB_SCRIPT=/usr/var/python/etc/coolapp\n\n\nStep 3 - Generate\n-----------------\n\nCreating the standalone application is easy now.\n\n.. code-block:: bash\n\n    $ gravitybee\n\nIf you are not using environment variables, you can combine steps 2 and 3.\n\n.. code-block:: bash\n\n    $ gravitybee --app-name coolapp --script /usr/var/python/etc/coolapp --pkg-dir coolapp\n\nOutput Files\n------------\n\nIf the ``--no-file`` flag is not used, GravityBee will create output\nfiles. These include:\n\n* **gravitybee-files.json**: A JSON file that contains information\n  about the standalone application generated by GravityBee including\n  ``filename``, ``path``, ``mime-type``, and ``label`` as a list of\n  dicts.\n* **gravitybee-info.json**: A JSON file that contains information\n  extracted\n  about the application including ``app_name``, ``app_version``,\n  ``console_script``,\n  ``script_path``, ``pkg_dir``, ``src_dir``, ``name_format``,\n  ``clean``, ``work_dir``,\n  ``gen_file``, ``gen_file_w_path``, and ``extra_data``.\n* **gravitybee-environs.sh**: A shell file that can be sourced on\n  POSIX platforms\n  to create environment variables with GravityBee information. Each\n  is prefixed\n  with ``GB_ENV_``.\n* **gravitybee-environs.bat**: A batch file that can be used to\n  create environment variables with GravityBee information on\n  Windows. Each\n  environ is prefixed with ``GB_ENV_``.\n\n\nThe Test Example\n----------------\n\nHere is the file/package structure of the included\n`test application <https://github.com/plus3it/gravitybee/tree/dev/tests/gbtestapp>`_.\n\n.. code-block:: bash\n\n    gbtestapp\n    |-- setup.py\n    |-- setup.cfg\n    >-- src\n    |   >-- gbtestapp\n    |       |-- __init__.py\n    |       |-- cli.py\n    |       >-- gbextradata\n    |           |-- __init__.py\n    |           |-- data_file.txt\n\nYou would build the application as follows. Since the application\npackage is under the ``src`` directory, you need to let GravityBee\nknow. Also, since we need to include the ``data_file.txt`` file,\nwe'll use the ``--extradata`` option to include the containing\ndirectory (``gbextradata``).\n\n.. code-block:: bash\n\n    $ cd gbtestapp\n    $ gravitybee --src-dir src --extra-data gbextradata --clean\n\n\nFrom Python Example\n-------------------\n\nUsing GravityBee from a Python script is also possible. Using the\nsample test app, here's some example code.\n\n.. code-block:: python\n\n    import gravitybee\n\n    args = gravitybee.Arguments(\n        src_dir=\"src\",\n        extra_data=[\"gbextradata\"],\n        pkg_dir=os.path.join(\"tests\", \"gbtestapp\"),\n        clean=True\n    )\n\n    pg = gravitybee.PackageGenerator(args)\n    pg.generate()\n\n    # show path (and name) of standalone app\n    print(\"The standalone app: \", pg.gen_file_w_path)\n\n\nAttribution\n===========\n\nThe idea for GravityBee's core functionality comes from `Nicholas Chammas <https://github.com/nchammas>`_\nand his project `flintrock <https://github.com/nchammas/flintrock>`_. Huge thanks to Nicholas!\n\n\nContribute\n==========\n\nGravityBee is hosted on `GitHub <http://github.com/plus3it/gravitybee>`_ and is an open source project that welcomes contributions of all kinds from the community.\n\nFor more information about contributing, see `the contributor guidelines <https://github.com/plus3it/gravitybee/CONTRIBUTING.rst>`_.\n\n\n\nCHANGE LOG\n==========\n\n0.3.0 - 2022.04.21\n-------------------\n* [DEPRECATION] Deprecates Python 3.6 support.\n\n0.2.0 - 2021.08.02\n-------------------\n* [FEATURE] Add option --hook-template that allows user to specify their own hook\n  template for PyInstaller.\n* [FIX] Update the included hook-template to work correctly when the pkg_name and\n  app_name are different.\n\n0.1.29 - 2020.01.15\n-------------------\n* [ENHANCEMENT] Remove pipenv files and update setup.cfg dependency versions.\n\n0.1.28 - 2020.01.14\n-------------------\n* [ENHANCEMENT] Bump version to include updated dependencies.\n\n0.1.27 - 2019.05.06\n-------------------\n* [ENHANCEMENT] Bump version to include updated dependencies.\n\n0.1.26 - 2019.02.05\n-------------------\n* [ENHANCEMENT] Fix distutils issue, improve error handling, update versions.\n\n0.1.25 - 2019.01.31\n-------------------\n* [ENHANCEMENT] Add distutils to builds.\n\n0.1.24 - 2019.01.29\n-------------------\n* [ENHANCEMENT] Clean up code, add community docs.\n* [ENHANCEMENT] Transfer to Plus3IT.\n\n0.1.23 - 2019.01.24\n-------------------\n* [FIX] Properly pin Pip so all dependencies are installed with pinned\n  Pip version.\n* [ENHANCEMENT] Restructure Travis CI linting, testing, deploying so\n  deploy only happens when other stages complete successfully.\n* [ENHANCEMENT] Improve speed of MacOS builds significantly.\n\n0.1.22 - 2019.01.22\n-------------------\n* [ENHANCEMENT] Pin Pip and Pytest versions, adding ``requirements.txt``.\n\n0.1.21 - 2019.01.10\n-------------------\n* [ENHANCEMENT] Lint code to conform with pylint and flake8 and add them\n  Travis-CI tests.\n* [ENHANCEMENT] Use ``pipenv`` and a lock file for dependency management.\n* [ENHANCEMENT] Adjust for compatibility with Python 3.7.\n\n0.1.20 - 2018.08.08\n-------------------\n* [ENHANCEMENT] Add ``--label-format`` option so that users can customize\n  the label displayed for their applications in `gravitybee-files.json`.\n\n0.1.19 - 2018.07.11\n-------------------\n* [ENHANCEMENT] Add ``--extra-pkgs`` and ``--extra-modules`` options for\n  including additional packages and modules with standalone executables.\n\n0.1.18 - 2018.07.05\n-------------------\n* [ENHANCEMENT] Add ``--onedir`` flag for improved debugging.\n\n0.1.17 - 2018.06.27\n-------------------\n* [FIX] Compatibility issues with CentOS 6 resolved.\n\n0.1.16 - 2018.06.21\n-------------------\n* [FIX] Compatibility issues with Windows resolved.\n\n0.1.15 - 2018.06.06\n-------------------\n* [FIX] Losing ``.exe`` extension with Windows executables in the\n  latest staging area.\n\n0.1.14 - 2018.06.04\n-------------------\n* [FIX] ``--with-latest`` was not working as a CL flag.\n\n0.1.13 - 2018.06.04\n-------------------\n* [ENHANCEMENT] Rearrange files created by GravityBee to all be\n  contained in a ``.gravitybee`` subdirectory of the current\n  directory.\n* [ENHANCEMENT] Place the distribution artifacts in the staging\n  directory, with a default value of ``.gravitybee/dist``.\n* [ENHANCEMENT] Add option ``--staging-dir`` to specify directory\n  where artifact staging should take place and export another\n  environment variable ``GB_ENV_STAGING_DIR``.\n* [ENHANCEMENT] Add option ``--with-latest`` to allow creation of\n  a second artifact staging directory called \"latest\" containing\n  the artifacts renamed with \"latest\" in the place of the version.\n* [ENHANCEMENT] Add option ``--sha-format`` to allow custom naming\n  of the SHA hash file.\n\n0.1.12 - 2018.05.29\n-------------------\n* [ENHANCEMENT] Add OS and machine type to the SHA256 hash file (to\n  avoid overwriting files if files from different platforms go to the\n  same location).\n* [ENHANCEMENT] Cleanup code with better variable names.\n\n0.1.11 - 2018.05.24\n-------------------\n* [ENHANCEMENT] Create a SHA256 hash for the generated standalone\n  file and include hash with file information and optionally in\n  a separate file (using --sha flag).\n* [ENHANCEMENT] Change names of environment variables produced\n  with output scripts to be prefixed with GB_ENV so that the\n  environs do not collide with environs consumed by GravityBee.\n* [ENHANCEMENT] Provide a convenience cleanup Bash script to\n  remove GravityBee output files (e.g., json and generated\n  executables).\n* [ENHANCEMENT] Cleanup code with more constants.\n\n0.1.10 - 2018.05.21\n-------------------\n* [ENHANCEMENT] Provide two additional output files for importing\n  GravityBee information into the environment on POSIX and Windows\n  platforms.\n\n0.1.9 - 2018.05.14\n------------------\n* [ENHANCEMENT] Output file with run info in json format for easy\n  consumption by other tools.\n\n0.1.8 - 2018.05.11\n------------------\n* [ENHANCEMENT] In non-verbose mode, allow for supressing stdout and\n  stderr from pyinstaller, which can be sizeable.\n* [ENHANCEMENT] Change name of ``gravitybee.file`` to\n  ``gravitybee-files.json``.\n\n0.1.7 - 2018.05.11\n------------------\n* [FIX] Fix exit code (was returning True).\n* [ENHANCEMENT] Automatically find console script installed by\n  setuptools on Windows and Linux and variety of places.\n\n0.1.6 - 2018.05.03\n------------------\n* [ENHANCEMENT] Follow format prescribed by satsuki for output\n  file (potential for multiple files).\n\n0.1.5 - 2018.05.01\n------------------\n* [ENHANCEMENT] Add mime-type and label to .json formatted file\n  information stored in gravitybee.file.\n\n0.1.3 - 2018.05.01\n------------------\n* [ENHANCEMENT] Create gravitybee.file with name of standalone\n  application.\n\n0.1.2 - 2018.04.27\n------------------\n* [ENHANCEMENT] Provide standalone file and path.\n* [FIX] Path bug.\n\n0.1.1 - 2018.04.26\n------------------\n* [FIX] Many bug fixes.\n\n0.1.0 - 2018.04.20\n------------------\n* Initial release!\n",
    "bugtrack_url": null,
    "license": "Apache Software License 2.0",
    "summary": "Generate standalone python applications.",
    "version": "0.4.6",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "2f29f7bec7e21c34f5b3a9f0ae4f09bc",
                "sha256": "a0cce3416c9d59c23aea28d6c51999854057731e07721d3cd6a2e024710a174c"
            },
            "downloads": -1,
            "filename": "gravitybee-0.4.6-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2f29f7bec7e21c34f5b3a9f0ae4f09bc",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 22092,
            "upload_time": "2022-12-07T16:44:18",
            "upload_time_iso_8601": "2022-12-07T16:44:18.155307Z",
            "url": "https://files.pythonhosted.org/packages/26/b2/30246c4534ef6b9bfa6f3eb6d46aa3680508fb302934feb6e211ec0305e2/gravitybee-0.4.6-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "f62a9616df691d08faf1bf240fce52a0",
                "sha256": "fdf89d373c2c27eed6f4d235645b97e2fccfc4d22c22c0db51b50b207469824b"
            },
            "downloads": -1,
            "filename": "gravitybee-0.4.6.tar.gz",
            "has_sig": false,
            "md5_digest": "f62a9616df691d08faf1bf240fce52a0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 36643,
            "upload_time": "2022-12-07T16:44:20",
            "upload_time_iso_8601": "2022-12-07T16:44:20.866460Z",
            "url": "https://files.pythonhosted.org/packages/93/b5/532fde96c7bb792bed183bb1f3936058690929e7b309357dc24acfff8962/gravitybee-0.4.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-07 16:44:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "plus3it",
    "github_project": "gravitybee",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": true,
    "lcname": "gravitybee"
}
        
Elapsed time: 0.02110s