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.

Distinguish between libraries and applications

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

Feature Request

When you have a pure application, e.g. a package which is intended not to be imported by other packages, but only to be executed directly (e.g. CLI application, a web service, some GUI program), it would be nice to have reliable installations at the client.

For reliable installations, it is important that the dependencies (including transitive ones) are pinned. They are pinned in the poetry.lock file, but that file is not uploaded / used when a package built with poetry, uploaded to PyPI.org is installed via pip.

My suggestion is:

  • Within [tool.poetry], add is-pure-application: true / false or similar (never-included? no-library?)
  • When this attribute is present and true, then poetry adds the transitive dependencies to the shipped setup.py file
  • Then, when installed via pipx, one can be absolutely certain about what is installed and have way more control about the environment.

I’m uncertain, however, how to deal with the “normal” pip which does not create a virtual environment for such a package. That would be problematic.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
finswimmercommented, Nov 8, 2020

From my point of view, what would make more sense would be to instruct poetry build to write the pinned dependencies as Requires-Dist in the distributions.

There is a feature request for this: https://github.com/python-poetry/poetry/issues/2778

But I’m with you @sinoroc that this is a good way to shoot yourself in the foot 😃

@MartinThoma: I will close your issue as a more or less duplicate of #2778. Feel free to leave a comment if you disagree with it.

1reaction
sinoroccommented, Nov 6, 2020

I get the general idea, but the suggested method does not make sense to me.

From my point of view, what would make more sense would be to instruct poetry build to write the pinned dependencies as Requires-Dist in the distributions.

This is typically the kind of things I would like to see implemented as a plugin, not necessarily part of poetry proper. Because this seems like one nice way to shoot yourself in the foot, if you pin everything in the distributions without knowing what you are doing.

I’m uncertain, however, how to deal with the “normal” pip which does not create a virtual environment for such a package. That would be problematic.

This does not seem feasible. I do not see what role pip would play in that. I’d rather recommend another plugin that would output a zipapp containing pinned dependencies.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Difference between library and application code?
Library's code is intended to be reusable, application's code usually not. Keep code in a library when it is not tied specifically to...
Read more >
Understanding the difference between libraries and applications
When you build a library, you are effectively on the producer side: you are producing artifacts which are going to be consumed by...
Read more >
App vs Library - ISciNumPy.dev
A library is something a user can import as part of a larger project, either another library or an application. The defining feature...
Read more >
Library vs Service: 7 Arguments to consider | by Martin Thoma
A library is shared code that gets deployed with each application. So the library is part of the application and runs on the...
Read more >
Framework vs Library: Full Comparison - InterviewBit
In developing applications, libraries and frameworks play a key role. Essentially, both the library and the Framework are reusable pieces of ...
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