Git and dash tools usage to deploy on render (installation failed)

Hello All!
I’m trying to deploy multi pages dash app on render but failed.

I am using dash tools and Git to deal with deployment. But, seems Setup.py is deprecated.

Here are the logs from render,

==> It looks like we don't have access to your repo, but we'll try to clone it anyway.
==> Cloning from https://github.com/DSAGRO3F/microparticle_pollution_fossil_fuel
==> Checking out commit d32930685fc76fd7e549a9649a933672b0e3cefd in branch main
==> Installing Python version 3.10.0...
==> Using Python version 3.10.0 via environment variable PYTHON_VERSION
==> Docs on specifying a Python version: https://render.com/docs/python-version
==> Using Poetry version 1.7.1 (default)
==> Docs on specifying a Poetry version: https://render.com/docs/poetry-version
==> Running build command 'pip install -r requirements.txt'...
Collecting dash==2.14.2
  Downloading dash-2.14.2-py3-none-any.whl (10.2 MB)
Collecting dash_bootstrap_components==1.5.0
  Downloading dash_bootstrap_components-1.5.0-py3-none-any.whl (221 kB)
Collecting numpy==2.1.3
  Downloading numpy-2.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.3 MB)
Collecting pandas==2.2.3
  Downloading pandas-2.2.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.1 MB)
Collecting plotly==5.18.0
  Downloading plotly-5.18.0-py3-none-any.whl (15.6 MB)
Collecting gunicorn
  Downloading gunicorn-23.0.0-py3-none-any.whl (85 kB)
Collecting dash-tools
  Downloading dash_tools-1.12.0-py3-none-any.whl (4.7 MB)
Collecting ansi2html
  Downloading ansi2html-1.9.2-py3-none-any.whl (17 kB)
Requirement already satisfied: setuptools in ./.venv/lib/python3.10/site-packages (from dash==2.14.2->-r requirements.txt (line 1)) (57.4.0)
Collecting retrying
  Downloading retrying-1.3.4-py3-none-any.whl (11 kB)
Collecting requests
  Downloading requests-2.32.3-py3-none-any.whl (64 kB)
Collecting nest-asyncio
  Downloading nest_asyncio-1.6.0-py3-none-any.whl (5.2 kB)
Collecting typing-extensions>=4.1.1
  Downloading typing_extensions-4.12.2-py3-none-any.whl (37 kB)
Collecting dash-html-components==2.0.0
  Downloading dash_html_components-2.0.0-py3-none-any.whl (4.1 kB)
Collecting importlib-metadata
  Downloading importlib_metadata-8.5.0-py3-none-any.whl (26 kB)
Collecting Werkzeug<3.1
  Downloading werkzeug-3.0.6-py3-none-any.whl (227 kB)
Collecting dash-table==5.0.0
  Downloading dash_table-5.0.0-py3-none-any.whl (3.9 kB)
Collecting dash-core-components==2.0.0
  Downloading dash_core_components-2.0.0-py3-none-any.whl (3.8 kB)
Collecting Flask<3.1,>=1.0.4
  Downloading flask-3.0.3-py3-none-any.whl (101 kB)
Collecting python-dateutil>=2.8.2
  Downloading python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
Collecting tzdata>=2022.7
  Downloading tzdata-2024.2-py2.py3-none-any.whl (346 kB)
Collecting pytz>=2020.1
  Downloading pytz-2024.2-py2.py3-none-any.whl (508 kB)
Collecting tenacity>=6.2.0
  Downloading tenacity-9.0.0-py3-none-any.whl (28 kB)
Collecting packaging
  Downloading packaging-24.2-py3-none-any.whl (65 kB)
Collecting ruamel.yaml==0.17.21
  Downloading ruamel.yaml-0.17.21-py3-none-any.whl (109 kB)
Collecting setuptools
  Downloading setuptools-75.6.0-py3-none-any.whl (1.2 MB)
Collecting pipreqs==0.4.12
  Downloading pipreqs-0.4.12-py2.py3-none-any.whl (32 kB)
Collecting pytest==6.2.5
  Downloading pytest-6.2.5-py3-none-any.whl (280 kB)
Collecting pre-commit==2.16.0
  Downloading pre_commit-2.16.0-py2.py3-none-any.whl (191 kB)
Collecting yolk3k==0.9
  Downloading yolk3k-0.9.tar.gz (19 kB)
Collecting termcolor==1.1.0
  Downloading termcolor-1.1.0.tar.gz (3.9 kB)
Collecting visdcc==0.0.50
  Downloading visdcc-0.0.50.tar.gz (518 kB)
Collecting dash-iconify==0.1.2
  Downloading dash_iconify-0.1.2-py3-none-any.whl (18 kB)
Collecting packaging
  Downloading packaging-21.3-py3-none-any.whl (40 kB)
Collecting dash-mantine-components==0.12.0
  Downloading dash_mantine_components-0.12.0-py3-none-any.whl (496 kB)
Collecting pyparsing!=3.0.5,>=2.0.2
  Downloading pyparsing-3.2.0-py3-none-any.whl (106 kB)
Collecting docopt
  Downloading docopt-0.6.2.tar.gz (25 kB)
Collecting yarg
  Downloading yarg-0.1.10-py2.py3-none-any.whl (13 kB)
Collecting toml
  Downloading toml-0.10.2-py2.py3-none-any.whl (16 kB)
Collecting virtualenv>=20.0.8
  Downloading virtualenv-20.28.0-py3-none-any.whl (4.3 MB)
Collecting identify>=1.0.0
  Downloading identify-2.6.3-py2.py3-none-any.whl (99 kB)
Collecting pyyaml>=5.1
  Downloading PyYAML-6.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (751 kB)
Collecting nodeenv>=0.11.1
  Downloading nodeenv-1.9.1-py2.py3-none-any.whl (22 kB)
Collecting cfgv>=2.0.0
  Downloading cfgv-3.4.0-py2.py3-none-any.whl (7.2 kB)
Collecting iniconfig
  Downloading iniconfig-2.0.0-py3-none-any.whl (5.9 kB)
Collecting py>=1.8.2
  Downloading py-1.11.0-py2.py3-none-any.whl (98 kB)
Collecting pluggy<2.0,>=0.12
  Downloading pluggy-1.5.0-py3-none-any.whl (20 kB)
Collecting attrs>=19.2.0
  Downloading attrs-24.2.0-py3-none-any.whl (63 kB)
Collecting ruamel.yaml.clib>=0.2.6
  Downloading ruamel.yaml.clib-0.2.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (722 kB)
Collecting itsdangerous>=2.1.2
  Downloading itsdangerous-2.2.0-py3-none-any.whl (16 kB)
Collecting blinker>=1.6.2
  Downloading blinker-1.9.0-py3-none-any.whl (8.5 kB)
Collecting click>=8.1.3
  Downloading click-8.1.7-py3-none-any.whl (97 kB)
Collecting Jinja2>=3.1.2
  Downloading jinja2-3.1.4-py3-none-any.whl (133 kB)
Collecting MarkupSafe>=2.0
  Downloading MarkupSafe-3.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (20 kB)
Collecting six>=1.5
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting filelock<4,>=3.12.2
  Downloading filelock-3.16.1-py3-none-any.whl (16 kB)
Collecting distlib<1,>=0.3.7
  Downloading distlib-0.3.9-py2.py3-none-any.whl (468 kB)
Collecting platformdirs<5,>=3.9.1
  Downloading platformdirs-4.3.6-py3-none-any.whl (18 kB)
Collecting zipp>=3.20
  Downloading zipp-3.21.0-py3-none-any.whl (9.6 kB)
Collecting urllib3<3,>=1.21.1
  Downloading urllib3-2.2.3-py3-none-any.whl (126 kB)
Collecting idna<4,>=2.5
  Downloading idna-3.10-py3-none-any.whl (70 kB)
Collecting charset-normalizer<4,>=2
  Downloading charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (144 kB)
Collecting certifi>=2017.4.17
  Downloading certifi-2024.8.30-py3-none-any.whl (167 kB)
Using legacy 'setup.py install' for termcolor, since package 'wheel' is not installed.
Using legacy 'setup.py install' for visdcc, since package 'wheel' is not installed.
Using legacy 'setup.py install' for yolk3k, since package 'wheel' is not installed.
Using legacy 'setup.py install' for docopt, since package 'wheel' is not installed.
Installing collected packages: pyparsing, MarkupSafe, zipp, Werkzeug, urllib3, tenacity, six, packaging, Jinja2, itsdangerous, idna, click, charset-normalizer, certifi, blinker, typing-extensions, setuptools, retrying, requests, plotly, platformdirs, nest-asyncio, importlib-metadata, Flask, filelock, distlib, dash-table, dash-html-components, dash-core-components, ansi2html, yarg, virtualenv, tzdata, toml, ruamel.yaml.clib, pyyaml, pytz, python-dateutil, py, pluggy, numpy, nodeenv, iniconfig, identify, docopt, dash, cfgv, attrs, yolk3k, visdcc, termcolor, ruamel.yaml, pytest, pre-commit, pipreqs, pandas, gunicorn, dash-mantine-components, dash-iconify, dash-bootstrap-components, dash-tools
  Attempting uninstall: setuptools
    Found existing installation: setuptools 57.4.0
    Uninstalling setuptools-57.4.0:
      Successfully uninstalled setuptools-57.4.0
    Running setup.py install for docopt: started
    Running setup.py install for docopt: finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /opt/render/project/src/.venv/bin/python3.10 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-0zri4xxb/docopt_379a8b16b2dc40da9e1c7f4537c9f86c/setup.py'"'"'; __file__='"'"'/tmp/pip-install-0zri4xxb/docopt_379a8b16b2dc40da9e1c7f4537c9f86c/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-41lo35hu/install-record.txt --single-version-externally-managed --compile --install-headers /opt/render/project/src/.venv/include/site/python3.10/docopt
         cwd: /tmp/pip-install-0zri4xxb/docopt_379a8b16b2dc40da9e1c7f4537c9f86c/
    Complete output (41 lines):
    running install
    /opt/render/project/src/.venv/lib/python3.10/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
    !!
    
            ********************************************************************************
            Please avoid running ``setup.py`` directly.
            Instead, use pypa/build, pypa/installer or other
            standards-based tools.
    
            See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
            ********************************************************************************
    
    !!
      self.initialize_options()
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-0zri4xxb/docopt_379a8b16b2dc40da9e1c7f4537c9f86c/setup.py", line 6, in <module>
        setup(
      File "/opt/render/project/src/.venv/lib/python3.10/site-packages/setuptools/__init__.py", line 117, in setup
        return distutils.core.setup(**attrs)
      File "/opt/render/project/src/.venv/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 183, in setup
        return run_commands(dist)
      File "/opt/render/project/src/.venv/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 199, in run_commands
        dist.run_commands()
      File "/opt/render/project/src/.venv/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 954, in run_commands
        self.run_command(cmd)
      File "/opt/render/project/src/.venv/lib/python3.10/site-packages/setuptools/dist.py", line 995, in run_command
        super().run_command(command)
      File "/opt/render/project/src/.venv/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 972, in run_command
        cmd_obj.ensure_finalized()
      File "/opt/render/project/src/.venv/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
        self.finalize_options()
      File "/opt/render/project/src/.venv/lib/python3.10/site-packages/setuptools/command/install.py", line 80, in finalize_options
        super().finalize_options()
      File "/opt/render/project/src/.venv/lib/python3.10/site-packages/setuptools/_distutils/command/install.py", line 408, in finalize_options
        'dist_fullname': self.distribution.get_fullname(),
      File "/opt/render/project/src/.venv/lib/python3.10/site-packages/setuptools/_core_metadata.py", line 267, in get_fullname
        return _distribution_fullname(self.get_name(), self.get_version())
      File "/opt/render/project/src/.venv/lib/python3.10/site-packages/setuptools/_core_metadata.py", line 285, in _distribution_fullname
        canonicalize_version(version, strip_trailing_zero=False),
    TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'
    ----------------------------------------
ERROR: Command errored out with exit status 1: /opt/render/project/src/.venv/bin/python3.10 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-0zri4xxb/docopt_379a8b16b2dc40da9e1c7f4537c9f86c/setup.py'"'"'; __file__='"'"'/tmp/pip-install-0zri4xxb/docopt_379a8b16b2dc40da9e1c7f4537c9f86c/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-41lo35hu/install-record.txt --single-version-externally-managed --compile --install-headers /opt/render/project/src/.venv/include/site/python3.10/docopt Check the logs for full command output.
WARNING: You are using pip version 21.2.3; however, version 24.3.1 is available.
You should consider upgrading via the '/opt/render/project/src/.venv/bin/python3.10 -m pip install --upgrade pip' command.
==> Build failed 😞

I see use of toml file would be the way to overcome.
Do you already ran into issue like this one ? How did you manage?

Many thanks for your help !

I do not use dash-tools but in doing some digging it seems like the issue is related to using an old version of packaging

Collecting packaging
  Downloading packaging-21.3-py3-none-any.whl (40 kB)

I believe it needs to be packaging >= 22 What version of packaging is in you requirements.txt file?

Dash tools generates yaml file that set Python version=3.10.
My build is based on Python 3.12.
Making the correction in yaml file fixes the issue

Thank you for your help!!:wink: