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.

Format and remove lint according to newest tool versions.

Update and clean-up the content of `pyproject.toml`,
in particular use the `[project]` table
now that it is supported by Poetry.

Update more development dependencies.
  • Loading branch information
fabcor-maxiv authored and marcus-oscarsson committed Feb 13, 2025
1 parent 70950f1 commit 8bf09ef
Show file tree
Hide file tree
Showing 9 changed files with 314 additions and 297 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
max-parallel: 5
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.10", "3.11"]

# Skip `pull_request` runs on local PRs for which `push` runs are already triggered
# yamllint disable-line rule:line-length
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
16 changes: 7 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repos:
- --strict

- repo: https://github.com/python-poetry/poetry
rev: 1.8.4
rev: 2.0.1
hooks:

# Equivalent to running `poetry check --lock`.
Expand All @@ -25,18 +25,16 @@ repos:
args:
- --lock

# Equivalent to running `poetry lock --no-update`.
# Equivalent to running `poetry lock`.
# This syncs the `poetry.lock` file with the content of the `pyproject.toml` file.
# This hook fails if it results in modifying `poetry.lock`.
- id: poetry-lock
args:
- --no-update

# Equivalent to running `poetry export`.
# This exports the `poetry.lock` file to the `requirements.txt` file.
# This hook fails if it results in modifying `requirements.txt`.
- repo: https://github.com/python-poetry/poetry-plugin-export
rev: 1.8.0
rev: 1.9.0
hooks:
- id: poetry-export

Expand All @@ -53,18 +51,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
- 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
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ build:
- >-
mamba create --name=mxcubeweb
openldap
poetry
python=3.8
poetry=2.0.1
python=3.10
- >-
mamba run --name=mxcubeweb
Expand Down
9 changes: 6 additions & 3 deletions conda-environment.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%YAML 1.2

---


name: mxcubeweb

channels:
Expand All @@ -13,7 +13,7 @@ dependencies:
# ====================

- ffmpeg # Not directly used by mxcube, but necessary for the video-streamer
- python >=3.8,<3.12 # Make sure it matches `pyproject.toml`
- python >=3.10,<3.12 # Make sure it matches `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 @@ -30,4 +30,7 @@ dependencies:

- nodejs ==18.*|20.* # Make sure it matches `ui/package.json`
- pnpm ==9.* # Make sure it matches `ui/package.json`
- poetry ==1.8.4 # Make sure it matches `.pre-commit-config.yaml`
- poetry ==2.0.1 # Make sure it matches `.pre-commit-config.yaml` and `poetry.lock`


...
4 changes: 3 additions & 1 deletion mxcubeweb/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
from logging.handlers import TimedRotatingFileHandler
from pathlib import Path

from mxcubecore import ColorFormatter
from mxcubecore import (
ColorFormatter,
)
from mxcubecore import HardwareRepository as HWR
from mxcubecore import (
queue_entry,
Expand Down
305 changes: 168 additions & 137 deletions poetry.lock

Large diffs are not rendered by default.

37 changes: 23 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
[tool.poetry]
[project]
name = "mxcubeweb"
version = "4.277.0"
license = "LGPL-3.0-or-later"
description = "MXCuBE Web user interface"
authors = ["The MXCuBE collaboration <[email protected]>"]
authors = [
{name = "The MXCuBE collaboration", email = "[email protected]"},
]
maintainers = [
"MXCuBE collaboration <[email protected]>",
{name = "The MXCuBE collaboration", email = "[email protected]"},
]
readme = "README.md"
homepage = "https://github.com/mxcube/mxcubeweb"
repository = "https://github.com/mxcube/mxcubeweb"
documentation = "https://mxcubeweb.readthedocs.io/"
url.homepage = "https://github.com/mxcube/mxcubeweb"
url.repository = "https://github.com/mxcube/mxcubeweb"
url.documentation = "https://mxcubeweb.readthedocs.io/"
keywords = ["mxcube", "mxcube3", "mxcubeweb"]
classifiers = [
"Development Status :: 5 - Production/Stable",
Expand All @@ -20,9 +22,15 @@ classifiers = [
"Natural Language :: English",
"Topic :: Scientific/Engineering",
]
requires-python = ">=3.10,<3.12"
scripts.mxcubeweb-server = 'mxcubeweb:main'
dynamic = [
# For the time being: keep using Poetry-specific notation for this field,
# but there does not seem to be anything blocking migration to standard notation.
"dependencies",
]

[tool.poetry.dependencies]
python = ">=3.8,<3.12"
Flask = "^3.0.3"
werkzeug = "^3.0.3"
Flask-SocketIO = "^5.3.6"
Expand All @@ -47,9 +55,9 @@ bcrypt = "^4.0.1"
authlib = "^1.3.0"

[tool.poetry.group.dev.dependencies]
pre-commit = ">=2.21.0"
pytest = "7.1.3"
pytest-cov = "4.0.0"
pre-commit = "^4.1.0"
pytest = "^8.3.4"
pytest-cov = "^6.0.0"

[tool.poetry.group.docs.dependencies]
furo = "^2023.9.10"
Expand All @@ -60,7 +68,11 @@ sphinxcontrib-httpdomain = "^1.8.1"

[tool.black]
line-length = 88
preview = true
required-version = "25"
target-version = [
"py310",
"py311",
]
include = '\.pyi?$'
exclude = '''
/(
Expand All @@ -82,6 +94,3 @@ exclude = '''
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.scripts]
mxcubeweb-server = 'mxcubeweb:main'
Loading

0 comments on commit 8bf09ef

Please sign in to comment.