# Declarative setup & Github Dependabot

**URL:** <https://discuss.python.org/t/declarative-setup-github-dependabot/13548>\
**Category:** Packaging\
**Created:** [February 7, 2022, 8:58am UTC](https://discuss.python.org/t/declarative-setup-github-dependabot/13548 "2022-02-07T08:58:41Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jku](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/jku/32/2399_2.png) [@jku](https://discuss.python.org/u/jku)\
**Post date:** [February 7, 2022, 8:58am UTC](https://discuss.python.org/t/declarative-setup-github-dependabot/13548/1 "2022-02-07T08:58:41Z")

</div>

I’d like some practical advice on using declarative setup (setup.cfg) and GitHub Dependabot. I know there is an older thread discussing how Dependabot should work, but I’m more interested in what python projects themselves can do right now.

We ([python-tuf](https://github.com/theupdateframework/python-tuf)) recently got rid of setup.py altogether, thinking that’s a good move as it makes setup completely declarative. It turns out this [breaks Dependabot](https://github.com/dependabot/dependabot-core/issues/4483): they expect to find a setup.py and not finding it will mean hard failure. It seems that in their quest to not run untrusted code, the Dependabot team has prevented the configuration that has no untrusted code…

Are there any best practices for this situation – do we need to re-add a setup.py or are there other workarounds to get dependabot working?

---

<div class="post-metadata">

**Author:** ![bernatgabor](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/bernatgabor/32/3003_2.png) [@bernatgabor](https://discuss.python.org/u/bernatgabor)\
**Post date:** [February 7, 2022, 9:44am UTC](https://discuss.python.org/t/declarative-setup-github-dependabot/13548/2 "2022-02-07T09:44:09Z")

</div>

As far as I’m aware it’s not. Dependabot needs to implement [https://github.com/dependabot/dependabot-core/issues/3290#issue-833708296](https://github.com/dependabot/dependabot-core/issues/3290#issue-833708296) to solve your current problem.

---

<div class="post-metadata">

**Author:** ![jku](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/jku/32/2399_2.png) [@jku](https://discuss.python.org/u/jku)\
**Post date:** [February 7, 2022, 1:59pm UTC](https://discuss.python.org/t/declarative-setup-github-dependabot/13548/3 "2022-02-07T13:59:33Z")

</div>

Thanks, that is disappointing.

Strictly speaking I think I disagree that dependabot needs to implement any new features to solve my problem: the dependency tracking that we are interested in _already works_ (this is a library so we don’t bump install\_requires all the time, we are interested in keeping our requirements-pinned.txt up to date so that our tests run against newest dependencies that we can handle). The only issue is that there seems to be a bug in dependabot that we now trigger (setup.py is required to exist even though their source code comments imply it should not be).

---

<div class="post-metadata">

**Author:** ![CAM-Gerlach](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/cam-gerlach/32/3688_2.png) [@CAM-Gerlach](https://discuss.python.org/u/CAM-Gerlach)\
**Post date:** [February 15, 2022, 2:18am UTC](https://discuss.python.org/t/declarative-setup-github-dependabot/13548/4 "2022-02-15T02:18:55Z")

</div>

If so, then this would seem to be a Dependabot bug, no? Could you open an issue there?

---

<div class="post-metadata">

**Author:** ![jku](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/jku/32/2399_2.png) [@jku](https://discuss.python.org/u/jku)\
**Post date:** [February 15, 2022, 3:07pm UTC](https://discuss.python.org/t/declarative-setup-github-dependabot/13548/5 "2022-02-15T15:07:57Z")

</div>

Yes, the bug link is in the original post. Since I commented there the issue has received some more attention, including from GitHub staff.

---

<div class="post-metadata">

**Author:** ![CAM-Gerlach](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/cam-gerlach/32/3688_2.png) [@CAM-Gerlach](https://discuss.python.org/u/CAM-Gerlach)\
**Post date:** [February 15, 2022, 5:54pm UTC](https://discuss.python.org/t/declarative-setup-github-dependabot/13548/6 "2022-02-15T17:54:25Z")

</div>

Thanks. If you add a basic stub `pyproject.toml` (as you generally should), does that also make it work? One of the GitHub engineers’ comments implied that it would, and that would be a more modern, forward-looking approach and something you should likely do anyway, as opposed to adding a legacy setup.py.

---

<div class="post-metadata">

**Author:** ![jku](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/jku/32/2399_2.png) [@jku](https://discuss.python.org/u/jku)\
**Post date:** [February 21, 2022, 12:18pm UTC](https://discuss.python.org/t/declarative-setup-github-dependabot/13548/7 "2022-02-21T12:18:16Z")

</div>

We do have a pyproject.toml. There’s a link to the github project as well in the original post.

---

<div class="post-metadata">

**Author:** ![CAM-Gerlach](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/cam-gerlach/32/3688_2.png) [@CAM-Gerlach](https://discuss.python.org/u/CAM-Gerlach)\
**Post date:** [February 21, 2022, 4:53pm UTC](https://discuss.python.org/t/declarative-setup-github-dependabot/13548/8 "2022-02-21T16:53:58Z")

</div>

Ah, gotcha—missed that somehow. Thanks! That defintely seems like both a bad behavior and contradicts what the GitHub rep claimed was the intended behavior, probably because it was never tested without it.

In any case, on projects (i.e. applications) that need pinned dependencies, I use pip-tools locally for that with Dependabot only as a backup, as Dependabot has always been pretty limited for Python projects, but not sure if that is helpful to you.
