TriggerMail / rules_pyz

Bazel Python rules that package everything in an executable zip
Apache License 2.0
29 stars 19 forks source link

Missing mandatory provider 'PyZProvider' for some packages. #45

Closed gfl-chris closed 6 years ago

gfl-chris commented 6 years ago

Got the following error when trying to use the generated rules:

.../third_party/pypi/BUILD:2:1: in deps attribute of pyz_library rule //third_party/pypi:pyyaml: '//third_party/pypi:pypi_pyyaml' does not have mandatory providers: 'PyZProvider'. Since this rule was created by the macro 'pypi_libraries', the error might have been caused by the macro implementation in .../third_party/pypi/pypi_rules.bzl:87:14

Here are the relevant parts from the generated pypi_rules.bzl:

    pyz_library(
        name="itsdangerous",
        deps=[
        ] + ["@pypi_itsdangerous//:lib"],
        licenses=["notice"],
        visibility=["//visibility:public"],
    )
    if "pypi_itsdangerous" not in existing_rules:
        http_archive(
            name="pypi_itsdangerous",
            url="https://pypi.org/itsdangerous-0.24-cp27-none-any.whl",
            sha256="11dee8cc20825929c37f9686c16abd734ac774539aedad2de53a59287f4f5a54",
            build_file_content=_BUILD_FILE_CONTENT,
            type="zip",
        )

itsdangerous is a transitive dependency of flask:

    pyz_library(
        name="flask",
        deps=[
            "jinja2",
            "werkzeug",
            "click",
            "itsdangerous",
        ] + ["@pypi_flask//:lib"],
        licenses=["notice"],
        visibility=["//visibility:public"],
    )

This is how I ran the generator:

$ bazel-bin/external/com_bluecore_rules_pyz/pypi/pip_generate_wrapper -requirements requirements.txt     -outputDir third_party/pypi -wheelDir wheels
running pip to resolve dependencies ...
pip executed in 16.615124315s
wheeltool Flask-1.0.2-py2.py3-none-any.whl took 95.653503ms
wheeltool Flask_Cors-3.0.6-py2.py3-none-any.whl took 86.202392ms
wheeltool Flask_RESTful-0.3.6-py2.py3-none-any.whl took 82.261811ms
wheeltool Flask_Testing-0.7.1-cp27-none-any.whl took 86.673202ms
wheeltool Jinja2-2.10-py2.py3-none-any.whl took 87.465609ms
wheeltool Logentries-0.17-cp27-none-any.whl took 89.884904ms
wheeltool MarkupSafe-1.0-cp27-cp27mu-linux_x86_64.whl took 82.824924ms
wheeltool PyYAML-3.13-cp27-cp27mu-linux_x86_64.whl took 85.953027ms
wheeltool Werkzeug-0.14.1-py2.py3-none-any.whl took 90.921861ms
wheeltool aniso8601-3.0.2-py2.py3-none-any.whl took 86.62658ms
wheeltool arrow-0.12.1-py2.py3-none-any.whl took 87.37365ms
wheeltool backports.functools_lru_cache-1.5-py2.py3-none-any.whl took 84.239788ms
wheeltool bearfield-1.9.6-cp27-none-any.whl took 96.696084ms
wheeltool boto3-1.6.7-py2.py3-none-any.whl took 85.727373ms
wheeltool botocore-1.9.7-py2.py3-none-any.whl took 95.211566ms
wheeltool cassandra_driver-3.15.1-cp27-cp27mu-linux_x86_64.whl took 87.947339ms
wheeltool certifi-2018.8.24-py2.py3-none-any.whl took 82.744718ms
wheeltool chardet-3.0.4-py2.py3-none-any.whl took 86.263699ms
wheeltool click-6.7-py2.py3-none-any.whl took 91.391886ms
wheeltool clickclick-1.2.2-py2.py3-none-any.whl took 90.360049ms
wheeltool connexion-1.5.2-py2.py3-none-any.whl took 114.937781ms
wheeltool core_common-1.1.6.dev7-py2-none-any.whl took 82.621371ms
wheeltool core_lib_settings-2.1.1.dev6-py2-none-any.whl took 88.013349ms
wheeltool core_wsgi_common-1.1.9.dev39-py2-none-any.whl took 86.271815ms
wheeltool docutils-0.14-py2-none-any.whl took 90.591291ms
wheeltool era-1.1-cp27-none-any.whl took 83.612167ms
wheeltool functools32-3.2.3.post2-cp27-none-any.whl took 86.50944ms
wheeltool futures-3.2.0-py2-none-any.whl took 87.384391ms
wheeltool idna-2.7-py2.py3-none-any.whl took 87.128061ms
wheeltool inflection-0.3.1-cp27-none-any.whl took 85.831837ms
wheeltool itsdangerous-0.24-cp27-none-any.whl took 84.930344ms
wheeltool jmespath-0.9.3-py2.py3-none-any.whl took 85.070591ms
wheeltool jsonschema-2.6.0-py2.py3-none-any.whl took 87.642502ms
wheeltool lumberjack-0.0.1.dev58-py2-none-any.whl took 86.077702ms
wheeltool marshmallow-2.15.4-py2.py3-none-any.whl took 85.888258ms
wheeltool pathlib-1.0.1-cp27-none-any.whl took 86.853153ms
wheeltool pymongo-3.7.1-cp27-cp27mu-manylinux1_x86_64.whl took 95.765067ms
wheeltool pymongo-3.7.1-cp27-cp27m-macosx_10_13_intel.whl took 95.821527ms
wheeltool python_dateutil-2.7.3-py2.py3-none-any.whl took 82.408511ms
wheeltool python_json_logger-0.1.9-py2.py3-none-any.whl took 87.68203ms
wheeltool pytz-2018.5-py2.py3-none-any.whl took 90.02105ms
wheeltool requests-2.19.1-py2.py3-none-any.whl took 88.329245ms
wheeltool rollbar-0.14.4-cp27-none-any.whl took 81.104007ms
wheeltool s3transfer-0.1.13-py2.py3-none-any.whl took 91.52873ms
wheeltool setuptools-40.2.0-py2.py3-none-any.whl took 98.4868ms
wheeltool six-1.11.0-py2.py3-none-any.whl took 84.668683ms
wheeltool swagger_spec_validator-2.4.0-py2.py3-none-any.whl took 84.809537ms
wheeltool typing-3.6.6-py2-none-any.whl took 87.294736ms
wheeltool tzlocal-1.5.1-cp27-none-any.whl took 87.637275ms
wheeltool ujson-1.35-cp27-cp27mu-linux_x86_64.whl took 84.913026ms
wheeltool urllib3-1.23-py2.py3-none-any.whl took 91.884517ms
joshburkart commented 6 years ago

Sounds like a bug in pip_generate.go! Can you figure out what the problem is?

gfl-chris commented 6 years ago

Thanks for the quick response. Sure, let me take a look. :D

gfl-chris commented 6 years ago

Duplicate of #33.

gfl-chris commented 6 years ago

If I move wheel dependencies from deps to wheels for all libraries, everything looks to work.

gfl-chris commented 6 years ago

I take that back. Wheels aren't unzipped into the image. :/