question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support generation of poetry manged setup.py file

See original GitHub issue
  • I have searched the issues of this repo and believe that this is not a duplicate.

Issue

As things stand today, poetry packages cannot be installed using pip or any other package managers from a VCS. This is useful when working with unreleased/unpublished versions of dependencies, where dependencies are managed by ‘pip’ or another tool. This was briefly touched on in #34 for a similar use case.

With this in mind, it could be great if poetry provided a solution, in a limited capacity, similar to what is implemented by poetry-setup. In order to achieve this, poetry could provide a command, eg: poetry setuptools:setupfile, that generates a usable setup.py file using the mechanism used today by SdistBuilder.

In theory, this could be migrated to be a plugin once #693 is implemented.

As an example. this, if implemented, could be used by projects as a pre-commit hook to generate setup.py file on commit. This should allow projects using pip etc. to install unpublished projects developed using poetry (if the maintainer wants it).

In addition to the above use case, this also allows for tools like PyCharm etc., to auto detect requirements and metadata.

Can follow this up with a proposed implementation PR.

Relates-to: #34

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:50
  • Comments:44 (13 by maintainers)

github_iconTop GitHub Comments

59reactions
stevegorecommented, Aug 14, 2019

dephell will do this for you:

dephell deps convert --from pyproject.toml --from-format poetry --to setup.py --to-format setuppy

Or you can add this to pyproject.toml and just run dephell deps convert:

[tool.dephell.main]
from = {format = "poetry", path = "pyproject.toml"}
to = {format = "setuppy", path = "setup.py"}
22reactions
kolyptocommented, Sep 9, 2020

In fact, poetry generates a setup.py when you build the project, and places it into one of the dist/*.tar.gz files 😃 Let’s extract it:

$ poetry build
$ tar -xvf dist/*.tar.gz --wildcards --no-anchored '*/setup.py' --strip=1

now your poetry project is pip-editable 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Package Python Projects the Proper Way with Poetry
Poetry goes far beyond dependencies, with features like generating .lock files, generating project scaffolding, and a ton of configuration ...
Read more >
The pyproject.toml file | Documentation | Poetry
Poetry supports the use of PyPI and private repositories for discovery of packages as well as for publishing your projects. By default, Poetry...
Read more >
Python packaging and dependency management using poetry
Poetry helps you declare, manage and install dependencies of Python projects, ensuring you have the right stack everywhere. Install dependencies and create ...
Read more >
Packaging Python Projects
This tutorial walks you through how to package a simple Python project. It will show you how to add the necessary files and...
Read more >
Python package built with Poetry does not install supporting ...
I'm writing a Python package (assume it's "mypkg") and using Poetry to build the distributable wheel/tar.gz files for installation by the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found