I feel like this is a bug—I’m trying to target the...
# general
b
I feel like this is a bug—I’m trying to target the
python_requirements
in the
__dependencies_rules__
but it doesn’t seem to work, no matter what I put in the rule-set. 🧵
1
👀 1
1
my rule:
Copy code
# This may only IMPORT ...
    __dependencies_rules__(
        (
            "*",  # applies to everything in this BUILD file
            "/**",  # may depend on anything in this subtree
            "reqs",
            "/reqs",
            "/shared_reqs",
            "//shared_reqs",
            "//:shared_reqs#gunicorn",
            "//:shared_reqs#*",
            "/src/libs/**", # may use `libs`
            allowed_dependencies,  # extra allowed dependencies
            "!*",  # may not depend on anything else
        ),
        ("*", "*"),
    )
BUILD
Copy code
# Default target of `<directory_name>`
python_sources()

# TODO config file for gunicorn so that staging & prod are diff
# README INSTALL PEX AND PANTS

pex_binary(
    # This determines the output of the binary.
    name="classifier-api",

    # The command to run.
    script="gunicorn",
    args=["<http://services.classifier.app:app|services.classifier.app:app>", "-w=1", "-b=0.0.0.0", "--log-level=debug"],

    # Essentially specifying the requirements.txt file.
    dependencies=[
        "//:shared_reqs#gunicorn", # need to explicitly add gunicorn because it's not part of imports.
        ":classifier" # need to add the "self" package so that it's included in the pex.
    ],
    environment="python_bullseye"
)

docker_image(
    context_root="",
    name="docker-classifier",
)
The error:
Copy code
* src/services/classifier/BUILD[!*] -> : DENY
    pex_binary src/services/classifier:classifier-api -> python_requirements //:shared_
reqs#gunicorn
folder structure:
Copy code
requirements.txt (shared_reqs)
BUILD
/src
  /services
     /classifier
         ...
     /search
         ...
  /libs
     /libA
     /libB
ah nvm I got it, the target is rather inconsistent… I had to use:
Copy code
"//shared_reqs#*",
👍 1
c
I think it gets more confusing with targets in the repo root, as there is an empty path component.