Skip to content

Commit

Permalink
Switch pyproject backend to poetry
Browse files Browse the repository at this point in the history
This makes it easier to consistently handle dependencies and dependency locks.

This should not affect any existing workflows, as pre-commit hooks to update
the lock and export to the requirements_dev.txt should make this mostly
transparent to any existing usage.

It means that it is easier to maintain consistency with the (fully specified
and verified) dependencies as they change.
  • Loading branch information
ndevenish committed Jul 18, 2024
1 parent 760661f commit 4bcb6a2
Show file tree
Hide file tree
Showing 7 changed files with 1,098 additions and 64 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest build
pip install build
- name: Build distribution
run: |
python -m build
Expand All @@ -29,7 +29,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
Expand Down
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,11 @@ repos:
- types-requests
- types-pkg_resources
- types-pyyaml

- repo: https://github.com/python-poetry/poetry
rev: 1.8.0
additional_dependencies: ["poetry-plugin-export"]
hooks:
- id: poetry-lock
- id: poetry-export
args: [-o, requirements_dev.txt, --with=dev, --without-hashes]
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ History

Unreleased
----------
- Switch python packaging backend to poetry.

0.32.0 (2024-04-05)
-------------------
Expand Down
1,010 changes: 1,010 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

99 changes: 49 additions & 50 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,51 +1,68 @@
[build-system]
requires = ["setuptools>=68.0"]
build-backend = "setuptools.build_meta"

[project]
[tool.poetry]
name = "zocalo"
version = "0.32.0"
description = "Infrastructure components for automated data processing at Diamond Light Source"
authors = ["Nicholas Devenish <[email protected]>"]
readme = "README.rst"
requires-python = ">=3.8"
license = { file = "LICENSE" }
authors = [
{ name = "Diamond Light Source - Data Analysis Group", email = "[email protected]" },
]
classifiers = [
"Development Status :: 4 - Beta",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"PyYAML",
"graypy>=1.0",
"marshmallow",
"requests",
"pydantic<2",
"setuptools",
"workflows>=2.14",
]

[project.urls]
[tool.poetry.dependencies]
python = "^3.8"
pyyaml = "^6.0"
graypy = "^2.0"
marshmallow = "^3.19"
requests = "^2.31"
pydantic = "<2"
workflows = "^2.27"

[tool.poetry.group.dev.dependencies]
pytest = "^8.2.2"
pytest-mock = "^3.14.0"
pytest-cov = "^5.0.0"
requests-mock = "^1.12.1"

[tool.poetry.group.docs]
optional = true

[tool.poetry.group.docs.dependencies]
sphinx = "^6"
sphinx-rtd-theme = "^1.2"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.urls]
Bug-Tracker = "https://github.com/DiamondLightSource/python-zocalo/issues"
Changelog = "https://github.com/DiamondLightSource/python-zocalo/blob/main/HISTORY.rst"
Documentation = "https://github.com/DiamondLightSource/python-zocalo"
Download = "https://github.com/DiamondLightSource/python-zocalo/releases"
GitHub = "https://github.com/DiamondLightSource/python-zocalo"

[project.entry-points]
[tool.poetry.scripts]
"zocalo.configure_rabbitmq" = "zocalo.cli.configure_rabbitmq:run"
"zocalo.dlq_check" = "zocalo.cli.dlq_check:run"
"zocalo.dlq_purge" = "zocalo.cli.dlq_purge:run"
"zocalo.dlq_reinject" = "zocalo.cli.dlq_reinject:run"
"zocalo.go" = "zocalo.cli.go:run"
"zocalo.pickup" = "zocalo.cli.pickup:run"
"zocalo.queue_drain" = "zocalo.cli.queue_drain:run"
"zocalo.service" = "zocalo.service:start_service"
"zocalo.shutdown" = "zocalo.cli.shutdown:run"
"zocalo.wrap" = "zocalo.cli.wrap:run"

[tool.poetry.plugins]
"libtbx.precommit" = { zocalo = "zocalo" }
"zocalo.wrappers" = { dummy = "zocalo.wrapper:DummyWrapper" }

[project.entry-points."libtbx.dispatcher.script"]
[tool.poetry.plugins."libtbx.dispatcher.script"]
"zocalo.configure_rabbitmq" = "zocalo.configure_rabbitmq"
"zocalo.dlq_check" = "zocalo.dlq_check"
"zocalo.dlq_purge" = "zocalo.dlq_purge"
Expand All @@ -56,13 +73,13 @@ GitHub = "https://github.com/DiamondLightSource/python-zocalo"
"zocalo.shutdown" = "zocalo.shutdown"
"zocalo.wrap" = "zocalo.wrap"

[project.entry-points."workflows.services"]
[tool.poetry.plugins."workflows.services"]
Dispatcher = "zocalo.service.dispatcher:Dispatcher"
JSONLines = "zocalo.service.jsonlines:JSONLines"
Mailer = "zocalo.service.mailer:Mailer"
Schlockmeister = "zocalo.service.schlockmeister:Schlockmeister"

[project.entry-points."zocalo.configuration.plugins"]
[tool.poetry.plugins."zocalo.configuration.plugins"]
graylog = "zocalo.configuration.plugin_graylog:Graylog"
jmx = "zocalo.configuration.plugin_jmx:JMX"
logging = "zocalo.configuration.plugin_logging:Logging"
Expand All @@ -72,31 +89,17 @@ iris = "zocalo.configuration.plugin_slurm:Slurm"
smtp = "zocalo.configuration.plugin_smtp:SMTP"
storage = "zocalo.configuration.plugin_storage:Storage"

[project.scripts]
"zocalo.configure_rabbitmq" = "zocalo.cli.configure_rabbitmq:run"
"zocalo.dlq_check" = "zocalo.cli.dlq_check:run"
"zocalo.dlq_purge" = "zocalo.cli.dlq_purge:run"
"zocalo.dlq_reinject" = "zocalo.cli.dlq_reinject:run"
"zocalo.go" = "zocalo.cli.go:run"
"zocalo.pickup" = "zocalo.cli.pickup:run"
"zocalo.queue_drain" = "zocalo.cli.queue_drain:run"
"zocalo.service" = "zocalo.service:start_service"
"zocalo.shutdown" = "zocalo.cli.shutdown:run"
"zocalo.wrap" = "zocalo.cli.wrap:run"

[tool.isort]
profile = "black"

[tool.pytest.ini_options]
required_plugins = "pytest-mock requests-mock"
testpaths = [
"tests",
]
testpaths = ["tests"]

[tool.ruff]
line-length = 88
ignore = ["E501", "E741"]
select = ["C4", "E", "F", "W", "I"]
select = ["C4", "E", "F", "W", "I"]
unfixable = ["F841"]

[tool.ruff.isort]
Expand All @@ -105,10 +108,6 @@ required-imports = ["from __future__ import annotations"]
[tool.mypy]
mypy_path = "src"


[[tool.mypy.overrides]]
module = [
"graypy",
"graypy.handler",
]
module = ["graypy", "graypy.handler"]
ignore_missing_imports = true
38 changes: 28 additions & 10 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
PyYAML==6.0
graypy==2.1.0
marshmallow==3.19.0
pydantic==1.10.12
pytest-cov==4.1.0
pytest-mock==3.11.1
pytest==7.4.0
requests==2.31.0
requests_mock==1.11.0
workflows==2.26
bidict==0.23.1 ; python_version >= "3.8" and python_version < "4.0"
certifi==2024.7.4 ; python_version >= "3.8" and python_version < "4.0"
charset-normalizer==3.3.2 ; python_version >= "3.8" and python_version < "4.0"
colorama==0.4.6 ; python_version >= "3.8" and python_version < "4.0" and sys_platform == "win32"
coverage[toml]==7.6.0 ; python_version >= "3.8" and python_version < "4.0"
docopt==0.6.2 ; python_version >= "3.8" and python_version < "4.0"
exceptiongroup==1.2.2 ; python_version >= "3.8" and python_version < "3.11"
graypy==2.1.0 ; python_version >= "3.8" and python_version < "4.0"
idna==3.7 ; python_version >= "3.8" and python_version < "4.0"
iniconfig==2.0.0 ; python_version >= "3.8" and python_version < "4.0"
marshmallow==3.21.3 ; python_version >= "3.8" and python_version < "4.0"
packaging==24.1 ; python_version >= "3.8" and python_version < "4.0"
pika==1.3.2 ; python_version >= "3.8" and python_version < "4.0"
pluggy==1.5.0 ; python_version >= "3.8" and python_version < "4.0"
pydantic==1.10.17 ; python_version >= "3.8" and python_version < "4.0"
pytest-cov==5.0.0 ; python_version >= "3.8" and python_version < "4.0"
pytest-mock==3.14.0 ; python_version >= "3.8" and python_version < "4.0"
pytest==8.2.2 ; python_version >= "3.8" and python_version < "4.0"
pyyaml==6.0.1 ; python_version >= "3.8" and python_version < "4.0"
requests-mock==1.12.1 ; python_version >= "3.8" and python_version < "4.0"
requests==2.32.3 ; python_version >= "3.8" and python_version < "4.0"
setuptools==71.0.3 ; python_version >= "3.8" and python_version < "4.0"
stomp-py==8.1.2 ; python_version >= "3.8" and python_version < "4.0"
tomli==2.0.1 ; python_version >= "3.8" and python_full_version <= "3.11.0a6"
typing-extensions==4.12.2 ; python_version >= "3.8" and python_version < "4.0"
urllib3==2.2.2 ; python_version >= "3.8" and python_version < "4.0"
websocket-client==1.8.0 ; python_version >= "3.8" and python_version < "4.0"
workflows==2.27 ; python_version >= "3.8" and python_version < "4.0"
2 changes: 0 additions & 2 deletions requirements_doc.txt

This file was deleted.

0 comments on commit 4bcb6a2

Please sign in to comment.