Any idea why PEX fetches everything including extr...
# general
r
Any idea why PEX fetches everything including extra for a given package even when we aren’t asking for it? This is inside a docker image where I am trying to run a lambda.
Copy code
[ERROR] ResolveError: Failed to resolve requirements from PEX environment @ /tmp/tmpoa40lyqx/unzipped_pexes/4185e0a7af669dc757e04bdb6559435de125a6db.
Needed cp39-cp39-manylinux_2_26_x86_64 compatible dependencies for:
1: orjson<4.0.0,>=3.2.1; extra == "all"
Required by: fastapi 0.86.0
But this pex had no ProjectName(raw='orjson', normalized='orjson') distributions.
1
c
The range seems consistent with the requirement from fastapi, but indeed I don’t see that fastapi is asking for “extra all” (unless I’m reading this wrong https://github.com/tiangolo/fastapi/blob/0.86.0/pyproject.toml#L96-L106 )
🤷
do you have a lockfile with orjson in it? what does that look like?
r
Copy code
{
          "artifacts": [
            {
              "algorithm": "sha256",
              "hash": "1020d7ca205d8b95813881fb3282e9c3656e47993531af3aa4ae11065b61dd2c",
              "url": "<https://files.pythonhosted.org/packages/7b/d6/aa8078112b5bd15b716bb431b25f00e5befc23a05cb3fa66ca4e425b6682/fastapi-0.86.0-py3-none-any.whl>"
            },
            {
              "algorithm": "sha256",
              "hash": "cdcaff84ecf7ae939b9579f0c98b0a0989ee3dd855710a32bc985260d92612f6",
              "url": "<https://files.pythonhosted.org/packages/3d/c4/0cbe3b1213cdb4b3dd8692ed30788b01bf49d88d71afcb1c296a608f6029/fastapi-0.86.0.tar.gz>"
            }
          ],
          "project_name": "fastapi",
          "requires_dists": [
            "anyio[trio]<4.0.0,>=3.2.1; extra == \"test\"",
            "autoflake<2.0.0,>=1.4.0; extra == \"dev\"",
            "black==22.8.0; extra == \"test\"",
            "coverage[toml]<7.0,>=6.5.0; extra == \"test\"",
            "databases[sqlite]<0.7.0,>=0.3.2; extra == \"test\"",
            "email-validator<2.0.0,>=1.1.1; extra == \"all\"",
            "email-validator<2.0.0,>=1.1.1; extra == \"test\"",
            "flake8<6.0.0,>=3.8.3; extra == \"dev\"",
            "flake8<6.0.0,>=3.8.3; extra == \"test\"",
            "flask<3.0.0,>=1.1.2; extra == \"test\"",
            "httpx<0.24.0,>=0.23.0; extra == \"test\"",
            "isort<6.0.0,>=5.0.6; extra == \"test\"",
            "itsdangerous<3.0.0,>=1.1.0; extra == \"all\"",
            "jinja2<4.0.0,>=2.11.2; extra == \"all\"",
            "mdx-include<2.0.0,>=1.4.1; extra == \"doc\"",
            "mkdocs-markdownextradata-plugin<0.3.0,>=0.1.7; extra == \"doc\"",
            "mkdocs-material<9.0.0,>=8.1.4; extra == \"doc\"",
            "mkdocs<2.0.0,>=1.1.2; extra == \"doc\"",
            "mypy==0.982; extra == \"test\"",
            "orjson<4.0.0,>=3.2.1; extra == \"all\"",
            "orjson<4.0.0,>=3.2.1; extra == \"test\"",
            "passlib[bcrypt]<2.0.0,>=1.7.2; extra == \"test\"",
            "peewee<4.0.0,>=3.13.3; extra == \"test\"",
            "pre-commit<3.0.0,>=2.17.0; extra == \"dev\"",
            "pydantic!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0,>=1.6.2",
            "pytest<8.0.0,>=7.1.3; extra == \"test\"",
            "python-jose[cryptography]<4.0.0,>=3.3.0; extra == \"test\"",
            "python-multipart<0.0.6,>=0.0.5; extra == \"all\"",
            "python-multipart<0.0.6,>=0.0.5; extra == \"test\"",
            "pyyaml<7.0.0,>=5.3.1; extra == \"all\"",
            "pyyaml<7.0.0,>=5.3.1; extra == \"doc\"",
            "pyyaml<7.0.0,>=5.3.1; extra == \"test\"",
            "requests<3.0.0,>=2.24.0; extra == \"all\"",
            "requests<3.0.0,>=2.24.0; extra == \"test\"",
            "sqlalchemy<=1.4.41,>=1.3.18; extra == \"test\"",
            "starlette==0.20.4",
            "typer[all]<0.7.0,>=0.6.1; extra == \"doc\"",
            "types-orjson==3.6.2; extra == \"test\"",
            "types-ujson==5.5.0; extra == \"test\"",
            "ujson!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0,<6.0.0,>=4.0.1; extra == \"all\"",
            "ujson!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0,<6.0.0,>=4.0.1; extra == \"test\"",
            "uvicorn[standard]<0.19.0,>=0.12.0; extra == \"all\"",
            "uvicorn[standard]<0.19.0,>=0.12.0; extra == \"dev\""
          ],
          "requires_python": ">=3.7",
          "version": "0.86"
        },
I will try generating the lock file again, in case I messed up something
c
what I think this meansy
"orjson<4.0.0,>=3.2.1; extra == \"all\"",
is that if you have
fastapi[all]
it will include orjson, so do you have any extras for
fastapi
in your requirments?
r
Actually I realized that there were other packages which are pulling these dependencies.
✔️ 1