Possibly odd question as I've never published anyt...
# development
Possibly odd question as I've never published anything to pypi. Is there anything that might be too meta about using Pants to publish a pants plugin?
no not at all
I’ve used pants to publish underpants. Not a pants plugin per-se of course, but…
Do we have a
plugin for publishing?
We should...
it is using twine yes
If you want to automate this though you probably just want to pants package and use PyPIs new OIDC support / GH action.
... Oh... Interesting.
Didn't know that was a thing!
Yeah, fixed PEX to do this and deleted my long lived token secrets.
Sweet, thanks John
Another question here, while I can ponder my publishing questions - since PyPi has disabled new project registration this weekend. Is there a way to decouple your code/module structure from the name you publish under? And what I mean by that is in the JS world, the code you import is relative to whatever you choose to publish under.
import { Dialog } from "@robotpajamas/svelte-headlessui"
I could easily re-publish this to another organization, or access files by
So, if I have something like:
pip install robotpajamas.pants.scie
Does that mean, if I want to import using the same structure, I necessarily need to keep my source files in that same module structure too? Or is there some alias concept I can apply? So like,
somehow automagically becomes
And I know the package name and module structure don't need to be identical (ala
imports at
Your code is decoupled from the name you publish under as you already called the shot on in your last sentence. I think what you mean to ask has nothing to do with publishing, but layout vs import. That too can be arbitrary iff you use an import hook. Pex does this and adds the
psuedo-package prefix to all 3rdparty code.
In general you absolutely don't want to do either.
Why's that?
The former, pantsbuild.pants->pants, setuptools->setuptools,pkg_resources just confuses the hell out of people. The latter is complex magic that ... why would you want to do that?
Well, I think I'm referring to the opposite-ish. The source code module structure vs publish structure. So, I WANT the
pip install abc.xzy.scie
to be how the end user also consumes the plugin. So from the user's perspective, the experience is consistent. I was just mildly hoping to not have to also make my source code structure align to the same tedious namespacing convention.
Having folders for the sake of namespacing only feels very.... Java-y
I'd get with the ecosystem if I were you. Fighting convention is exactly that in the long run unless it's deeply important to you.
You could clearly insert leading dirs as a last second packaging step and pray you don't break imports
Nah, not super important. Just feels... antiquated. Was hoping there was some semi-official namespacing mechanism. 🤷
C'est la vie, I suppose. Thanks John