Skip to content

Commit 0dff585

Browse files
committed
Run build and pre-commit github actions
1 parent 91a1d45 commit 0dff585

File tree

4 files changed

+98
-4
lines changed

4 files changed

+98
-4
lines changed

.github/workflows/build.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Build
2+
on:
3+
push:
4+
pull_request:
5+
release:
6+
types: [published]
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
name: 🔨 Build distribution
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
- name: 🏗 Set up Python 3.7
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: 3.7
21+
- name: 🏗 Install build dependencies
22+
run: |
23+
pip install wheel --user
24+
pip install octoprint[develop]
25+
- name: 🔨 Build a binary wheel and a source tarball
26+
run: |
27+
python setup.py sdist bdist_wheel
28+
- name: ⬆ Upload build result
29+
uses: actions/upload-artifact@v1
30+
with:
31+
name: dist
32+
path: dist
33+
34+
pre-commit:
35+
name: 🧹 Pre-commit
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v3
39+
- name: 🏗 Set up Python 3.7
40+
uses: actions/setup-python@v4
41+
with:
42+
python-version: 3.7
43+
- name: 🏗 Set up dev dependencies
44+
run: |
45+
pip install octoprint[develop]
46+
pip install -e .[develop]
47+
- name: 🚀 Run pre-commit
48+
run: |
49+
pre-commit run --all-files --show-diff-on-failure
50+
51+
test-install:
52+
name: 🧪 Installation tests
53+
needs: build
54+
strategy:
55+
matrix:
56+
python: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
57+
installable: ["wheel", "sdist"]
58+
runs-on: ubuntu-latest
59+
steps:
60+
- name: ⬇ Download build result
61+
uses: actions/download-artifact@v1
62+
with:
63+
name: dist
64+
path: dist
65+
- name: 🏗 Set up Python ${{ matrix.python }}
66+
uses: actions/setup-python@v4
67+
with:
68+
python-version: ${{ matrix.python }}
69+
- name: 🏗 Install OctoPrint
70+
run: |
71+
pip install OctoPrint
72+
- name: 🚀 Install wheel
73+
if: matrix.installable == 'wheel'
74+
run: |
75+
pip install dist/OctoPrint_*-py2.py3-none-any.whl
76+
- name: 🚀 Install source tarball
77+
if: matrix.installable == 'sdist'
78+
run: |
79+
pip install dist/OctoPrint-*.tar.gz

requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[metadata]
2-
license_file = LICENSE.txt
2+
license_file = LICENSE
33

44
[bdist_wheel]
55
universal = 1

setup.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,24 @@ def params():
5353
# this plugin is not zip_safe.
5454
zip_safe = False
5555

56-
# Read the requirements from our requirements.txt file
57-
install_requires = open("requirements.txt").read().split("\n")
56+
# Requirements
57+
install_requires = ['OctoPrint']
58+
59+
# Additional requirements for optional install options and/or OS-specific dependencies
60+
extras_require = {
61+
# Dependencies for development
62+
"develop": [
63+
# Testing dependencies
64+
"ddt",
65+
"mock>=4,<5",
66+
"pytest-doctest-custom>=1.0.0,<2",
67+
"pytest>=6.2.5,<7",
68+
# pre-commit
69+
"pre-commit",
70+
# profiler
71+
"pyinstrument",
72+
],
73+
}
5874

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

0 commit comments

Comments
 (0)