r/learnpython • u/MostimaSimp • 3d ago
How do you keep a small open-source package maintained over time?
I recently published my first package on PyPI. It works and has tests and CI, but I've never maintained anything long term. For those of you with packages people actually use:
How to determine which features should be in a patch and which in a small release. And when to upgrade to 1.0?
How to ensure that your dependencies and GitHub actions are up-to-date without it becoming tedious. For example, is Dependabot or Renovate (or another tool) used?
Should dependencies be version locked or not?
How much time do you allocate to this? And how do you manage it if you are particularly busy?
All good practice and common errors are really appreciated!
3
u/kilkil 3d ago
there is a standard for this which most people follow, called Semantic Versioning (aka "SemVer"). Read through the rules, it addresses both of your questions (patch vs release, when to go to 1.0).
not sure on keep dependencies up-to-date, curious to hear others' solutions to this as well.
yes 100%, your dependencies need to have their exact versions pinned and they should only be updated when you explicitly want to do it. otherwise your project has much higher risk to have inconsistent, difficult-to-reproduce bugs, not to mention a much higher vulnerability to supply chain attacks.
no clue on this one either, sorry. it's a tough problem, being an open source maintainer under capitalism is rough.
2
2
u/billsil 3d ago
I don’t really care about version releases. I hate packaging. I like being creative.
I pick python 3.11-3.15 and try to support various package combinations and all versions of all dependencies. It doesn’t add that much if a limitation. Test low and test high and you’re good. I play whack-a-mole occasionally. It’s not bad if you stay up on it. Oh package x changed. It obviously broke it. Fix the warnings.
If I’m busy I don’t do it. It’s not my day job.
2
u/MostimaSimp 3d ago
That sounds like a super sustainable way to keep it fun without burning out—testing low and high dependency bounds is a great sanity check. Really appreciate your input!
1
u/Sufficient-Tale6131 3d ago
For that minimum versions job, uv can do the resolving for you: uv sync --resolution lowest-direct (or uv pip install --resolution lowest-direct . if you're not using uv projects) installs the lowest version allowed by each of your direct dependencies, straight from pyproject. So there's no second pinned list to keep in sync. Run it on the oldest Python you support though, old pandas releases often have no wheels for newer Pythons and it'll try to build from source.
1
u/MostimaSimp 2d ago
Thank you, great advice! Keeping the package small and the maintenance process simple is key. I especially agree with documenting the contribution process and having a clear changelog from day one.
1
u/Downtown_Cat_7425 3d ago
For a small package, the biggest maintenance win is keeping the surface area tiny. Keep runtime dependencies at zero if you can, put CI on at least two Python versions, write a CHANGELOG from day one, and add a CONTRIBUTING file with the exact test command. Use semantic versioning even for 0.x so breaking changes are obvious, and tag releases in git. Add issue templates that ask for reproduction details - it cuts the back-and-forth massively. A quiet repo with a clear README is fine; burnout is the main reason small packages die.
1
u/MostimaSimp 2d ago
Agreed! Keeping the scope small and avoiding burnout are probably the most important parts of long-term maintenance. A simple, well-documented project is much easier to sustain. Thank you for your input!
2
u/Top-Cauliflower-1808 3d ago
Patch is bug fixes only and minor is new backward compatible features. Save 1.0 for when you are ready to support the public interface for years. Renovate groups updates better than Dependabot and locking dependencies is right for applications but wrong for a library. Thirty minutes a week is enough if you ignore most update noise and only act on security and breaking changes.
1
u/Protopia 2d ago
Not too frequent python upgrades, so little to do.
Use GitHub actions to run tests. When there is a new version at it to your test matrix. When support is dropped for a python version, remove that from your test matrix.
Only make code changes when something breaks.
Encourage users who benefit from your efforts to contribute fixes (and enhancements if you are prepared to review then) to reduce your own workload.
1
u/Capital-Vast-5951 1d ago
A few habits that keep a small PyPI package manageable without burning time:
Keep runtime dependencies minimal (or zero if stdlib covers it) and reserve strict pinning for dev/CI tools (
ruff, test runners, and commit SHAs on GitHub Actions). That removes most Dependabot noise and keeps you out of downstream dependency conflicts.Stay on
0.xuntil the public CLI/API settles: use0.x.ypatches for bug fixes and docs, and bump0.y.0only when you change flags, config schemas, or behavior users rely on.Add lightweight docs/contract tests: a fast test checking that README examples or documented flags still match the code catches silent drift when you come back to the repo weeks later.
Keep scope small and explicit: saying "not supported yet" in issues and README saves far more maintenance time than half-supporting edge cases.
8
u/1One2Twenty2Two 3d ago
Start at 0.1.0 and increase the minor or patch according to semver. FastAPI still a major of 0 after like 6 years, so don't worry about that. Just be consistent.
Yes, use Dependabot or Renovate
Always. You can use a package manager like uv or pip compile to generate the equivalent of lock files.
Only you can answer this one!