Skip to content

Commit

Permalink
build(pyinstaller): add linux binary support
Browse files Browse the repository at this point in the history
  • Loading branch information
Toilal committed Feb 3, 2021
1 parent 94caaa7 commit 51b0edf
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -57,6 +57,14 @@ jobs:
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

- run: pyinstaller --clean -y --dist ./dist guessit.spec

- uses: actions/upload-artifact@v2
if: ${{ matrix.regex == '0' }}
with:
name: guessit-dist-${{matrix.python-version}}
path: dist

commitlint:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
Expand Down
42 changes: 42 additions & 0 deletions guessit.spec
@@ -0,0 +1,42 @@
# -*- mode: python -*-

block_cipher = None

import babelfish

a = Analysis(['guessit/__main__.py'],
pathex=[],
binaries=[],
datas=[
('guessit/config/*', 'guessit/config'),
('guessit/data/*', 'guessit/data'),
(babelfish.__path__[0] + '/data', 'babelfish/data')
],
hiddenimports=[
'pkg_resources.py2_warn', # https://github.com/pypa/setuptools/issues/1963
'babelfish.converters.alpha2',
'babelfish.converters.alpha3b',
'babelfish.converters.alpha3t',
'babelfish.converters.name',
'babelfish.converters.opensubtitles',
'babelfish.converters.countryname'
],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=True,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name='guessit',
debug=False,
strip=False,
upx=False,
runtime_tmpdir=None,
console=True )
File renamed without changes.
2 changes: 1 addition & 1 deletion guessit/rules/properties/website.py
Expand Up @@ -27,7 +27,7 @@ def website(config):
rebulk = rebulk.regex_defaults(flags=re.IGNORECASE).string_defaults(ignore_case=True)
rebulk.defaults(name="website")

with resource_stream('guessit', 'tlds-alpha-by-domain.txt') as tld_file:
with resource_stream('guessit', 'data/tlds-alpha-by-domain.txt') as tld_file:
tlds = [
tld.strip().decode('utf-8')
for tld in tld_file.readlines()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -20,7 +20,7 @@

setup_requires = ['pytest-runner']

dev_require = ['tox', 'mkdocs', 'mkdocs-material']
dev_require = ['tox', 'mkdocs', 'mkdocs-material', 'pyinstaller']

tests_require = ['pytest', 'pytest-benchmark', 'pylint', 'PyYAML']

Expand Down

0 comments on commit 51b0edf

Please sign in to comment.