webology,
@webology@mastodon.social avatar

🤔 Over the last few days, I keep seeing lots of Python PEPs thrown around in my feed.

However, I haven't seen as many talking about the potential of "PEP 723 – Inline script metadata" which I keep hearing cool things about.

https://peps.python.org/pep-0723/

🤔 There are very few times that a new Python feature genuinely makes me excited to see, but PEP 723 feels like it has the potential to literally change everything.

alper,
@alper@rls.social avatar

@webology Couldn’t I just put my Django project dependencies inline in the main.py and never bother with any package manager like this?

webology,
@webology@mastodon.social avatar

@alper In theory, yes.

@pradyunsg pointed me to this doc and I noticed that pipx already supports this. https://dbohdan.com/scripts-with-dependencies#python-pipx

The average Python developer isn't going to know about pipx, but it's a game changer if it just works with future Python versions.

pradyunsg,
@pradyunsg@mastodon.social avatar

@webology @alper I don't think we're ever going to end up with python gaining support for this; the standard is more for all of the various tools in this space to have one-way-to-do-things.

radiac,

@webology I'm excited about this one for a couple of my projects - something quite cool about calling pipx run on a nanodjango script, for example.

webology,
@webology@mastodon.social avatar

@radiac excellent point.

I write a bunch of gist-ware which I share with people and it solves one nitpick of mine.

Plus, I think it'll lower the barrier for people who are new to Python.

Another bonus will be when tools like pipx/nox/tox add support. 🍿

astrojuanlu,
@astrojuanlu@social.juanlu.space avatar

@webology Looks barely useful for me 🤷 wondering if the claims about users sending links to gists or scripts over email and struggling with running said script have been validated through proper user research.

I doubt it, yet I could be wrong. Still, I think this will change very little, it feels like Python exceptionalism, and personally I don't think I'll ever use it.

webology,
@webology@mastodon.social avatar

@astrojuanlu Sorry, I do not understand the Python exceptionalism part. Can you expand on that?

astrojuanlu,
@astrojuanlu@social.juanlu.space avatar

@webology I don't know of other major languages that do or need this. This might be a gap in my own knowledge of course.

webology,
@webology@mastodon.social avatar

@astrojuanlu It feels like it lower the bar to entry for future Python versions to me.

I like to share gists with people at times where I don't need another repo or another pypi package. So, having the ability to pull more of pyproject.toml into the script's heading to install related packages feels useful to me.

I also think about what this looks like for pipx/nox/tox and it feels like a win in my book.

pradyunsg,
@pradyunsg@mastodon.social avatar

@astrojuanlu @webology https://dbohdan.com/scripts-with-dependencies is linked from PEP 722 (which ended up being a competing PEP), which lists efforts in various language ecosystems for something like this.

Rust's also got ongoing efforts toward something similar: https://github.com/rust-lang/cargo/issues/12207

webology,
@webology@mastodon.social avatar

@pradyunsg @astrojuanlu nice.

TIL pipx already has some support for this. This might change how I bundle a few custom utils in my dotfiles 🤔

alper,
@alper@rls.social avatar

@astrojuanlu @webology “‘Proper’ user research” is so unrealistic that it reads like an effort to derail the initiative.

I know this is going to be huge.

astrojuanlu,
@astrojuanlu@social.juanlu.space avatar

@alper @webology I've been reminded that there are indeed similar initiatives in other languages, so on that front I stand corrected.

There's lots of talk about beginners in the PEP and that's why I questioned whether this has been researched. I talk to a lot of them and never perceived this as a problem, but that's just my opinion. I can't derail anything because I'm not participating in the PEP discussion, just expressed my thoughts prompted by Jeff's open question.

alper,
@alper@rls.social avatar

@astrojuanlu @webology I can see beginners benefit from this but for instance we as a Devops team have lots of single file scripts that right now need their own folder and dependency file (pyproject, Pipenv) but would become much more lean and portable with this.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • DreamBathrooms
  • ngwrru68w68
  • cubers
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • mdbf
  • tacticalgear
  • JUstTest
  • osvaldo12
  • normalnudes
  • tester
  • cisconetworking
  • everett
  • GTA5RPClips
  • ethstaker
  • anitta
  • Leos
  • provamag3
  • modclub
  • megavids
  • lostlight
  • All magazines