TIL: how to show "used by" on GitHub when using Poetry
Published by Patrick Arminio on
Today I found out how to make "used by" show on GitHub on the Strawberry project.
Today I found out how to make “used by” show on GitHub on the Strawberry project.
Strawberry uses Poetry to package and publish the project on PyPI and, according to GitHub’s docs for the dependency graph, Poetry should be supported. To be fair, both listing dependencies and updates from dependabot work fine.
There’s only thing that doesn’t work: showing dependent packages. I’m not sure
if this is a bug or a missing feature, but I found a workaround by looking at
Rich’s source code.
Apparently by adding a “stub” setup.py
GitHub is happy and it starts showing
the dependent packages!
Here’s Strawberry’s setup.py:
#!/usr/bin/env python
# we use poetry for our build, but this file seems to be required
# in order to get GitHub dependencies graph to work
import setuptools
if __name__ == "__main__":
setuptools.setup(name="strawberry-graphql")
Hopefully this was useful to someone ☺️