This commit is contained in:
Otto Winter 2020-07-30 13:26:38 +02:00
commit 1546b4aede
No known key found for this signature in database
GPG Key ID: 48ED2DDB96D7682C
6 changed files with 122 additions and 75 deletions

View File

@ -1,10 +1,12 @@
name: Build Workflow name: Build Workflow
on: [push, pull_request] on:
push:
pull_request:
jobs: jobs:
build-windows: build-windows:
runs-on: windows-latest runs-on: windows-2019
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v1 uses: actions/checkout@v1
@ -13,25 +15,20 @@ jobs:
with: with:
python-version: '3.7' python-version: '3.7'
architecture: 'x64' architecture: 'x64'
- name: Print Versions
run: |
python --version
pip --version
- name: Install requirements - name: Install requirements
run: | run: |
pip install -r requirements_build.txt pip install -r requirements.txt -r requirements_build.txt
pip install -e . pip install -e .
- name: Run PyInstaller - name: Run PyInstaller
run: | run: |
python -m PyInstaller.__main__ -F -w -n ESPHome-Flasher -i icon.ico esphomeflasher\__main__.py python -m PyInstaller.__main__ -F -w -n ESPHome-Flasher -i icon.ico esphomeflasher\__main__.py
- name: See dist directory - uses: actions/upload-artifact@v2
run: ls dist
- uses: actions/upload-artifact@master
with: with:
name: Windows name: Windows
path: dist/ESPHome-Flasher.exe path: dist/ESPHome-Flasher.exe
build-windows-x86: build-windows-x86:
runs-on: windows-latest runs-on: windows-2019
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v1 uses: actions/checkout@v1
@ -40,54 +37,48 @@ jobs:
with: with:
python-version: '3.7' python-version: '3.7'
architecture: 'x86' architecture: 'x86'
- name: Print Versions
run: |
python --version
pip --version
- name: Install requirements - name: Install requirements
run: | run: |
pip install -r requirements_build.txt pip install -r requirements.txt -r requirements_build.txt
pip install -e . pip install -e .
- name: Run PyInstaller - name: Run PyInstaller
run: | run: |
python -m PyInstaller.__main__ -F -w -n ESPHome-Flasher -i icon.ico esphomeflasher\__main__.py python -m PyInstaller.__main__ -F -w -n ESPHome-Flasher -i icon.ico esphomeflasher\__main__.py
- name: See dist directory - name: See dist directory
run: ls dist run: ls dist
- uses: actions/upload-artifact@master - uses: actions/upload-artifact@v2
with: with:
name: Windows-x86 name: Windows-x86
path: dist/ESPHome-Flasher.exe path: dist/ESPHome-Flasher.exe
#build-ubuntu: build-ubuntu:
# runs-on: ubuntu-latest runs-on: ubuntu-18.04
# steps: steps:
# - name: Checkout - name: Checkout
# uses: actions/checkout@v1 uses: actions/checkout@v1
# - name: Install Python - name: Install Python
# uses: actions/setup-python@v1 uses: actions/setup-python@v1
# with: with:
# python-version: '3.7' python-version: '3.7'
# - name: Install dependencies - name: Install dependencies
# run: | run: |
# sudo apt install python-wxgtk3.0 build-essential libgtk-3-dev sudo apt install libgtk-3-dev libnotify-dev libsdl2-dev
# - name: Print Versions pip install -U \
# run: | -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04 \
# python --version wxPython
# pip --version - name: Install requirements
# - name: Install requirements run: |
# run: | pip install -r requirements.txt -r requirements_build.txt
# pip install pathlib2 pip install -e .
# pip install -r requirements_build.txt - name: Run PyInstaller
# pip install -e . run: |
# - name: Run PyInstaller python -m PyInstaller.__main__ -F -w -n ESPHome-Flasher -i icon.ico esphomeflasher/__main__.py
# run: | - name: See dist directory
# python -m PyInstaller.__main__ -F -w -n ESPHome-Flasher -i icon.ico esphomeflasher/__main__.py run: ls dist
# - name: See dist directory - uses: actions/upload-artifact@v2
# run: ls dist with:
# - uses: actions/upload-artifact@master name: Ubuntu
# with: path: dist/ESPHome-Flasher
# name: Ubuntu
# path: dist
build-macos: build-macos:
@ -99,20 +90,51 @@ jobs:
uses: actions/setup-python@v1 uses: actions/setup-python@v1
with: with:
python-version: '3.7' python-version: '3.7'
- name: Print Versions
run: |
python --version
pip --version
- name: Install requirements - name: Install requirements
run: | run: |
pip install -r requirements_build.txt pip install -r requirements.txt -r requirements_build.txt
pip install -e . pip install -e .
- name: Run PyInstaller - name: Run PyInstaller
run: | run: |
python -m PyInstaller.__main__ -F -w -n ESPHome-Flasher -i icon.icns esphomeflasher/__main__.py python -m PyInstaller.__main__ -F -w -n ESPHome-Flasher -i icon.icns esphomeflasher/__main__.py
- name: See dist directory - name: See dist directory
run: ls dist run: ls dist
- uses: actions/upload-artifact@master - name: Move app
run: |
mv dist/ESPHome-Flasher.app dist/ESPHome-Flasher-dev-macOS.app
- uses: actions/upload-artifact@v2
with: with:
name: MacOS name: macOS
path: dist/ESPHome-Flasher.app path: dist/
build-pypi:
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install Python
uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: Install dependencies
run: |
sudo apt install libgtk-3-dev libnotify-dev libsdl2-dev
pip install -U \
-f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04 \
wxPython
- name: Install requirements
run: |
pip install -r requirements.txt -r requirements_build.txt
pip install -e .
- name: Run sdist
run: python setup.py sdist bdist_wheel
- name: See dist directory
run: ls dist
- uses: actions/upload-artifact@v2
with:
name: sdist
path: dist/esphomeflasher-*.tar.gz
- uses: actions/upload-artifact@v2
with:
name: bdist_wheel
path: dist/esphomeflasher-*.whl

3
MANIFEST.in Normal file
View File

@ -0,0 +1,3 @@
include LICENSE
include README.md
include requirements.txt

View File

@ -1,15 +1,15 @@
# esphomeflasher # ESPHome-Flasher
esphomeflasher is a utility app for the [esphomelib](https://esphomelib.com/esphomeyaml/index.html) ESPHome-Flasher is a utility app for the [ESPHome](https://esphome.io/)
framework and is designed to make flashing ESPs with esphomelib as simple as possible by: framework and is designed to make flashing ESPs with ESPHome as simple as possible by:
* Having pre-built binaries for most operating systems. * Having pre-built binaries for most operating systems.
* Hiding all non-essential options for flashing. All necessary options for flashing * Hiding all non-essential options for flashing. All necessary options for flashing
(bootloader, flash mode) are automatically extracted from the binary. (bootloader, flash mode) are automatically extracted from the binary.
This project was originally intended to be a simple command-line tool, This project was originally intended to be a simple command-line tool,
but then I decided that a GUI would be nice. As I don't like writing graphical but then I decided that a GUI would be nice. As I don't like writing graphical
front end code, the GUI largely is based on the front end code, the GUI largely is based on the
[NodeMCU PyFlasher](https://github.com/marcelstoer/nodemcu-pyflasher) [NodeMCU PyFlasher](https://github.com/marcelstoer/nodemcu-pyflasher)
project. project.
@ -19,7 +19,7 @@ library by espressif.
## Installation ## Installation
Es doesn't have to be installed, just double-click it and it'll start. Es doesn't have to be installed, just double-click it and it'll start.
Check the [releases section](https://github.com/OttoWinter/esphomeflasher/releases) Check the [releases section](https://github.com/esphome/esphome-flasher/releases)
for downloads for your platform. for downloads for your platform.
## Installation Using `pip` ## Installation Using `pip`
@ -27,7 +27,7 @@ for downloads for your platform.
If you want to install this application from `pip`: If you want to install this application from `pip`:
- Install Python 3.x - Install Python 3.x
- Install [wxPython 4.x](https://wxpython.org/) manually or run `pip3 install wxpython` - Install [wxPython 4.x](https://wxpython.org/) manually or run `pip3 install wxpython` (see also linux notes below)
- Install this project using `pip3 install esphomeflasher` - Install this project using `pip3 install esphomeflasher`
- Start the GUI using `esphomeflasher`. Alternatively, you can use the command line interface ( - Start the GUI using `esphomeflasher`. Alternatively, you can use the command line interface (
type `esphomeflasher -h` for info) type `esphomeflasher -h` for info)
@ -42,6 +42,20 @@ If you want to build this application yourself you need to:
- Start the GUI using `esphomeflasher`. Alternatively, you can use the command line interface ( - Start the GUI using `esphomeflasher`. Alternatively, you can use the command line interface (
type `esphomeflasher -h` for info) type `esphomeflasher -h` for info)
## Linux Notes
Installing wxpython for linux can be a bit challenging (especially when you don't want to install from source).
You can use the following command to install a wxpython suitable with your OS:
```bash
# Go to https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ and select the correct OS type
# here, we assume ubuntu 18.03 bionic
pip3 install -U \
-f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04 \
wxPython
```
## License ## License
[MIT](http://opensource.org/licenses/MIT) © Marcel Stör, Otto Winter [MIT](http://opensource.org/licenses/MIT) © Marcel Stör, Otto Winter

3
requirements.txt Normal file
View File

@ -0,0 +1,3 @@
wxpython>=4.0,<5.0
esptool==2.8
requests>=2.24.0,<3

View File

@ -1,4 +1,2 @@
wxpython>=4.0,<5.0 pyinstaller>=3.6,<4
esptool==2.8 wheel
requests>=2.0,<3
pyinstaller

View File

@ -1,5 +1,7 @@
#!/usr/bin/env python #!/usr/bin/env python
"""esphomeflasher setup script.""" """esphomeflasher setup script."""
import os
from setuptools import setup, find_packages from setuptools import setup, find_packages
from esphomeflasher import const from esphomeflasher import const
@ -13,7 +15,7 @@ PROJECT_URL = 'https://esphome.io/guides/faq.html'
PROJECT_EMAIL = 'contact@esphome.io' PROJECT_EMAIL = 'contact@esphome.io'
PROJECT_GITHUB_USERNAME = 'esphome' PROJECT_GITHUB_USERNAME = 'esphome'
PROJECT_GITHUB_REPOSITORY = 'esphomeflasher' PROJECT_GITHUB_REPOSITORY = 'esphome-flasher'
PYPI_URL = 'https://pypi.python.org/pypi/{}'.format(PROJECT_PACKAGE_NAME) PYPI_URL = 'https://pypi.python.org/pypi/{}'.format(PROJECT_PACKAGE_NAME)
GITHUB_PATH = '{}/{}'.format(PROJECT_GITHUB_USERNAME, PROJECT_GITHUB_REPOSITORY) GITHUB_PATH = '{}/{}'.format(PROJECT_GITHUB_USERNAME, PROJECT_GITHUB_REPOSITORY)
@ -21,11 +23,14 @@ GITHUB_URL = 'https://github.com/{}'.format(GITHUB_PATH)
DOWNLOAD_URL = '{}/archive/{}.zip'.format(GITHUB_URL, const.__version__) DOWNLOAD_URL = '{}/archive/{}.zip'.format(GITHUB_URL, const.__version__)
REQUIRES = [ here = os.path.abspath(os.path.dirname(__file__))
'wxpython>=4.0,<5.0',
'esptool==2.8', with open(os.path.join(here, 'requirements.txt')) as requirements_txt:
'requests>=2.0,<3', REQUIRES = requirements_txt.read().splitlines()
]
with open(os.path.join(here, 'README.md')) as readme:
LONG_DESCRIPTION = readme.read()
setup( setup(
name=PROJECT_PACKAGE_NAME, name=PROJECT_PACKAGE_NAME,
@ -35,18 +40,20 @@ setup(
download_url=DOWNLOAD_URL, download_url=DOWNLOAD_URL,
author=PROJECT_AUTHOR, author=PROJECT_AUTHOR,
author_email=PROJECT_EMAIL, author_email=PROJECT_EMAIL,
description="ESP8266/ESP32 firmware flasher for esphomelib", description="ESP8266/ESP32 firmware flasher for ESPHome",
include_package_data=True, include_package_data=True,
zip_safe=False, zip_safe=False,
platforms='any', platforms='any',
test_suite='tests', test_suite='tests',
python_requires='>=3.5', python_requires='>=3.5,<4.0',
install_requires=REQUIRES, install_requires=REQUIRES,
long_description=LONG_DESCRIPTION,
long_description_content_type='text/markdown',
keywords=['home', 'automation'], keywords=['home', 'automation'],
entry_points={ entry_points={
'console_scripts': [ 'console_scripts': [
'esphomeflasher = esphomeflasher.__main__:main' 'esphomeflasher = esphomeflasher.__main__:main'
] ]
}, },
packages=find_packages() packages=find_packages(include="esphomerelease.*")
) )