Coder Social home page Coder Social logo

Comments (2)

dmckeone avatar dmckeone commented on September 23, 2024

I did ultimately figure this out with PyInstaller by including a collect_all call for html5tagger (amongst other Sanic packages)

The final Pyinstaller spec file for my sample was this:

(the project has a fairly standard setup of sanic sqlalchemy / alembic and click)

# -*- mode: python ; coding: utf-8 -*-
from PyInstaller.utils.hooks import collect_all

name = 'sanic_playground'

datas = [
    ('log_config.json', '.'),
    ('alembic.ini', '.'),
    ('migrations', 'migrations')
]

binaries = []
hiddenimports = [
    'asyncpg'
]

# Ensure that all sanic dependencies are collected
for pkg_name in ['asyncpg', 'html5tagger', 'sanic', 'sanic_ext', 'sqlalchemy', 'tracerite']:
    pkg_collect = collect_all(pkg_name)
    datas += pkg_collect[0]
    binaries += pkg_collect[1]
    hiddenimports += pkg_collect[2]


# -------------------------------
# DEFAULT GENERATED CONTENT BELOW
# -------------------------------

block_cipher = None

a = Analysis(
    ['main.py'],
    pathex=[],
    binaries=binaries,
    datas=datas,
    hiddenimports=hiddenimports,
    hookspath=[],
    hooksconfig={},
    runtime_hooks=[],
    excludes=[],
    win_no_prefer_redirects=False,
    win_private_assemblies=False,
    cipher=block_cipher,
    noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)

exe = EXE(
    pyz,
    a.scripts,
    a.binaries,
    a.zipfiles,
    a.datas,
    [],
    name=name,
    debug=False,
    bootloader_ignore_signals=False,
    strip=False,
    upx=True,
    upx_exclude=[],
    runtime_tmpdir=None,
    console=True,
    disable_windowed_traceback=False,
    argv_emulation=False,
    target_arch=None,
    codesign_identity=None,
    entitlements_file=None,
)

from html5tagger.

Tronic avatar Tronic commented on September 23, 2024

Good to know. Let us know if you find out it needs any changes to Sanic packages to make it more fluent.

from html5tagger.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.