Adding extras for dependencies
See original GitHub issueIs there a way to specify extras that should be installed from a dependency? For example, I’d like to specify:
poetry add sqlalchemy[postgresql]
Since my project requires sqlalchemy
and postgresql
, but the only hard dependency is sqlalchemy
, so depending on psycopg2
directly doesn’t make sense. psycopg2
being the package that is installed as a sqlalchemy
extra when you ask for postgresql
.
This way if sqlalchemy
changes the postgresql
extra to something else I’d automatically pick up the change.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:19 (8 by maintainers)
Top Results From Across the Web
What is 'extra' in pypi dependency? - Stack Overflow
Extras are dependencies you can install in addition to the regular dependencies, if you ask for them explicitly. See them as optional ...
Read more >A Better Practice for Managing Many extras_require ...
In this article, I introduce a simple yet effective solution to manage optional dependencies via extras_require in Python. This method is ...
Read more >Adding a default extra_require environment - Packaging
Possible default extras/dependency categories? Somehow related, I opened yesterday an issue on Github with a potential workaround which ...
Read more >Installation — Anvil Extras documentation - Read the Docs
Install as a third-party dependency · From the gear icon at the top of your app's left hand sidebar, select 'Dependencies' · In...
Read more >Commands | Documentation | Poetry - Python dependency ...
poetry install Installing dependencies from lock file No dependencies to ... want to install provide extras, you can specify them when adding the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
it works if you add single quotes
@bertjwregeer The
extras
feature works fine but in your case there is a problem which prevents poetry from gettingsqlalchemy
’s dependency information.Here is the breakdown of what happens:
requires_dist
is null), it proceeds with downloading and inspecting the release tarball (https://files.pythonhosted.org/packages/c1/c8/392fcd2d01534bc871c65cb964e0b39d59feb777e51649e6eaf00f6377b5/SQLAlchemy-1.2.7.tar.gz).*.egg-info
directory which contains arequires.txt
file containing the dependency information (this is a fairly common case). But in this case it does not exist.setup.py
.