Skip to content

Commit

Permalink
move back to poetry with lower pyinstaller version
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshalX committed Dec 20, 2023
1 parent 0c692e3 commit 69e3b32
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 31 deletions.
23 changes: 8 additions & 15 deletions .github/workflows/build_executable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,7 @@ jobs:
run: echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Install dependencies
run: |
# we are exporting dependencies to do the trick with pyinstaller version
# we want to use new pyinstaller version with python 3.12, but our project uses Python 3.7
# the pyinstaller v6 dropped support of python 3.7
poetry export -f "requirements.txt" -o "requirements.txt"
pip install -r requirements.txt
pip install pyinstaller==6.3.0 dunamai==1.18.0
run: poetry install --without dev,test

- name: Import macOS signing certificate
if: runner.os == 'macOS'
Expand Down Expand Up @@ -115,16 +108,16 @@ jobs:
APPLE_CERT_NAME: ${{ secrets.APPLE_CERT_NAME }}
run: |
poetry run pyinstaller pyinstaller.spec
echo "PATH_TO_CYCODE_CLI_EXECUTABLE=dist/cycode" >> $GITHUB_ENV
echo "PATH_TO_CYCODE_CLI_EXECUTABLE=dist/cycode-cli" >> $GITHUB_ENV
- name: Build executable (onedir)
if: matrix.mode == 'onedir'
env:
CYCODE_ONEDIR_MODE: 1
APPLE_CERT_NAME: ${{ secrets.APPLE_CERT_NAME }}
run: |
pyinstaller pyinstaller.spec
echo "PATH_TO_CYCODE_CLI_EXECUTABLE=dist/cycode/cycode" >> $GITHUB_ENV
poetry run pyinstaller pyinstaller.spec
echo "PATH_TO_CYCODE_CLI_EXECUTABLE=dist/cycode/cycode-cli" >> $GITHUB_ENV
- name: Test executable
run: time $PATH_TO_CYCODE_CLI_EXECUTABLE version
Expand Down Expand Up @@ -204,23 +197,23 @@ jobs:
if: runner.os == 'Windows'
run: |
echo "ARTIFACT_NAME=cycode-win" >> $GITHUB_ENV
mv dist/cycode.exe dist/cycode-win.exe
mv dist/cycode-cli.exe dist/cycode-win.exe
powershell -Command "(Get-FileHash -Algorithm SHA256 dist/cycode-win.exe).Hash" > sha256
head -c 64 sha256 > dist/cycode-win.exe.sha256
- name: Prepare files on Intel macOS (onefile)
if: runner.os == 'macOS' && runner.arch == 'X64' && matrix.mode == 'onefile'
run: |
echo "ARTIFACT_NAME=cycode-mac" >> $GITHUB_ENV
mv dist/cycode dist/cycode-mac
mv dist/cycode-cli dist/cycode-mac
shasum -a 256 dist/cycode-mac > sha256
head -c 64 sha256 > dist/cycode-mac.sha256
- name: Prepare files on Apple Silicon macOS (onefile)
if: runner.os == 'macOS' && runner.arch == 'ARM64' && matrix.mode == 'onefile'
run: |
echo "ARTIFACT_NAME=cycode-mac-arm" >> $GITHUB_ENV
mv dist/cycode dist/cycode-mac-arm
mv dist/cycode-cli dist/cycode-mac-arm
shasum -a 256 dist/cycode-mac-arm > sha256
head -c 64 sha256 > dist/cycode-mac-arm.sha256
Expand All @@ -238,7 +231,7 @@ jobs:
if: runner.os == 'Linux'
run: |
echo "ARTIFACT_NAME=cycode-linux" >> $GITHUB_ENV
mv dist/cycode dist/cycode-linux
mv dist/cycode-cli dist/cycode-linux
sha256sum dist/cycode-linux > sha256
head -c 64 sha256 > dist/cycode-linux.sha256
Expand Down
26 changes: 13 additions & 13 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyinstaller.spec
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ if _ONEDIR_MODE:

exe = EXE(
*exe_args,
name='cycode',
name='cycode-cli',
exclude_binaries=bool(_ONEDIR_MODE),
target_arch=None,
codesign_identity=_CODESIGN_IDENTITY,
entitlements_file='entitlements.plist',
)

if _ONEDIR_MODE:
coll = COLLECT(exe, a.binaries, a.datas, name='cycode')
coll = COLLECT(exe, a.binaries, a.datas, name='cycode-cli')

# rollback the prev content of the __init__ file
with open(_INIT_FILE_PATH, 'w', encoding='UTF-8') as file:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ coverage = ">=7.2.3,<7.3.0"
responses = ">=0.23.1,<0.24.0"

[tool.poetry.group.executable.dependencies]
pyinstaller = ">=5.13.0,<5.14.0"
pyinstaller = ">=5.13.2,<5.14.0"
dunamai = ">=1.18.0,<1.19.0"

[tool.poetry.group.dev.dependencies]
Expand Down

0 comments on commit 69e3b32

Please sign in to comment.