Skip to content

Commit

Permalink
Merge pull request #1643 from fpletz/fastapi-0.111
Browse files Browse the repository at this point in the history
feat: add support for fastapi 0.111
  • Loading branch information
cpcloud committed May 9, 2024
2 parents 1272865 + 633d962 commit 291a863
Show file tree
Hide file tree
Showing 8 changed files with 1,143 additions and 9 deletions.
1 change: 1 addition & 0 deletions known-build-systems.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"hatch-vcs",
"hatchling",
"pbr",
"pdm-backend",
"poetry-core",
"setuptools",
"setuptools-scm"
Expand Down
48 changes: 42 additions & 6 deletions overrides/build-systems.json
Original file line number Diff line number Diff line change
Expand Up @@ -6693,13 +6693,29 @@
"setuptools-scm"
],
"fastapi": [
"flit",
"hatchling",
"setuptools"
{
"buildSystem": "flit",
"until": "0.110.3"
},
{
"buildSystem": "hatchling",
"until": "0.110.3"
},
{
"buildSystem": "setuptools",
"until": "0.110.3"
},
{
"buildSystem": "pdm-backend",
"from": "0.110.3"
}
],
"fastapi-camelcase": [
"setuptools"
],
"fastapi-cli": [
"pdm-backend"
],
"fastapi-csrf-protect": [
"poetry-core"
],
Expand All @@ -6717,6 +6733,9 @@
"fastapi-sessions": [
"setuptools"
],
"fastapi-slim": [
"pdm-backend"
],
"fastapi-sso": [
"poetry",
"poetry-core"
Expand Down Expand Up @@ -9872,7 +9891,14 @@
"setuptools"
],
"jinja2": [
"setuptools"
{
"buildSystem": "setuptools",
"until": "3.1.4"
},
{
"buildSystem": "flit-core",
"from": "3.1.4"
}
],
"jinja2-ansible-filters": [
"setuptools"
Expand Down Expand Up @@ -24448,8 +24474,18 @@
"setuptools"
],
"typer": [
"flit-core",
"setuptools"
{
"buildSystem": "flit-core",
"until": "0.11.0"
},
{
"buildSystem": "setuptools",
"until": "0.11.0"
},
{
"buildSystem": "pdm-backend",
"from": "0.11.0"
}
],
"types-aioboto3": [
"setuptools"
Expand Down
8 changes: 6 additions & 2 deletions overrides/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@ let
}
);

notNull = x: !(builtins.isNull x);
removePackagesByName = packages: packagesToRemove:
let
namesToRemove = map lib.getName packagesToRemove;
namesToRemove = map lib.getName (lib.filter notNull packagesToRemove);
in
lib.filter (x: !(builtins.elem (lib.getName x) namesToRemove)) packages;

Expand Down Expand Up @@ -890,7 +891,9 @@ lib.composeManyExtensions [

fastapi = prev.fastapi.overridePythonAttrs (old: {
# fastapi 0.111 depends on fastapi-cli, which depends on fastapi, resulting in infinite recursion
propagatedBuildInputs = removePackagesByName (old.propagatedBuildInputs or [ ]) (lib.optionals (final ? fastapi-cli) [ final.fastapi-cli ]);
propagatedBuildInputs = removePackagesByName
(old.propagatedBuildInputs or [ ])
(lib.optionals (final ? fastapi-cli) [ final.fastapi-cli ]);
});

fastecdsa = prev.fastecdsa.overridePythonAttrs (old: {
Expand Down Expand Up @@ -1968,6 +1971,7 @@ lib.composeManyExtensions [
(
let
githubHash = {
"3.10.3" = "sha256-bK6wA8P/IXEbiuJAx7psd0nUUKjR1jX4scFfJr1MBAk=";
"3.8.10" = "sha256-XhOJAsF9HbyyKMU9o/f9Zl3+qYozk8tVQU8bkbXGAZs=";
"3.8.11" = "sha256-TFoagWUtd/nJceNaptgPp4aTR/tBCmxpiZIVJwOlia4=";
"3.8.12" = "sha256-/1NcXGYOjCIVsFee7qgmCjnYPJnDEtyHMKJ5sBamhWE=";
Expand Down
1 change: 1 addition & 0 deletions tests/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ in
use-url-wheel = callTest ./use-url-wheel { };
returns = callTest ./returns { };
option = callTest ./option { };
fastapi = callTest ./fastapi { };
fastapi-utils = callTest ./fastapi-utils { };
awscli = callTest ./awscli { };
assorted-pkgs = callTest ./assorted-pkgs { };
Expand Down
2 changes: 1 addition & 1 deletion tests/fastapi-utils/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions tests/fastapi/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{ poetry2nix, python3, runCommand }:
let
env = poetry2nix.mkPoetryEnv {
python = python3;
pyproject = ./pyproject.toml;
poetrylock = ./poetry.lock;
};
in
runCommand "fastapi-test" { } ''
${env}/bin/python -c 'import fastapi; print(fastapi.__version__)' > $out
''
Loading

0 comments on commit 291a863

Please sign in to comment.