https://pantsbuild.org/ logo
f

fresh-account-42296

12/08/2021, 2:06 PM
Hi, I joined this channel with a very specific question in mind. Brief background: I inherited the project I am currently working on from former colleagues and stumbled into the following issue yesterday: There is a custom subsystem defined in our project with specified
default_extra_requirements
and
default_version
. My question would be: is there a way that these packages are automatically detected by pants' dependency resolution? Or is it inevitable to define these requirements again in the "requirements.txt" file? Hopefully, my question makes sense and I put it at the right place 😇
h

hundreds-father-404

12/08/2021, 6:39 PM
Hello, welcome! So with Pants, tools are installed separately from your own user requirements. For example, Pants installs the Black formatter for you without you needing it in requirements.txt Which requirement is this? I'm wondering what the issue is that y'all are running into
f

fresh-account-42296

12/08/2021, 7:17 PM
Hi Eric, many thanks for your answer. We defined a sphinx subsystem to use the sphinx tool. It is defined as follows:
Copy code
from pants.backend.python.subsystems.python_tool_base import PythonToolBase
from pants.backend.python.target_types import EntryPoint


class Sphinx(PythonToolBase):
    help = """The Sphinx documentation generator."""
    options_scope = "sphinx"
    default_version = "sphinx>=3.4.3,<4"
    default_extra_requirements = [
        "rst2pdf>=0.98,<0.99",
        "svglib>=1.1.0",
        "docutils<0.18",
    ]
    default_main = EntryPoint(module="sphinx.cmd.build", function="main")
    register_interpreter_constraints = True
    default_interpreter_constraints = ["CPython>=3.7"]
the default extra requirements are not picked up by pants when we run
./pants dependencies --type=3rdparty ::
so we were wondering if it is necessary to additionally include them in the requirements.txt file?
Does this make sense?
h

happy-kitchen-89482

12/08/2021, 8:02 PM
For context, which Pants version is this?
f

fresh-account-42296

12/09/2021, 6:57 AM
Currently, we are still running pants v2.5 but plan to upgrade to 2.8 in the upcoming days
8 Views