openflexure-microscope-server/pyproject.toml
Julian Stirling e4cfcc76a7 Add some extra rules to ruff, also add a more complete ruff config that fails
Over time we can enable more rules for `ruff check`
2025-04-11 11:56:55 +01:00

114 lines
3.5 KiB
TOML

[project]
name = "openflexure-microscope-server"
version = "3.0.0.dev0"
authors = [
{ name="Richard Bowman", email="richard.bowman@cantab.net" },
{ name="Joel Collins" },
{ name="Julian Stirling" },
]
description = "Back-end code for the OpenFlexure Microscope"
readme = "README.md"
requires-python = ">=3.11"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
]
dependencies = [
"labthings-fastapi[server] == 0.0.7",
"labthings-sangaboard",
"camera-stage-mapping ~= 0.1.8",
"opencv-python ~= 4.7.0",
"pillow ~= 10.4",
"anyio ~= 4.0",
"numpy ~= 1.20",
"scipy ~=1.14",
"piexif",
"pydantic ~= 2.10.6",
]
[project.optional-dependencies]
dev = [
"labthings-fastapi[dev]",
"ruff",
"mypy[reports]",
"mypy-gitlab-code-quality",
# "pytest-gitlab-code-quality", # pytest version constraint clashes with labthings
"pytest",
]
pi = [
"labthings-picamera2 == 0.0.2-dev0",
]
[project.scripts]
openflexure-microscope-server = "openflexure_microscope_server.server:serve_from_cli"
[project.urls]
"Homepage" = "https://openflexure.org/"
"Bug Tracker" = "https://gitlab.com/openflexure/openflexure-microscope-server/-/issues"
"Source" = "https://gitlab.com/openflexure/openflexure-microscope-server/"
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
# The [tool.poetry] metadata has been removed from this file, because
# we have switched to Pipenv for dependency management and setuptools
# for the build system. All metadata has been moved either to
# Pipfile or setup.py.
# The one key that doesn't map over nicely is the exclusion of
# the node_modules folder, i.e. the line below:
#exclude = ["**/node_modules/"] # I've tried to put this in the "packages" key but not sure it works.
# I have left it here in case we ever switch back to Poetry, but I
# don't believe it's critical at present, because we don't use
# the Python package - we distribute a tarball directly.
[tool.mypy]
plugins = ["pydantic.mypy"]
[tool.ruff]
target-version = "py311"
[tool.pytest.ini_options]
addopts = [
"--import-mode=importlib",
]
[tool.ruff.format]
# Use native line endings for all files
line-ending = "native"
[tool.ruff.lint]
# Slowly add linting rules from ruff-increased-checking.toml commented
# out rules can be checked by running
# ruff --config ruff-increased-checking.toml check
select = [
"E", # pycodestyle errors
"W", #pycodestyle warnings
"F", # PyFlakes
# "PL", # Pylint (a subset of, catches far less than pylint does)
# "B", # Flake8 bugbear
"A", # Flake8 builtins checker
# "C", # Flake8 comprehensions
# "FIX", #TODO/FIXME's in code. These should be added during develoment for ongoing tasks.
# If they are not fixed before merge they should be converted to GitLab issues
# "LOG", # Flake8 logging issues (pedantic logger formatting issues can be added with "G")
# "T20", # Warns for print statments, production code should log
# "PT", # pytest linting
# "RET", # Consistent clear return statments
"RSE", # Raise parentheses
# "SIM", # Simplifications detected
# "ARG", # unused arguments
# "C90", # McCabe complexity!
"NPY", # Numpy linting
"N", # PEP8 naming
# "DOC", # Enforce argument, return, and raise to be mentioned in docstrings there is
# also "D" but this even warns about docstring punctuation. Perhaps a step too
# far?
]
ignore = [
"E501" # Ignore long lines for now
]