From 0aabb8a3ed2336e090a1c54c6765be2b81748f4f Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Fri, 20 Dec 2024 09:59:19 -0800 Subject: [PATCH] Move dependencies into pyproject.toml For every directory except `hub`, which is special, move the main dependencies into `pyproject.toml` to more closely follow normal Python conventions. Development dependencies will stay as a separate `requirements/dev.in`, at least for now, since the `dev` extra for services is a bit awkward. --- controller/pyproject.toml | 18 ++++++++++++++++-- controller/requirements/main.in | 31 ------------------------------- controller/requirements/main.txt | 31 +++++++++++++++---------------- inithome/pyproject.toml | 1 - inithome/requirements/main.in | 10 ---------- inithome/requirements/main.txt | 2 +- noxfile.py | 20 +++++++++++++------- 7 files changed, 45 insertions(+), 68 deletions(-) delete mode 100644 controller/requirements/main.in delete mode 100644 inithome/requirements/main.in diff --git a/controller/pyproject.toml b/controller/pyproject.toml index 6681eb2ac..ffe15f75b 100644 --- a/controller/pyproject.toml +++ b/controller/pyproject.toml @@ -17,8 +17,22 @@ classifiers = [ "Typing :: Typed", ] requires-python = ">=3.13" -# Use requirements/main.in for runtime dependencies instead. -dependencies = [] +dependencies = [ + "aiojobs", + "bitmath", + "google-cloud-artifact-registry", + "httpx", + "fastapi>=0.100", + "jinja2", + "kubernetes_asyncio", + "pydantic>2", + "pydantic-settings", + "PyYAML", + "safir[kubernetes]>=6.2.0", + "semver", + "sse-starlette", + "uvicorn[standard]", +] dynamic = ["version"] [project.scripts] diff --git a/controller/requirements/main.in b/controller/requirements/main.in deleted file mode 100644 index 845b0b243..000000000 --- a/controller/requirements/main.in +++ /dev/null @@ -1,31 +0,0 @@ -# -*- conf -*- -# -# Editable runtime dependencies for the Nublado controller. Add direct -# runtime dependencies here, as well as implicit dependencies with -# constrained versions. -# -# After editing, update controller/requirements/main.txt by running: -# nox -s update-deps - -# These dependencies are for fastapi including some optional features. -fastapi>=0.100 -starlette -uvicorn[standard] - -# Other dependencies. -aiojobs -bitmath -google-cloud-artifact-registry -httpx -jinja2 -kubernetes_asyncio -pydantic>2 -pydantic-settings -PyYAML -safir[kubernetes]>=6.2.0 -semver -sse-starlette - -# Uncomment this, change the branch, comment out safir above, and run nox -s -# update-deps-no-hashes to test against an unreleased version of Safir. -# safir[kubernetes] @ git+https://github.com/lsst-sqre/safir@main diff --git a/controller/requirements/main.txt b/controller/requirements/main.txt index cdb317d48..10d03dda9 100644 --- a/controller/requirements/main.txt +++ b/controller/requirements/main.txt @@ -1,5 +1,5 @@ # This file was autogenerated by uv via the following command: -# uv pip compile --generate-hashes --universal --output-file controller/requirements/main.txt controller/requirements/main.in +# uv pip compile --generate-hashes --universal --output-file controller/requirements/main.txt controller/pyproject.toml aiofiles==23.2.1 \ --hash=sha256:19297512c647d4b27a2cf7c34caa7e405c0d60b5560618a29a9fe027b18b0107 \ --hash=sha256:84ec2218d8419404abcb9f0c02df3f34c6e0a68ed41072acfb1cef5cbc29051a @@ -89,7 +89,7 @@ aiohttp==3.11.11 \ aiojobs==1.3.0 \ --hash=sha256:03074c884b3dc388b8d798c0de24ec17d72b2799018497fda8062c0431a494b5 \ --hash=sha256:1f9f36179b6d50796c4fc9e8851fdae10f38d6c2f64412a91e2c4eff73054ce0 - # via -r controller/requirements/main.in + # via controller (controller/pyproject.toml) aiokafka==0.12.0 \ --hash=sha256:04c8ad27d04d6c53a1859687015a5f4e58b1eb221e8a7342d6c6b04430def53e \ --hash=sha256:06f5889acf8e1a81d6e14adf035acb29afd1f5836447fa8fa23d3cbe8f7e8608 \ @@ -154,7 +154,7 @@ attrs==24.3.0 \ # referencing bitmath==1.3.3.1 \ --hash=sha256:293325f01e65defe966853111df11d39215eb705a967cb115851da8c4cfa3eb8 - # via -r controller/requirements/main.in + # via controller (controller/pyproject.toml) cachetools==5.5.0 \ --hash=sha256:02134e8439cdc2ffb62023ce1debca2944c3f289d66bb17ead3ab3dede74b292 \ --hash=sha256:2cc24fb4cbe39633fb7badd9db9ca6295d766d9c2995f245725a46715d050f2a @@ -405,7 +405,7 @@ fastapi==0.115.6 \ --hash=sha256:9ec46f7addc14ea472958a96aae5b5de65f39721a46aaf5705c480d9a8b76654 \ --hash=sha256:e9240b29e36fa8f4bb7290316988e90c381e5092e0cbe84e7818cc3713bcf305 # via - # -r controller/requirements/main.in + # controller (controller/pyproject.toml) # safir fastavro==1.10.0 \ --hash=sha256:0a678153b5da1b024a32ec3f611b2e7afd24deac588cb51dd1b0019935191a6d \ @@ -559,7 +559,7 @@ google-auth==2.37.0 \ google-cloud-artifact-registry==1.14.0 \ --hash=sha256:c67e0e06189d171c1f347702a1779c66a31b1b214d209ef97f9bbbe458b9c90e \ --hash=sha256:e7e263d75ea892887ce22ff7f5807b14f614097a8ca8b5d7d13204823b7fd8b8 - # via -r controller/requirements/main.in + # via controller (controller/pyproject.toml) googleapis-common-protos==1.66.0 \ --hash=sha256:c3e7b33d15fdca5374cc0a7346dd92ffa847425cc4ea941d970f13680052ec8c \ --hash=sha256:d7abcd75fabb2e0ec9f74466401f6c119a0b498e27370e9be4c94cb7e382b8ed @@ -695,7 +695,7 @@ httpx==0.27.2 \ --hash=sha256:7bb2708e112d8fdd7829cd4243970f0c223274051cb35ee80c03301ee29a3df0 \ --hash=sha256:f7c2be1d2f3c3c3160d441802406b206c2b76f5947b11115e6df10c6c65e66c2 # via - # -r controller/requirements/main.in + # controller (controller/pyproject.toml) # python-schema-registry-client # safir idna==3.10 \ @@ -713,7 +713,7 @@ inflection==0.5.1 \ jinja2==3.1.4 \ --hash=sha256:4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369 \ --hash=sha256:bc5dd2abb727a5319567b7a813e6a2e7318c39f4f487cfe6c89c6f9c7d25197d - # via -r controller/requirements/main.in + # via controller (controller/pyproject.toml) jsonschema==4.23.0 \ --hash=sha256:d71497fef26351a33265337fa77ffeb82423f3ea21283cd9467bb03999266bc4 \ --hash=sha256:fbadb6f8b144a8f8cf9f0b89ba94501d143e50411a1278633f56a7acf7fd5566 @@ -726,7 +726,7 @@ kubernetes-asyncio==31.1.1 \ --hash=sha256:393bb60a2740d482651d474956296b341348c3e4f883b171740e5a4bf105a87b \ --hash=sha256:d5e441674fde5dd8d0366cb6a204d7fbaef8d0dce7ca7a34c0791af0d13b6ff1 # via - # -r controller/requirements/main.in + # controller (controller/pyproject.toml) # safir markupsafe==3.0.2 \ --hash=sha256:0bff5e0ae4ef2e1ae4fdf2dfd5b76c75e5c2fa4132d05fc1b0dabcd20c7e28c4 \ @@ -1020,7 +1020,7 @@ pydantic==2.10.4 \ --hash=sha256:597e135ea68be3a37552fb524bc7d0d66dcf93d395acd93a00682f1efcb8ee3d \ --hash=sha256:82f12e9723da6de4fe2ba888b5971157b3be7ad914267dea8f05f82b28254f06 # via - # -r controller/requirements/main.in + # controller (controller/pyproject.toml) # fast-depends # fastapi # pydantic-settings @@ -1133,7 +1133,7 @@ pydantic-settings==2.7.0 \ --hash=sha256:ac4bfd4a36831a48dbf8b2d9325425b549a0a6f18cea118436d728eb4f1c4d66 \ --hash=sha256:e00c05d5fa6cbbb227c84bd7487c5c1065084119b750df7c8c1a554aed236eb5 # via - # -r controller/requirements/main.in + # controller (controller/pyproject.toml) # safir pyjwt==2.10.1 \ --hash=sha256:3cc5772eb20009233caf06e9d8a0577824723b44e6648ee0a2aedb6cf9381953 \ @@ -1210,7 +1210,7 @@ pyyaml==6.0.2 \ --hash=sha256:f753120cb8181e736c57ef7636e83f31b9c0d1722c516f7e86cf15b7aa57ff12 \ --hash=sha256:ff3824dc5261f50c9b0dfb3be22b4567a6f938ccce4587b38952d85fd9e9afe4 # via - # -r controller/requirements/main.in + # controller (controller/pyproject.toml) # kubernetes-asyncio # uvicorn referencing==0.35.1 \ @@ -1337,7 +1337,7 @@ rsa==4.9 \ safir==9.1.1 \ --hash=sha256:e1388b745f42030debd951a6f62e70b1fcdb217cb472c835ceffdcb90682f34a \ --hash=sha256:ea2fa7dbb75f4bf6101ae3e1a7a6beb0522c211fc1ad43321a8b00c09f6d8a2e - # via -r controller/requirements/main.in + # via controller (controller/pyproject.toml) safir-logging==9.1.1 \ --hash=sha256:5b268259f282502471fdb6a2087d2e5a010fa88d73cfa71a32fc5c656562830a \ --hash=sha256:e48e905ca30cb7f2ee95d54b22fd0678511b18b59275203a611368fc0da4ea0c @@ -1345,7 +1345,7 @@ safir-logging==9.1.1 \ semver==3.0.2 \ --hash=sha256:6253adb39c70f6e51afed2fa7152bcd414c411286088fb4b9effb133885ab4cc \ --hash=sha256:b1ea4686fe70b981f85359eda33199d60c53964284e0cfb4977d243e37cf4bf4 - # via -r controller/requirements/main.in + # via controller (controller/pyproject.toml) six==1.17.0 \ --hash=sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274 \ --hash=sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81 @@ -1361,12 +1361,11 @@ sniffio==1.3.1 \ sse-starlette==2.1.3 \ --hash=sha256:8ec846438b4665b9e8c560fcdea6bc8081a3abf7942faa95e5a744999d219772 \ --hash=sha256:9cd27eb35319e1414e3d2558ee7414487f9529ce3b3cf9b21434fd110e017169 - # via -r controller/requirements/main.in + # via controller (controller/pyproject.toml) starlette==0.41.3 \ --hash=sha256:0e4ab3d16522a255be6b28260b938eae2482f98ce5cc934cb08dce8dc3ba5835 \ --hash=sha256:44cedb2b7c77a9de33a8b74b2b90e9f50d11fcf25d8270ea525ad71a25374ff7 # via - # -r controller/requirements/main.in # fastapi # safir # sse-starlette @@ -1401,7 +1400,7 @@ uvicorn==0.34.0 \ --hash=sha256:023dc038422502fa28a09c7a30bf2b6991512da7dcdb8fd35fe57cfc154126f4 \ --hash=sha256:404051050cd7e905de2c9a7e61790943440b3416f49cb409f965d9dcd0fa73e9 # via - # -r controller/requirements/main.in + # controller (controller/pyproject.toml) # sse-starlette uvloop==0.21.0 ; platform_python_implementation != 'PyPy' and sys_platform != 'cygwin' and sys_platform != 'win32' \ --hash=sha256:0878c2640cf341b269b7e128b1a5fed890adc4455513ca710d77d5e93aa6d6a0 \ diff --git a/inithome/pyproject.toml b/inithome/pyproject.toml index 03f79cf34..2b003d97b 100644 --- a/inithome/pyproject.toml +++ b/inithome/pyproject.toml @@ -17,7 +17,6 @@ classifiers = [ "Typing :: Typed", ] requires-python = ">=3.13" -# Dependencies in requirements/main.txt (empty) and requirements/dev.txt dependencies = [] dynamic = ["version"] diff --git a/inithome/requirements/main.in b/inithome/requirements/main.in deleted file mode 100644 index 87c5a7b23..000000000 --- a/inithome/requirements/main.in +++ /dev/null @@ -1,10 +0,0 @@ -# -*- conf -*- -# -# Editable runtime dependencies for the inithome provisioner. Add direct -# runtime dependencies here, as well as implicit dependencies with constrained -# versions. -# -# After editing, update inithome/requirements/main.txt by running: -# nox -s update-deps - -# inithome currently only requires modules that ship with Python. diff --git a/inithome/requirements/main.txt b/inithome/requirements/main.txt index 9b5cf2c23..44539f1b8 100644 --- a/inithome/requirements/main.txt +++ b/inithome/requirements/main.txt @@ -1,2 +1,2 @@ # This file was autogenerated by uv via the following command: -# uv pip compile --generate-hashes --universal --output-file inithome/requirements/main.txt inithome/requirements/main.in +# uv pip compile --generate-hashes --universal --output-file inithome/requirements/main.txt inithome/pyproject.toml diff --git a/noxfile.py b/noxfile.py index 29cc5108d..f9834f3e7 100644 --- a/noxfile.py +++ b/noxfile.py @@ -130,13 +130,19 @@ def _update_deps( # The JupyterHub Docker image may use a different Python version. if directory == "hub": command.extend(("-p", "3.12")) - - session.run( - *command, - "--output-file", - f"{directory}/requirements/main.txt", - f"{directory}/requirements/main.in", - ) + session.run( + *command, + "--output-file", + f"{directory}/requirements/main.txt", + f"{directory}/requirements/main.in", + ) + else: + session.run( + *command, + "--output-file", + f"{directory}/requirements/main.txt", + f"{directory}/pyproject.toml", + ) session.run( *command, "--output-file",