Skip to content

Commit

Permalink
Merge pull request #1080 from lsst-sqre/tickets/DM-46019
Browse files Browse the repository at this point in the history
DM-46019: Move dependencies, use universal dependencies
  • Loading branch information
rra authored Aug 28, 2024
2 parents b11b7d8 + 0f19bf0 commit 3dafc5a
Show file tree
Hide file tree
Showing 9 changed files with 487 additions and 410 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.1
rev: v0.6.2
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand All @@ -23,7 +23,7 @@ repos:
args: [-l, '79', -t, py312]

- repo: https://github.com/pre-commit/mirrors-eslint
rev: v9.9.0
rev: v9.9.1
hooks:
- id: eslint
additional_dependencies:
Expand Down
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,21 @@ update-deps:
pip install --upgrade pip uv
uv pip install --upgrade pre-commit
pre-commit autoupdate
uv pip compile --upgrade --generate-hashes \
--output-file requirements/main.txt requirements/main.in
uv pip compile --upgrade --generate-hashes \
uv pip compile --upgrade --generate-hashes --universal \
--output-file requirements/main.txt pyproject.toml
uv pip compile --upgrade --generate-hashes --universal \
--output-file requirements/dev.txt requirements/dev.in
uv pip compile --upgrade --generate-hashes \
uv pip compile --upgrade --generate-hashes --universal \
--output-file requirements/tox.txt requirements/tox.in
cd ui && npm upgrade --legacy-peer-deps

# Useful for testing against a Git version of Safir.
.PHONY: update-deps-no-hashes
update-deps-no-hashes:
pip install --upgrade uv
uv pip compile --upgrade \
--output-file requirements/main.txt requirements/main.in
uv pip compile --upgrade \
uv pip compile --upgrade --universal \
--output-file requirements/main.txt pyproject.toml
uv pip compile --upgrade --universal \
--output-file requirements/dev.txt requirements/dev.in
uv pip compile --upgrade \
uv pip compile --upgrade --universal \
--output-file requirements/tox.txt requirements/tox.in
37 changes: 32 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,36 @@ classifiers = [
"Typing :: Typed",
]
requires-python = ">=3.12"
dependencies = []
dependencies = [
# FastAPI including some optional features
"fastapi",
"python-multipart",
"starlette",
"uvicorn[standard]",
# Other dependencies
"alembic[tz]",
"asyncpg",
"bonsai>=1.5.0",
"cachetools",
"click>8.1.4",
"cryptography",
"google-cloud-firestore",
"httpx",
"kopf",
"kubernetes-asyncio",
"jinja2",
"opentelemetry-api",
"opentelemetry-exporter-otlp-proto-grpc",
"opentelemetry-sdk",
"pydantic>2",
"pydantic-settings",
"pyjwt",
"pyyaml",
"redis>=4.2.0",
"safir[db,kubernetes]>=6.2.0",
"sqlalchemy",
"structlog",
]
dynamic = ["version"]

[[project.authors]]
Expand All @@ -36,16 +65,12 @@ Source = "https://github.com/lsst-sqre/gafaelfawr"
[build-system]
requires = [
"setuptools>=61",
"wheel",
"setuptools_scm[toml]>=6.2",
]
build-backend = "setuptools.build_meta"

[project.scripts]
gafaelfawr = "gafaelfawr.cli:main"

[tool.setuptools_scm]

[tool.black]
line-length = 79
target-version = ["py312"]
Expand Down Expand Up @@ -165,3 +190,5 @@ format = "md"
md_header_level = "2"
new_fragment_template = "file:changelog.d/_template.md.jinja"
skip_fragments = "_template.md.jinja"

[tool.setuptools_scm]
362 changes: 199 additions & 163 deletions requirements/dev.txt

Large diffs are not rendered by default.

202 changes: 104 additions & 98 deletions requirements/main.txt

Large diffs are not rendered by default.

69 changes: 45 additions & 24 deletions requirements/tox.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file was autogenerated by uv via the following command:
# uv pip compile --generate-hashes --output-file requirements/tox.txt requirements/tox.in
# uv pip compile --generate-hashes --universal --output-file requirements/tox.txt requirements/tox.in
cachetools==5.5.0 \
--hash=sha256:02134e8439cdc2ffb62023ce1debca2944c3f289d66bb17ead3ab3dede74b292 \
--hash=sha256:2cc24fb4cbe39633fb7badd9db9ca6295d766d9c2995f245725a46715d050f2a
Expand Down Expand Up @@ -115,7 +115,10 @@ charset-normalizer==3.3.2 \
colorama==0.4.6 \
--hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \
--hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6
# via tox
# via
# -c requirements/dev.txt
# -c requirements/main.txt
# tox
distlib==0.3.8 \
--hash=sha256:034db59a0b96f8ca18035f36290806a9a6e6bd9d1ff91e45a7f172eb17e51784 \
--hash=sha256:1530ea13e350031b6312d8580ddb6b27a104275a31106523b8f123787f494f64
Expand All @@ -130,9 +133,9 @@ filelock==3.15.4 \
# via
# tox
# virtualenv
idna==3.7 \
--hash=sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc \
--hash=sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0
idna==3.8 \
--hash=sha256:050b4e5baadcd44d760cedbd2b8e639f2ff89bbc7a5730fcc662954303377aac \
--hash=sha256:d838c2c0ed6fced7693d5e8ab8e734d5f8fda53a039c0164afb0b82e771e3603
# via
# -c requirements/dev.txt
# -c requirements/main.txt
Expand Down Expand Up @@ -162,6 +165,24 @@ pyproject-api==1.7.1 \
--hash=sha256:2dc1654062c2b27733d8fd4cdda672b22fe8741ef1dde8e3a998a9547b071eeb \
--hash=sha256:7ebc6cd10710f89f4cf2a2731710a98abce37ebff19427116ff2174c9236a827
# via tox
pywin32==306 ; sys_platform == 'win32' \
--hash=sha256:06d3420a5155ba65f0b72f2699b5bacf3109f36acbe8923765c22938a69dfc8d \
--hash=sha256:1c73ea9a0d2283d889001998059f5eaaba3b6238f767c9cf2833b13e6a685f65 \
--hash=sha256:37257794c1ad39ee9be652da0462dc2e394c8159dfd913a8a4e8eb6fd346da0e \
--hash=sha256:383229d515657f4e3ed1343da8be101000562bf514591ff383ae940cad65458b \
--hash=sha256:39b61c15272833b5c329a2989999dcae836b1eed650252ab1b7bfbe1d59f30f4 \
--hash=sha256:5821ec52f6d321aa59e2db7e0a35b997de60c201943557d108af9d4ae1ec7040 \
--hash=sha256:70dba0c913d19f942a2db25217d9a1b726c278f483a919f1abfed79c9cf64d3a \
--hash=sha256:72c5f621542d7bdd4fdb716227be0dd3f8565c11b280be6315b06ace35487d36 \
--hash=sha256:84f4471dbca1887ea3803d8848a1616429ac94a4a8d05f4bc9c5dcfd42ca99c8 \
--hash=sha256:a7639f51c184c0272e93f244eb24dafca9b1855707d94c192d4a0b4c01e1100e \
--hash=sha256:e25fd5b485b55ac9c057f67d94bc203f3f6595078d1fb3b458c9c28b7153a802 \
--hash=sha256:e4c092e2589b5cf0d365849e73e02c391c1349958c5ac3e9d5ccb9a28e017b3a \
--hash=sha256:e65028133d15b64d2ed8f06dd9fbc268352478d4f9289e69c190ecd6818b6407 \
--hash=sha256:e8ac1ae3601bee6ca9f7cb4b5363bf1c0badb935ef243c4733ff9a393b1690c0
# via
# -c requirements/dev.txt
# docker
requests==2.32.3 \
--hash=sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760 \
--hash=sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6
Expand Down Expand Up @@ -192,25 +213,25 @@ urllib3==2.2.2 \
# -c requirements/main.txt
# docker
# requests
uv==0.3.0 \
--hash=sha256:084551ee0743339aa5d0d4c76a94c9f9df16c33030b850f0cd98f316db7b42cc \
--hash=sha256:0da4f060d583325846cde0727a8cc0cb4e8c63b30ac9373dae213a7315056d90 \
--hash=sha256:160a1f3b01298942d6cfe21f95a9b7daa3eb73231ba1fc4689157eb9f23b3438 \
--hash=sha256:21ebc6ca30df7ff57a8e17e3abeeba8a9d1d4ac79c1adf842fa42d48a5c7f372 \
--hash=sha256:24a1388f5e285058f97576b7dfee79bb5007a712a9e368f3fcdcfeb2dfd9ce92 \
--hash=sha256:2f937ebdf9976ec1ffe7228fd608ef3e6ce2a61ed68cf7b157ae6900a9c80f41 \
--hash=sha256:39a4276afe0808ca6c033e0cd6cb73249f934b4a0c9d7b18a944f3f8ea635e27 \
--hash=sha256:3b62e44f61a154303fc9f4aa87ae54891957d49769d21dcf2be9c22e640c3e92 \
--hash=sha256:4303364d717b1def58e82b11271259d2ee3bb03da0ca6111819ee254f65b38f4 \
--hash=sha256:503fc619238550be222b41422b415677c9b8045c92a9815f80ff5d7477671fe6 \
--hash=sha256:52b3a6110705ff27462ddc68657fedf8a296ed545619a90fa73354f130ad632e \
--hash=sha256:5c826d9daace67d67790503b0c1152093b3cecd35a91de10f5bb9e26afea9de9 \
--hash=sha256:6d1025349cbaeba9a974d413795d0ce8d37de5ad7fb7654c0519968b2c083ba1 \
--hash=sha256:a15b2321444f3668bc95863d2b13ce44ea54053189427ea48d112ecd8b3d2f89 \
--hash=sha256:a71b7080ee6d7658b22f93aa750cbfd19111cd6c8ac643a73d6778598dd06559 \
--hash=sha256:b44ebf501de5eef33e4f3cf4b6ea9a458d1f1b3cf26737c25ac507ab7914076a \
--hash=sha256:d3da56b87ec5aa4f2ae572127c754655bad3820dd41a4d37ed4d5e2f67035990 \
--hash=sha256:d87ff76da5128036c05db0291db7510a85cb8efb86538e8f49adc8074bb292f0
uv==0.3.5 \
--hash=sha256:07bd680a570245c44da0800bed98ef01bfed6549832ae3b364e9c289afa6f76b \
--hash=sha256:1ef68f64a9232cb71a46f33b506ce14cb31c54d5385d47ee1202f17d300e40df \
--hash=sha256:420cabd5fa42f23e3abd0a4e43e3e84af9790f8c847b4306b7325a882356f94c \
--hash=sha256:47faf95c3da64c3a819cc3e5b7d660d990c01ec248a588848426c4ab1e40bcb2 \
--hash=sha256:4c89dd183389c297393b203172e9d72e7d2f2309eead950c9749240700817e98 \
--hash=sha256:4f379d8748020ed8233a6681dcbb26e79eb8a8a7310d2dbd1e0de04e780c18ba \
--hash=sha256:585a91a05250e2d800f7614e77c09ba16fa1d3014ec092dac05ec2ea232d489f \
--hash=sha256:59f10007b4c52ed132e6a87fc39f487dfec90835b46678365f4f3e67caab3c02 \
--hash=sha256:7eb2e8bba1301efe43f929c33ba1c49975d314028feba4ec91d3da633629c74e \
--hash=sha256:7fffe2e209c7059522b3221d940356b24dc8036bcde2801de081e7e9c5cc5c4a \
--hash=sha256:80243b411ce791d1c2656d148d9d2e3553cd71eb9812ed559a3f1c1384afb571 \
--hash=sha256:89c1515200a838014b1fa6c9cfb2b9a055bcad3178ccf7d31768bf38b43cac65 \
--hash=sha256:8a95ec9d9dcd3aad62c4a64d087ce953c2f733b27c50793c022bcc3cb9b17d92 \
--hash=sha256:9190ac2266076e6c63d3113bca5d047742e90406d763bf9ba5db7bac9ab9e4a5 \
--hash=sha256:cac04fce16fed8d7626dcd32b9e07c0475eb0266f858328f2de398802c1fc9af \
--hash=sha256:cdab52c5c1ed97805f2b4d7648615e10a823f8c5497207d5f14f5b6062c4798b \
--hash=sha256:e1dac7bd4ca2bd6d11ed4e43523e040ef9ed1cde2cd376eb6b1c61e64f636e95 \
--hash=sha256:e7b8f8e35e6f8245dc7831b499dd6b7a71d94b6862b8225f2245fb59ef4f9825
# via tox-uv
virtualenv==20.26.3 \
--hash=sha256:4c43a2a236279d9ea36a0d76f98d84bd6ca94ac4e0f4a3b9d46d05e10fea542a \
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async def app(
async def client(app: FastAPI) -> AsyncIterator[AsyncClient]:
"""Return an ``httpx.AsyncClient`` configured to talk to the test app."""
base_url = f"https://{TEST_HOSTNAME}"
transport = ASGITransport(app=app) # type: ignore[arg-type]
transport = ASGITransport(app=app)
async with AsyncClient(transport=transport, base_url=base_url) as client:
yield client

Expand Down
5 changes: 1 addition & 4 deletions tests/handlers/internal_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ async def test_health(
async with factory.session.begin():
await factory.session.execute(text("DROP TABLE token CASCADE"))
base_url = f"https://{TEST_HOSTNAME}"
transport = ASGITransport(
app=app, # type: ignore[arg-type]
raise_app_exceptions=False,
)
transport = ASGITransport(app=app, raise_app_exceptions=False)
async with AsyncClient(transport=transport, base_url=base_url) as c:
r = await c.get("/health")
assert r.status_code == 500
Loading

0 comments on commit 3dafc5a

Please sign in to comment.