Skip to content

Commit

Permalink
Supporting OctoPrint 1.10 and Python 3.12 (#258)
Browse files Browse the repository at this point in the history
* Testing on 1.10.x

* Using rc2.

* Including full version to the matrix.

* Adjusting exceptions.

* Removing condition on Wheel installation.

* Testing on Python 3.12.

* Using mocked version 0.0.0 for testing instead of unknown.

* Removing template test.

* Removing snapshot updating action.

* trying rc3

* Using rc4

* Using prod ready 1.10 in CI.

* Updating integration test in Release workflow.

* Removing snapshottest installation in CI.
  • Loading branch information
RobinTail authored Apr 24, 2024
1 parent b023c8f commit 262fed5
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 5,073 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,36 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
octoprint: [ "1.5", "1.6", "1.7", "1.8", "1.9" ]
python: [ "3.7", "3.8", "3.9", "3.10", "3.11", "3.12" ]
octoprint: [ "1.5", "1.6", "1.7", "1.8", "1.9", "1.10" ]
exclude:
# These versions are not compatible to each other:
- octoprint: 1.5
python: 3.10
- octoprint: 1.5
python: 3.11
- octoprint: 1.5
python: 3.12
- octoprint: 1.6
python: 3.10
- octoprint: 1.6
python: 3.11
- octoprint: 1.6
python: 3.12
- octoprint: 1.7
python: 3.10
- octoprint: 1.7
python: 3.11
- octoprint: 1.7
python: 3.12
- octoprint: 1.8
python: 3.10
- octoprint: 1.8
python: 3.11
- octoprint: 1.8
python: 3.12
- octoprint: 1.9
python: 3.12
steps:
- uses: actions/checkout@v4
- name: Install Python
Expand All @@ -90,20 +100,19 @@ jobs:
run: pip install octoprint~=${{ matrix.octoprint }}.0
- name: Install Wheel
# see https://community.octoprint.org/t/setuptools-error-while-installing-plugin-octoklipper-on-manual-op-installation/51387
if: matrix.octoprint != '1.9'
run: pip install wheel
- name: Install OctoRelay
run: pip install -e .
- name: Prepare testing environment
run: pip install coverage pylint snapshottest mypy
run: pip install coverage pylint mypy
- name: Test
working-directory: tests
run: python -m coverage run -m unittest test*.py
- name: Report the coverage
working-directory: tests
run: |
python -m coverage lcov --omit=test*,_version*
python -m coverage report --show-missing --omit=test*,_version*,snap_*
python -m coverage report --show-missing --omit=test*,_version*
- name: Coveralls
uses: coverallsapp/github-action@v2
continue-on-error: true
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,26 +68,36 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
octoprint: [ "1.5", "1.6", "1.7", "1.8", "1.9" ]
python: [ "3.7", "3.8", "3.9", "3.10", "3.11", "3.12" ]
octoprint: [ "1.5", "1.6", "1.7", "1.8", "1.9", "1.10" ]
exclude:
# These versions are not compatible to each other:
- octoprint: 1.5
python: 3.10
- octoprint: 1.5
python: 3.11
- octoprint: 1.5
python: 3.12
- octoprint: 1.6
python: 3.10
- octoprint: 1.6
python: 3.11
- octoprint: 1.6
python: 3.12
- octoprint: 1.7
python: 3.10
- octoprint: 1.7
python: 3.11
- octoprint: 1.7
python: 3.12
- octoprint: 1.8
python: 3.10
- octoprint: 1.8
python: 3.11
- octoprint: 1.8
python: 3.12
- octoprint: 1.9
python: 3.12
steps:
- name: Install Python
uses: actions/setup-python@v4
Expand All @@ -102,7 +112,6 @@ jobs:
run: pip install octoprint~=${{ matrix.octoprint }}.0
- name: Install Wheel
# see https://community.octoprint.org/t/setuptools-error-while-installing-plugin-octoklipper-on-manual-op-installation/51387
if: matrix.octoprint != '1.9'
run: pip install wheel
- name: Install the distributed package
run: pip install dist/OctoRelay-*.zip
Expand Down
38 changes: 0 additions & 38 deletions .github/workflows/snapshot.yaml

This file was deleted.

9 changes: 6 additions & 3 deletions octoprint_octorelay/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ def get_version(version_file=STATIC_VERSION_FILE):
if not version:
version = get_version_from_git_archive(version_info)
if not version:
version = Version("unknown", None, None)
# version = Version("unknown", None, None)
version = Version("0.0.0", None, None)
return pep440_format(version)
else:
return version
Expand Down Expand Up @@ -95,7 +96,8 @@ def get_version_from_git():
except ValueError: # No tags, only the git hash
# prepend 'g' to match with format returned by 'git describe'
git = "g{}".format(*description)
release = "unknown"
# release = "unknown"
release = "0.0.0"
dev = None

labels = []
Expand Down Expand Up @@ -141,7 +143,8 @@ def get_version_from_git_archive(version_info):
release, *_ = sorted(version_tags) # prefer e.g. "2.0" over "2.0rc1"
return Version(release, dev=None, labels=None)
else:
return Version("unknown", dev=None, labels=["g{}".format(git_hash)])
# return Version("unknown", dev=None, labels=["g{}".format(git_hash)])
return Version("0.0.0", dev=None, labels=["g{}".format(git_hash)])


__version__ = get_version()
Expand Down
Empty file removed tests/snapshots/__init__.py
Empty file.
Loading

0 comments on commit 262fed5

Please sign in to comment.