The IOOS Python Package Skeleton: Not just for IOOS!

Recently @ocefpaf helped make xarray-spatial available on conda-forge and he used the template from the IOOS Python Package Skeleton.

As opposed to cookie cutters, which can be too opinionated, this repo contains tips and pieces of code that users can copy and paste to deploy their packages using best practices on conda-forge. And that also makes the lives of conda-forge maintainers a bit better! :slight_smile:

I’m just mentioning it here in the hope that other Pangeans will find it helpful!


We’d love some feedback on it too. So far we covered:

  • GH actions for pre-commit hooks and PyPI deployment;
  • doctr documentation deployment;
  • pre-commit for code quality and standards (black, interrogate, flake8, isort, codespell, etc);
  • pep 517/518 compliance via a simple pyproject.toml;
  • version handling with setuptools_scm;
  • reduction of code execution with a setup.cfg file.

The repository is meant to be an up-to-date copy-what-you-need resource. For example: we used to recommend versioneer, which a lot of pangeo project still use, but now we recommend setuptools_scm* and that was the main fix we had to do in xarray-spatial. We also had to apply some of fixes these on xlayers and xcape recently.

The docs are still a WIP and we are writing a session on how to publish wheels and conda-forge packages.

  • versioneer is unmaintained and deprecated due to PEPs 517/518.

@rsignell @ocefpaf this topic showed up at the top of my weekly digest email, which is great because I don’t always watch this forum.

Hopefully some Pangeo folks will find the skeleton repo useful. I was wondering, should we rename it to just ‘python-package-skeleton’ to better reflect its general purpose usefulness? If I were to fork it to my own GitHub, I think I’d be more likely to find it by that name (although GitHub repo search works pretty well).

1 Like

Indeed the name does not help, but claiming “python-package-skeleton” may be too broad.
Maybe “scientific-python-package-skeleton”? Too much?

I wonder if some consolidation with is possible. Or even some exchange of ideas (cc @andersy005)

That one is a cookie-cutter. We are trying to avoid that on purpose. Still, I think we could exchange some ideas and consolidate some of the minimum requirements.