Skip to content

Commit

Permalink
Merge branch 'release/5.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnymillergh committed Mar 4, 2023
2 parents 0099602 + 1f7d834 commit 40b48da
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 7 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,15 @@ jobs:
- name: Smoke Test Docker Image
run: |
docker run --rm python_boilerplate:smoke-test-tag param_3_from_command_line
- name: Build Application Executable Package with PyInstaller
run: |
pipenv run pyinstaller --windowed --noconsole \
--add-data "setup.cfg:." \
--add-data "python_boilerplate/resources/*:python_boilerplate/resources" \
--name multithread_and_thread_pool_usage \
--clean --noconfirm python_boilerplate/demo/multithread_and_thread_pool_usage.py
- name: Display Built Artifacts
run: |
du -s -h *
- name: Smoke Test PyInstaller Application
run: ./dist/multithread_and_thread_pool_usage/multithread_and_thread_pool_usage
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repos:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
args: [ --fix, lf ]
args: [ --fix, auto ]
- id: check-yaml
- id: debug-statements
- id: name-tests-test
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# [5.0.0](https://github.com/johnnymillergh/muscle-and-fitness-server/compare/4.0.1...5.0.0) (2023-03-04)


### Features

* **$PyInstaller:** integrate PyInstaller ([29251e7](https://github.com/johnnymillergh/python_boilerplate/commit/29251e7249322ce706287ab39b9d6e9060d72408))



# [4.0.0](https://github.com/johnnymillergh/muscle-and-fitness-server/compare/3.0.0...4.0.0) (2022-09-18)


Expand Down
2 changes: 2 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,5 @@ pytest-html = "==3.2.0"
pytest-xdist = "==3.2.0"
# Call stack profiler for Python. Shows you why your code is slow! https://github.com/joerick/pyinstrument
pyinstrument = "==4.4.0"
# PyInstaller bundles a Python application and all its dependencies into a single package. https://github.com/pyinstaller/pyinstaller
pyinstaller = "==5.8.0"
51 changes: 50 additions & 1 deletion Pipfile.lock

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

32 changes: 28 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,18 +120,42 @@ $ python3 -m python_boilerplate
$ PYTHONPATH="${PYTHONPATH}:/Users/johnny/Projects/PyCharmProjects/python_boilerplate/python_boilerplate" python3 python_boilerplate/__main__.py
```

### ~~Package with [PyInstaller](https://pyinstaller.org/en/latest/usage.html?highlight=pythonpath#using-pyinstaller)~~

### Package with [PyInstaller](https://pyinstaller.org/en/latest/usage.html?highlight=pythonpath#using-pyinstaller)

> **⚠️ WANRING**
>
> Need to call `freeze_support()` immediately when startup in `python_boilerplate/__init__.py`
>
> ```
> from multiprocessing import freeze_support
>
> freeze_support()
> ```
>
> - [Pyinstaller multiprocessing name of process is always "MainProcess" #3957](https://github.com/pyinstaller/pyinstaller/issues/3957#issuecomment-674579877)
> - [pyinstaller linux binary is getting restarted again and again #4190](https://github.com/pyinstaller/pyinstaller/issues/4190)
Build artifact with macOS or Linux,
```shell
$ pipenv run pyinstaller --console \
--add-data "setup.cfg:." \
--add-data "python_boilerplate/resources/*:python_boilerplate/resources" \
--name main \
--name pandas_usage \
--clean --noconfirm python_boilerplate/demo/pandas_usage.py
```
On Windows,
```powershell
$ pipenv run pyinstaller --console `
--add-data "setup.cfg;." `
--add-data "python_boilerplate/resources/*;python_boilerplate/resources" `
--name multithread_and_thread_pool_usage `
--clean --noconfirm python_boilerplate/demo/multithread_and_thread_pool_usage.py
```

### Run Unit Tests

Run with pytest, analyze code coverage, generate HTML code coverage reports, fail the test if coverage percentage is unser 85%
Run with pytest, analyze code coverage, generate HTML code coverage reports, fail the test if coverage percentage is under 90%,

```shell
$ pipenv run pytest --cov --cov-report html --cov-fail-under=85 --capture=no --log-cli-level=INFO
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = python_boilerplate
version = 4.0.1
version = 5.0.0
description = A boilerplate project for Python.
long_description = file: README.md
long_description_content_type = text/markdown
Expand Down

0 comments on commit 40b48da

Please sign in to comment.