Skip to content

Commit

Permalink
Run build and pre-commit github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
arekm committed Aug 15, 2022
1 parent 91a1d45 commit 0dff585
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 4 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Build
on:
push:
pull_request:
release:
types: [published]
workflow_dispatch:

jobs:
build:
name: 🔨 Build distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: 🏗 Set up Python 3.7
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: 🏗 Install build dependencies
run: |
pip install wheel --user
pip install octoprint[develop]
- name: 🔨 Build a binary wheel and a source tarball
run: |
python setup.py sdist bdist_wheel
- name: ⬆ Upload build result
uses: actions/upload-artifact@v1
with:
name: dist
path: dist

pre-commit:
name: 🧹 Pre-commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: 🏗 Set up Python 3.7
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: 🏗 Set up dev dependencies
run: |
pip install octoprint[develop]
pip install -e .[develop]
- name: 🚀 Run pre-commit
run: |
pre-commit run --all-files --show-diff-on-failure
test-install:
name: 🧪 Installation tests
needs: build
strategy:
matrix:
python: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
installable: ["wheel", "sdist"]
runs-on: ubuntu-latest
steps:
- name: ⬇ Download build result
uses: actions/download-artifact@v1
with:
name: dist
path: dist
- name: 🏗 Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: 🏗 Install OctoPrint
run: |
pip install OctoPrint
- name: 🚀 Install wheel
if: matrix.installable == 'wheel'
run: |
pip install dist/OctoPrint_*-py2.py3-none-any.whl
- name: 🚀 Install source tarball
if: matrix.installable == 'sdist'
run: |
pip install dist/OctoPrint-*.tar.gz
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[metadata]
license_file = LICENSE.txt
license_file = LICENSE

[bdist_wheel]
universal = 1
Expand Down
20 changes: 18 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,24 @@ def params():
# this plugin is not zip_safe.
zip_safe = False

# Read the requirements from our requirements.txt file
install_requires = open("requirements.txt").read().split("\n")
# Requirements
install_requires = ['OctoPrint']

# Additional requirements for optional install options and/or OS-specific dependencies
extras_require = {
# Dependencies for development
"develop": [
# Testing dependencies
"ddt",
"mock>=4,<5",
"pytest-doctest-custom>=1.0.0,<2",
"pytest>=6.2.5,<7",
# pre-commit
"pre-commit",
# profiler
"pyinstrument",
],
}

# Hook the plugin into the "octoprint.plugin" entry point, mapping the plugin_identifier to the plugin_package.
# That way OctoPrint will be able to find the plugin and load it.
Expand Down

0 comments on commit 0dff585

Please sign in to comment.