Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Equivalent of `python setup.py develop` in poetry

With setuptools, I could use python3 setup.py develop and my development directory could be found by python3 without setting PYTHONPATH or running install. Any change in the current development directory is immediately available without running python3 setup.py develop/install again. This saves quite a lot of time during the development.

Is there a poetry equivalent?

Update There is a feature request https://github.com/python-poetry/poetry/issues/1214

like image 929
Dilawar Avatar asked Dec 19 '20 22:12

Dilawar


People also ask

Does poetry use setup py?

You can add other poetry and setup.py managed project as dependencies in development mode with poetry add ../relative_path/to/package_folder. Installing a poetry managed project - or better: any project managed by pyproject.

Which Python does poetry use?

Poetry requires Python 2.7 or 3.5+. It is multi-platform and the goal is to make it work equally well on Windows, Linux and OSX. Python 2.7 and 3.5 will no longer be supported in the next feature release (1.2). You should consider updating your Python version to a supported one.

Is setup py outdated?

py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. I found a very detailed write-up explaining this issue: "Why you shouldn't invoke setup.py directly" (October 2021).

Is pip similar to poetry?

Poetry is a dependency management tool in Python projects (analogous to the built-in pip). It will be vital for beginners in Python to get acquainted with this tool, as it is a very simple and easy-to-use tool, the use of which can simplify the management and development of the project.


1 Answers

In poetry, the main project is installed as editable by default:

The current project is installed in editable mode by default.

-- Section "Installing dependencies only" of Poetry's documentation

It is also possible to install some dependencies as editable alongside the main project in the same virtual environment. For example:

[tool.poetry.dependencies]
Library = { path = "../Library/", develop = true }
like image 151
sinoroc Avatar answered Sep 22 '22 04:09

sinoroc