Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide both Cython / non-Cython build PyPi project? #1325

Closed
littlebtc opened this issue Mar 19, 2020 · 3 comments
Closed

Provide both Cython / non-Cython build PyPi project? #1325

littlebtc opened this issue Mar 19, 2020 · 3 comments

Comments

@littlebtc
Copy link

littlebtc commented Mar 19, 2020

Feature Request

Output of python -c "import pydantic.utils; print(pydantic.utils.version_info())":

             pydantic version: 1.4
            pydantic compiled: False
                 install path: (skipped)
               python version: 3.7.3 (default, Dec 13 2019, 19:58:14)  [Clang 11.0.0 (clang-1100.0.33.17)]
                     platform: Darwin-19.3.0-x86_64-i386-64bit
     optional deps. installed: ['typing-extensions']

We are trying to use Pydantic in our website, currently using Django under AWS Lambda with Zappa. But the size of the compiled Cython binaries are considerably large, especially in the limited environment like serverless functions.

AWS had ~250MB hard limit on the total function size even if unzipped, and Cython version of Pydantic will eat up 25MB (~10%) for it.

But after investigation, it is hard to tell the Pip, Pipenv or Poetry to stick with wheel without Cython manylinux wheels. Although we can still stick with the non-Cython version by assigning wheel URL and hack Zappa to use it, we have to manually update wheel URL.

Can this package use similar technique like psycopg2 and psycopg2-binary to provide separate package with/without Cython, to make people with limited resources to install the package much more easier? Like pydantic and pydantic-pure.

@samuelcolvin
Copy link
Member

Just install using the git URL.

Something like:

pip install git+git://github.com/samuelcolvin/[email protected]

(On my phone so haven't tried it)

@samuelcolvin
Copy link
Member

we already include both in pypi, see here.

To install pydantic without binaries:

pip install --no-binary pydantic pydantic

@Zacharias030
Copy link

pip install --no-binary pydantic pydantic
doesn't work for me, but installing from git works.

The problem is that in the end of the installation some copying is missing, and the success message says
successfully installed pydantic (and then pip list doesn't have it), while a proper installation would show successfully installed pydantic=<VERSION>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants