# PEP 722: Dependency specification for single-file scripts

**URL:** <https://discuss.python.org/t/pep-722-dependency-specification-for-single-file-scripts/29905>\
**Category:** Standards\
**Created:** [July 19, 2023, 12:16pm UTC](https://discuss.python.org/t/pep-722-dependency-specification-for-single-file-scripts/29905 "2023-07-19T12:16:05Z")\
**Posts on this page:** 1\
**Showing post:** 101

<div class="post-metadata">

**Author:** ![pf\_moore](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/pf_moore/32/35_2.png) [@pf\_moore](https://discuss.python.org/u/pf_moore)\
**Post date:** [July 27, 2023, 7:43pm UTC](https://discuss.python.org/t/pep-722-dependency-specification-for-single-file-scripts/29905/101 "2023-07-27T19:43:01Z")

</div>

> [@NeilGirdhar](#):
>
> Please don’t take offense. I didn’t mean it as any criticism. I’m just reading various comments to get an idea of how other people are doing things

Absolutely no offense taken. It was just an interesting learning experience being in the position of trying to explain my use case and being confronted with helpful questions which, although well-intentioned, came across as expecting me to justify my choices. I’ll certainly be more careful in future about how _I_ talk to people offering use cases as a result.

One thing I know I tend to do is use such “have you tried X, Y or Z” approaches to avoid having to flat-out say “no” to a request. I think that’s a fairly natural thing to do - we wouldn’t be contributing to open source if we didn’t want to help people get their jobs done, so saying “no” to a proposal or feature request goes against that instinct. But I think that sometimes we have to just accept that a decision needs to be made, or an opinion needs to be stated, and we don’t always have to justify ourselves.

> [@NeilGirdhar](#):
>
> and I was just asking about shared functionality since my scripts do have a lot of shared code.

One other thought on this point. If I _did_ have shared code, I could just put it in a `lib` directory\[1\] alongside my scripts, and then do `import lib.foo`. Python adds the script directory to `sys.path`, after all, and this is _precisely_ what it’s good for.

Personally, I might make `lib` a “real” project and publish it on PyPI, just because I can, and as a packaging expert that seems logical to me. But for many sysadmins, DBAs and data analysts of my acquaintance, that would be a _massive_ step, and the simple `lib` directory is a much more appropriate solution for their situation.

But this is now _way_ off topic. Let’s go back to simpler subjects like bikeshedding over whether to use `Requirements:` or `Dependencies:` or something else 🙂

* * *

1. You don’t even need an ` __init__.py`, thanks to implicit namespace packages

---

_[View the full topic](https://discuss.python.org/t/pep-722-dependency-specification-for-single-file-scripts/29905)._
