Closed raylu closed 1 month ago
Dool is 100% functional with just the dool
script. The plugins are nice, but not required. If it's simpler we could just install dool
and leave installing the plugins as an optional thing that can be done later?
Where do we stand on this? I'm not 100% familiar with the startup code (I inherited this code). Your solution above looks clean to me, I would be fine moving towards that. I doubt the else
does anything.
If you want to submit a PR to rework that startup code I'll test it.
I re-worked and documented the startup in 5874a3e3
. Hopefully it's an improvement, and it's easier to read.
5874a3e3
nice. though I don't think the __main
will work since you can't access double underscore prefixed symbols usually
do you wanna package it up for pypi?
Can you elaborate on "you can't access double underscore prefixed symbols"?
I have zero experience packaging for pypi, I was hoping someone in the community would take that project on so we can spread the dool
love.
oh, apparently double underscore only applies to class members. it works fine, disregard me
as for how to package, just add my pyproject.toml
from the first comment, change "dool:_main"
to "dool:__main"
, and then (pip install flit
and) run flit install
or flit build
to make sure it works the way you want
once you're happy with it, make an account on https://test.pypi.org and publish there (https://flit.pypa.io/en/stable/upload.html). once you're happy with that, make an account on real pypi and publish!
@raylu is that something that I need to do, or is it that something someone in the community is able to do? Are their security restrictions that require me personally to do it? I'm not a Python expert, I inherited this project, and I'm certainly NOT a Python ecosystem expert. I'm not really looking to take on adding a package on PyPi onto my plate.
Other projects I have been involved in (Perl and Javascript) the community was able to take the code I wrote and get it packaged up. That freed up my time to focus on the code and the release team would handle getting it pushed to various repositories.
you can do it yourself. there is no special list of trusted packagers for pypi. anyone can make a new package on pypi
it is... conventional for the package maintainer to claim the package on pypi. I can do it for you if you want, but I'd at least want to add you as a maintainer if I made the package
@raylu if you have experience making packages then please, by all means, make dool
a package and add me as a maintainer. I'll gladly give you credit in the readme.
I just remembered that pypi now has a whole fancy trusted publishers thing https://docs.pypi.org/trusted-publishers/ that lets you publish from a GH action https://github.com/marketplace/actions/pypi-publish
so I made https://github.com/scottchiefbaker/dool/compare/next...raylu:dool:next which ran https://github.com/raylu/dool/actions/runs/8842864700 which created https://test.pypi.org/project/dool
you can follow the pip install
instructions on that last page to install it and see if it's to your liking. assuming you do, I'll send you a PR that publishes to actual pypi
OMG that is amazing. You are a gentlemen and a scholar.
Yes I am definitely interested, please send a PR.
thanks for this! can a release be created so it is published to pypi rather than test.pypi?
@rbavery done and done!
oh nice! I was gonna manually publish 1.3.1, but that works too. also glad to see my thing actually worked, heh
now that the package is created, do you want to make a pypi account and I'll add you as a mainatiner?
@raylu I created an account: scottchiefbaker
SUMMARY
make dool installable via
pip install dool
ISSUE TYPE
see also: #4
the structure of the code is a bit... inconducive to python packaging.
dool
isn't importable, so it's hard to set it up as a console script. I made a symlinkdool.py
→dool
, but the structure is still pretty odd. it relies on some globals to be set, so after moving the__main__
block into a_main()
function, I added someglobal
s. I don't really understand what theelse
block is for (how can__name__
ever not be__main__
?) so I deleted itwith a few other minor tweaks and the
pyproject.toml
below,flit install
worksthe main problem, though, is
plugins/
. it can't find any after installingI doubt we want the package to be importable after installation as
plugins
, so we probably want to instead have asrc/
ordool/
with a__main__.py
and makeplugins/
a subdir of that. that'd require a minor change topluginpath
and updating the rpm and snap packaging code