Skip to content

Commit

Permalink
Drop support for Python 3.8 and Python 3.9
Browse files Browse the repository at this point in the history
Supported versions are:
* Python 3.10
* Python 3.11

Update all tools that were stuck on older versions
because the tools themselves dropped Python 3.8 (and 3.9).

Format and remove lint according to newest tool versions.

GitHub: fix mxcube#1046
  • Loading branch information
fabcor-maxiv committed Feb 11, 2025
1 parent 09ba4e5 commit dcc6704
Show file tree
Hide file tree
Showing 58 changed files with 221 additions and 561 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
# See "Caveats" at https://pypi.org/project/sphinx-last-updated-by-git
fetch-depth: 0

- name: "Set up Python 3.8"
- name: "Set up Python 3.10"
uses: "actions/setup-python@v5"
with:
python-version: "3.8"
python-version: "3.10"

- name: "Install OpenLDAP's dev package with apt"
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:

- uses: actions/checkout@v3

- name: Set up Python 3.8
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: "3.10"

- name: Install openldap
# yamllint disable rule:line-length
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.10", "3.11"]
steps:
- uses: actions/checkout@v3

Expand All @@ -30,7 +30,7 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install poetry --user
python -m poetry install --extras=tango
python -m poetry install
- name: Test with pytest
run: |
Expand Down
2 changes: 1 addition & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[settings]
profile=black
py_version=38
py_version=310
force_grid_wrap=2
14 changes: 6 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ repos:
- --strict

- repo: https://github.com/python-poetry/poetry
rev: 1.8.0
rev: 2.0.1
hooks:
- id: poetry-check

- repo: https://github.com/myint/autoflake
- repo: https://github.com/PyCQA/autoflake
rev: v2.3.1
hooks:
- id: autoflake
Expand All @@ -27,20 +27,18 @@ repos:
- --ignore-pass-after-docstring

- repo: https://github.com/pycqa/isort
rev: 5.13.2
rev: 6.0.0
hooks:
- id: isort

- repo: https://github.com/psf/black
rev: 24.8.0 # The following version (`24.10.0`) dropped support for Python 3.8.
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.1.0
hooks:
- id: black
name: Black

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
# The following version (pre-commit-hooks 5.0.0) requires pre-commit 3.2.0
# which does not support Python 3.8 (dropped in pre-commit 3.0.0).
rev: v5.0.0
hooks:
- id: trailing-whitespace
# Exclude files from trailing-whitespace checks until we get around fixing them.
Expand Down
8 changes: 6 additions & 2 deletions conda-environment-dev.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
%YAML 1.2
---


name: mxcubecore

channels:
Expand All @@ -11,7 +12,7 @@ dependencies:
# Runtime dependencies
# ====================

- python >=3.8,<3.12
- python >=3.10,<3.12 # Keep in sync with `pyproject.toml`

# `openldap` is necessary for `python-ldap` but can not be installed by pip or Poetry.
# Note also that on PyPI `python-ldap` is only available as *sdist*, not as *wheel*,
Expand All @@ -26,4 +27,7 @@ dependencies:
# Development dependencies
# ========================

- poetry
- poetry ==2.0.1 # Keep in sync with `.pre-commit-config.yaml` and `poetry.lock`


...
2 changes: 1 addition & 1 deletion deprecated/HardwareObjects/TacoDevice_MTSafe.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ def dev_io(mdevname, mdevcommand, *parin, **kw):
io_out,
0,
parin,
**kw
**kw,
)
except Exception:
raise Dev_Exception(
Expand Down
3 changes: 1 addition & 2 deletions deprecated/HardwareObjects/mockup/CameraMockup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Class for cameras connected to framegrabbers run by Taco Device Servers
"""
"""Class for cameras connected to framegrabbers run by Taco Device Servers"""

import logging
import os
Expand Down
4 changes: 2 additions & 2 deletions mxcubecore/Command/Exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# You should have received a copy of the GNU General Lesser Public License
# along with MXCuBE. If not, see <http://www.gnu.org/licenses/>.

"""Exporter, ExporterChannel and ExporterCommand implementation """
"""Exporter, ExporterChannel and ExporterCommand implementation"""

# from warnings import warn
import logging
Expand Down Expand Up @@ -231,7 +231,7 @@ def __init__(
address=None,
port=None,
timeout=3,
**kwargs
**kwargs,
):
ChannelObject.__init__(self, name, username, **kwargs)

Expand Down
2 changes: 1 addition & 1 deletion mxcubecore/Command/Pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def __init__(
username=None,
polling=None,
timeout=10000,
**kwargs
**kwargs,
):
ChannelObject.__init__(self, name, username, **kwargs)

Expand Down
2 changes: 1 addition & 1 deletion mxcubecore/Command/Sardana.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# along with MXCuBE. If not, see <http://www.gnu.org/licenses/>.


"""Sardana Control System """
"""Sardana Control System"""

from __future__ import absolute_import

Expand Down
2 changes: 1 addition & 1 deletion mxcubecore/Command/Spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def __init__(
version=None,
username=None,
dispatchMode=SpecVariable.FIREEVENT,
**kwargs
**kwargs,
):
ChannelObject.__init__(self, name, username, **kwargs)
SpecVariableA.__init__(self, varname, version, dispatchMode)
Expand Down
2 changes: 1 addition & 1 deletion mxcubecore/Command/Taco.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def __init__(
username=None,
polling=None,
args=None,
**kwargs
**kwargs,
):
ChannelObject.__init__(self, name, username, **kwargs)

Expand Down
2 changes: 1 addition & 1 deletion mxcubecore/Command/Tine.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(
username=None,
ListArgs=None,
timeout=1000,
**kwargs
**kwargs,
):
CommandObject.__init__(self, name, username, **kwargs)
self.commandName = command_name
Expand Down
2 changes: 1 addition & 1 deletion mxcubecore/Command/exporter/StandardClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# You should have received a copy of the GNU General Lesser Public License
# along with MXCuBE. If not, see <http://www.gnu.org/licenses/>.

""" ProtocolError and StandardClient implementation"""
"""ProtocolError and StandardClient implementation"""
import socket
import sys

Expand Down
3 changes: 1 addition & 2 deletions mxcubecore/HardwareObjects/BeamlineTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
# You should have received a copy of the GNU Lesser General Public License
# along with MXCuBE. If not, see <http://www.gnu.org/licenses/>.

"""
"""
""" """

from mxcubecore.BaseHardwareObjects import HardwareObject

Expand Down
2 changes: 1 addition & 1 deletion mxcubecore/HardwareObjects/BlissShutter.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# You should have received a copy of the GNU Lesser General Public License
# along with MXCuBE. If not, see <http://www.gnu.org/licenses/>.

""" BlissShutter class - interface for shutter controlled by BLISS
"""BlissShutter class - interface for shutter controlled by BLISS
Implements _set_value, get_value methods
Bliss states are: UNKNOWN, OPEN, CLOSED, FAULT
"MOVING", "DISABLE", "STANDBY", "RUNNING"
Expand Down
2 changes: 1 addition & 1 deletion mxcubecore/HardwareObjects/ESRF/ESRFBeamlineActions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Lesser Public License
# along with MXCuBE. If not, see <http://www.gnu.org/licenses/>.
""" Execute commands and toggle two state actions
"""Execute commands and toggle two state actions
Example xml file:
<object class = "ESRF.ESRFBeamlineActions">
<object role="controller" href="/bliss"/>
Expand Down
3 changes: 1 addition & 2 deletions mxcubecore/HardwareObjects/ESRF/ESRFMD2SC3.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""ESRF SC3 Sample Changer Hardware Object
"""
"""ESRF SC3 Sample Changer Hardware Object"""

import ESRF.ESRFSC3 as ESRFSC3
import SC3
Expand Down
2 changes: 1 addition & 1 deletion mxcubecore/HardwareObjects/ESRF/ESRFPhotonFlux.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# You should have received a copy of the GNU General Lesser Public License
# along with MXCuBE. If not, see <http://www.gnu.org/licenses/>.

""" Photon flux calculations
"""Photon flux calculations
Example xml_ configuration:
.. code-block:: xml
Expand Down
3 changes: 1 addition & 2 deletions mxcubecore/HardwareObjects/ESRF/ESRFSC3.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""ESRF SC3 Sample Changer Hardware Object
"""
"""ESRF SC3 Sample Changer Hardware Object"""

import functools
import logging
Expand Down
3 changes: 1 addition & 2 deletions mxcubecore/HardwareObjects/ESRF/ESRFSmallXrayCentring.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with MXCuBE. If not, see <https://www.gnu.org/licenses/>.
"""
"""
""" """

from __future__ import (
absolute_import,
Expand Down
3 changes: 1 addition & 2 deletions mxcubecore/HardwareObjects/ESRF/ID30SC3.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""ESRF SC3 Sample Changer Hardware Object
"""
"""ESRF SC3 Sample Changer Hardware Object"""

import ESRFSC3
import SC3
Expand Down
2 changes: 1 addition & 1 deletion mxcubecore/HardwareObjects/ESRF/OxfordCryostream.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# You should have received a copy of the GNU General Lesser Public License
# along with MXCuBE. If not, see <http://www.gnu.org/licenses/>.

""" Oxford Cryostream, controlled by bliss.
"""Oxford Cryostream, controlled by bliss.
Example xml_ configuration:
.. code-block:: xml
Expand Down
2 changes: 1 addition & 1 deletion mxcubecore/HardwareObjects/ESRF/Transmission.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#
# You should have received a copy of the GNU General Lesser Public License
# along with MXCuBE. If not, see <http://www.gnu.org/licenses/>.
"""Transmission with bliss """
"""Transmission with bliss"""

from mxcubecore.HardwareObjects.abstract.AbstractTransmission import (
AbstractTransmission,
Expand Down
2 changes: 1 addition & 1 deletion mxcubecore/HardwareObjects/Gphl/GphlMessages.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /usr/bin/env python
# encoding: utf-8
""" Abstract beamline interface message classes
"""Abstract beamline interface message classes
License:
Expand Down
6 changes: 3 additions & 3 deletions mxcubecore/HardwareObjects/Gphl/GphlWorkflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1757,7 +1757,7 @@ def setup_data_collection(self, payload, correlation_id):
translation = GphlMessages.GoniostatTranslation(
rotation=newRotation,
requestedRotationId=sweepSetting.id_,
**translation_settings
**translation_settings,
)
self._latest_translation_id = translation.id_
self._recentrings.append(translation)
Expand Down Expand Up @@ -2533,7 +2533,7 @@ def execute_sample_centring(
GphlMessages.GoniostatTranslation(
rotation=goniostatRotation,
requestedRotationId=requestedRotationId,
**dd0
**dd0,
),
positionsDict,
)
Expand Down Expand Up @@ -2624,7 +2624,7 @@ def handle_collection_start(
)
translation = GphlMessages.GoniostatTranslation(
requestedRotationId=scan.sweep.goniostatSweepSetting.id_,
**translation_settings
**translation_settings,
)
self._latest_translation_id = translation.id_
self._scan_id_to_translation_id[scan.id_] = translation.id_
Expand Down
2 changes: 1 addition & 1 deletion mxcubecore/HardwareObjects/Gphl/GphlWorkflowConnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ def _GoniostatRotation_to_python(self, py4jGoniostatRotation, isSweepSetting=Fal
GphlMessages.GoniostatTranslation(
id_=uuid.UUID(translationUuidString),
rotation=result,
**translationAxisSettings
**translationAxisSettings,
)
return result

Expand Down
3 changes: 1 addition & 2 deletions mxcubecore/HardwareObjects/GrobSampleChanger.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Sample Changer Hardware Object
"""
"""Sample Changer Hardware Object"""

import logging

Expand Down
Loading

0 comments on commit dcc6704

Please sign in to comment.