0

I am building a Python package using setuptools in a pyproject.toml file. The package is being installed locally using pip install .

Is there a way to specify running a post-install Python script in the pyproject.toml file?

David Skarbrevik
  • 675
  • 3
  • 9
  • 19
  • 2
    This is no longer possible because the whole concept of having executable code as part of the installation step has been removed (well, phased out), see [comments in this question](https://stackoverflow.com/questions/75942420/run-post-install-on-pyproject-toml). – metatoaster May 24 '23 at 05:21
  • 1
    You could instead include an executable with your package and ask the user to run it, e.g. `pip install foo_bar; foo_bar init`. I'd personally prefer this to having some post-install-auto-execution. – Kache May 24 '23 at 05:50
  • I wanted to do a number of things with a post-install script but I have one specific scenario in a new question (it is not possible in my scenario to have the user directly run an executable) https://stackoverflow.com/questions/76325091/pyproject-toml-setuptools-edit-users-bashrc-file – David Skarbrevik May 24 '23 at 15:57

0 Answers0