Skip to content
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.

Commit

Permalink
Update build system (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
OttoWinter authored Jul 30, 2020
1 parent da530cd commit 80facb3
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 76 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
132 changes: 77 additions & 55 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: Build Workflow

on: [push, pull_request]
on:
push:
pull_request:

jobs:
build-windows:
runs-on: windows-latest
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/checkout@v1
Expand All @@ -13,25 +15,20 @@ jobs:
with:
python-version: '3.7'
architecture: 'x64'
- name: Print Versions
run: |
python --version
pip --version
- name: Install requirements
run: |
pip install -r requirements_build.txt
pip install -r requirements.txt -r requirements_build.txt
pip install -e .
- name: Run PyInstaller
run: |
python -m PyInstaller.__main__ -F -w -n ESPHome-Flasher -i icon.ico esphomeflasher\__main__.py
- name: See dist directory
run: ls dist
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v2
with:
name: Windows
path: dist/ESPHome-Flasher.exe

build-windows-x86:
runs-on: windows-latest
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/checkout@v1
Expand All @@ -40,54 +37,48 @@ jobs:
with:
python-version: '3.7'
architecture: 'x86'
- name: Print Versions
run: |
python --version
pip --version
- name: Install requirements
run: |
pip install -r requirements_build.txt
pip install -r requirements.txt -r requirements_build.txt
pip install -e .
- name: Run PyInstaller
run: |
python -m PyInstaller.__main__ -F -w -n ESPHome-Flasher -i icon.ico esphomeflasher\__main__.py
- name: See dist directory
run: ls dist
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v2
with:
name: Windows-x86
path: dist/ESPHome-Flasher.exe

#build-ubuntu:
# runs-on: ubuntu-latest
# 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 python-wxgtk3.0 build-essential libgtk-3-dev
# - name: Print Versions
# run: |
# python --version
# pip --version
# - name: Install requirements
# run: |
# pip install pathlib2
# pip install -r requirements_build.txt
# pip install -e .
# - name: Run PyInstaller
# run: |
# python -m PyInstaller.__main__ -F -w -n ESPHome-Flasher -i icon.ico esphomeflasher/__main__.py
# - name: See dist directory
# run: ls dist
# - uses: actions/upload-artifact@master
# with:
# name: Ubuntu
# path: dist
build-ubuntu:
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 PyInstaller
run: |
python -m PyInstaller.__main__ -F -w -n ESPHome-Flasher -i icon.ico esphomeflasher/__main__.py
- name: See dist directory
run: ls dist
- uses: actions/upload-artifact@v2
with:
name: Ubuntu
path: dist/ESPHome-Flasher


build-macos:
Expand All @@ -99,20 +90,51 @@ jobs:
uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: Print Versions
run: |
python --version
pip --version
- name: Install requirements
run: |
pip install -r requirements_build.txt
pip install -r requirements.txt -r requirements_build.txt
pip install -e .
- name: Run PyInstaller
run: |
python -m PyInstaller.__main__ -F -w -n ESPHome-Flasher -i icon.icns esphomeflasher/__main__.py
- name: See dist directory
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:
name: MacOS
path: dist/ESPHome-Flasher.app
name: macOS
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 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include LICENSE
include README.md
include requirements.txt
28 changes: 21 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# esphomeflasher
# ESPHome-Flasher

esphomeflasher is a utility app for the [esphomelib](https://esphomelib.com/esphomeyaml/index.html)
framework and is designed to make flashing ESPs with esphomelib as simple as possible by:
ESPHome-Flasher is a utility app for the [ESPHome](https://esphome.io/)
framework and is designed to make flashing ESPs with ESPHome as simple as possible by:

* Having pre-built binaries for most operating systems.
* Hiding all non-essential options for flashing. All necessary options for flashing
(bootloader, flash mode) are automatically extracted from the binary.

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
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)
project.

Expand All @@ -19,15 +19,15 @@ library by espressif.
## Installation

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.

## Installation Using `pip`

If you want to install this application from `pip`:

- 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`
- Start the GUI using `esphomeflasher`. Alternatively, you can use the command line interface (
type `esphomeflasher -h` for info)
Expand All @@ -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 (
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

[MIT](http://opensource.org/licenses/MIT) © Marcel Stör, Otto Winter
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
wxpython>=4.0,<5.0
esptool==2.8
requests>=2.24.0,<3
6 changes: 2 additions & 4 deletions requirements_build.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
wxpython>=4.0,<5.0
esptool==2.8
requests>=2.0,<3
pyinstaller
pyinstaller>=3.6,<4
wheel
27 changes: 17 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env python
"""esphomeflasher setup script."""
import os

from setuptools import setup, find_packages

from esphomeflasher import const
Expand All @@ -8,24 +10,27 @@
PROJECT_PACKAGE_NAME = 'esphomeflasher'
PROJECT_LICENSE = 'MIT'
PROJECT_AUTHOR = 'ESPHome'
PROJECT_COPYRIGHT = '2019, ESPHome'
PROJECT_COPYRIGHT = '2020, ESPHome'
PROJECT_URL = 'https://esphome.io/guides/faq.html'
PROJECT_EMAIL = '[email protected]'

PROJECT_GITHUB_USERNAME = 'esphome'
PROJECT_GITHUB_REPOSITORY = 'esphomeflasher'
PROJECT_GITHUB_REPOSITORY = 'esphome-flasher'

PYPI_URL = 'https://pypi.python.org/pypi/{}'.format(PROJECT_PACKAGE_NAME)
GITHUB_PATH = '{}/{}'.format(PROJECT_GITHUB_USERNAME, PROJECT_GITHUB_REPOSITORY)
GITHUB_URL = 'https://github.com/{}'.format(GITHUB_PATH)

DOWNLOAD_URL = '{}/archive/{}.zip'.format(GITHUB_URL, const.__version__)

REQUIRES = [
'wxpython>=4.0,<5.0',
'esptool==2.8',
'requests>=2.0,<3',
]
here = os.path.abspath(os.path.dirname(__file__))

with open(os.path.join(here, 'requirements.txt')) as requirements_txt:
REQUIRES = requirements_txt.read().splitlines()

with open(os.path.join(here, 'README.md')) as readme:
LONG_DESCRIPTION = readme.read()


setup(
name=PROJECT_PACKAGE_NAME,
Expand All @@ -35,18 +40,20 @@
download_url=DOWNLOAD_URL,
author=PROJECT_AUTHOR,
author_email=PROJECT_EMAIL,
description="ESP8266/ESP32 firmware flasher for esphomelib",
description="ESP8266/ESP32 firmware flasher for ESPHome",
include_package_data=True,
zip_safe=False,
platforms='any',
test_suite='tests',
python_requires='>=3.5',
python_requires='>=3.5,<4.0',
install_requires=REQUIRES,
long_description=LONG_DESCRIPTION,
long_description_content_type='text/markdown',
keywords=['home', 'automation'],
entry_points={
'console_scripts': [
'esphomeflasher = esphomeflasher.__main__:main'
]
},
packages=find_packages()
packages=find_packages(include="esphomerelease.*")
)

0 comments on commit 80facb3

Please sign in to comment.