Allison Parrish is a user on mastodon.social. You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.
Allison Parrish @aparrish

would appreciate being pointed to a good low-bloat boilerplate for making a contemporary python package (i.e., for release on pypi). even as a maintainer of several python packages I find this process consistently daunting and I feel like standards and best practices are constantly shifting under my feet

· Web · 7 · 4

@ehashman yes. almost all python packages include a lot more than this, including stuff that I need (like building documentation and continuous integration stuff)

@aparrish ahhh, I see. It's definitely a moving target and I imagine different folks have different opinions.

Here's what I do:
- set up test suite / builds with tox: doc build with sphinx, linting without flake8, testing with pytest
- add linting and tests/coverage with CI (Travis or CircleCI, coveralls or codecov)
- add badges to README (docs, CI, coverage, PyPI version)
- bonus: add continuous deployment for docs/PyPI builds

@aparrish it took me a year of working with Python professionally to pick all that up and I dunno that I have good tutorial resources for each off the top of my head... but does that help at all?

@ehashman I did mention in the original toot that I maintain several open source python packages on pypi...? e.g. github.com/aparrish/pronouncin I know *how to do this,* I'm just looking for an easy pre-built boilerplate that has the essentials so I don't have to put everything together from scratch every time I want to publish a new package.

@aparrish sorry, I don't mean to be 'splainy, I don't think such a thing exists, I've always cargo-culted from preexisting projects 😅

@aparrish great! I'd love if PyPA had better resources for this, I'll see what other folks think and maybe we could put together an official example repo

@aparrish I believe Sumana has been working on this very thing recently

@zwol that would makes sense! I'll ask her about it, thx

@aparrish @zwol Oh hi. So just to check -- would any of the cookiecutter templates count as "low-bloat" for this purpose, or are you looking for something more streamlined?

@brainwane @zwol the cookiecutter templates are frustrating because they're difficult to understand—it feels like there's always So Much Stuff and so many underlying unstated assumed knowledge or under-explained opinions about how everything works. i think that's what i mean when i say "bloat." i also have this probably irrational distaste for tools like cookiecutter itself (rails-ey scripts to automatically create directory structures etc feel fundamentally unpythonic to me)

@aparrish I understand. I presume that you're set for your immediate project but I will keep your use case in mind and see what I can do to address it, and let you know what I find. Thanks for speaking up.

@brainwane is cookiecutter just The Way You're Supposed To Do It right now? will probably start using it if that's the case (thank you for answering my questions on this btw)

@aparrish I am on surer ground in saying that, for pretty simple projects, I advise you to copy github.com/pypa/sampleproject/ . For more complicated projects, cookiecutter is the project I hear people talking about/recommending most often, but I also see people discussing hatch github.com/ofek/hatch#usage and poetry github.com/sdispater/poetry/#n ; in my opinion, cookiecutter has not reached The Way You're Supposed To Do It status.

github.com/pypa/packaging-prob has some "how should we advise?" discussion.

@brainwane this is exactly what i needed (as usual 😊). thank you!

@brainwane @aparrish MAN OH MAN could I have used that sampleproject repo last month. Will be very useful going forward. Thanks for the link!

@brainwane @zwol (the whole process feels very "there's more than one way to do it" and what i'm looking for is the one obvious way to do it)

@aparrish I know you already found a solution, but I’m a fan of using cookiecutter for this: github.com/audreyr/cookiecutte