<#18812 Execute setuptools command when using cust...
# github-notifications
c
#18812 Execute setuptools command when using custom setup.py file when building distribution. New discussion created by ktmlleska Hello all, I'm testing Pants as we are moving all our code to a monorepo. So far seems a very useful tool! I have a couple of questions though. We currently have our tools in multiple repositories, and we build them using setuptools. As we would like to slowly implement the monorepo and slowly move our build system to Poetry, as a first step, I would like to be able to make Pants create a working distribution using our current setup.py file. The problem I'm having is that I can't find any way to tell Pants that should also execute the custom setuptools command "build_plugin" defined in our setup.py file when creating the distribution. Is there anyway to do that? Thank you! This is how my very simple BUILD file looks like:
Copy code
python_sources(name="setuppy")

python_distribution(
    name="mydist",
    dependencies=[
        ":setuppy",
    ],
    provides=python_artifact(
        name="mydist",
        version="2.21.0",
    ),
    wheel=True,
    sdist=True,
    wheel_config_settings={"--global-option": ["--python-tag", "py37.py38.py39"]},
)
And the setup.py is something like:
Copy code
class BuildPlugin(setuptools.Command):
    .....

setup(
    name='maya_dist',
    setup_requires=[
     ....
    ],
    cmdclass={'build_plugin': BuildPlugin},
    zip_safe=False,
    .......
)
pantsbuild/pants