Skip to content

Switch from lorem to python-lorem #1313

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

06kellyjac
Copy link

This PR switches out lorem for python-lorem.

From what I can tell since it has the same library and has the same function names unless there's a problem with the default values for sentence() no code changes are necessary?

Has pyproject.toml & typing.

One change which may be relevant is it's BSD 3 Licensed rather than MIT

Copy link
Contributor

github-actions bot commented Jul 30, 2025

DCO Assistant Lite bot All contributors have signed the DCO ✍️ ✅

@06kellyjac 06kellyjac force-pushed the swap_to_python-lorem branch 4 times, most recently from 1bbb492 to f44adc9 Compare July 30, 2025 19:26
`lorem` hasn't had a release since 2016 and is still on setup.py
`python-lorem`'s last release was in 2024, has types, and uses pyproject.toml

Signed-off-by: 06kellyjac <[email protected]>
@06kellyjac 06kellyjac force-pushed the swap_to_python-lorem branch from f44adc9 to ea6a203 Compare July 30, 2025 20:10
@jmartin-tech
Copy link
Collaborator

What is the reasoning behind this change? lorem is only currently utilized for a mock testing generator used in examples and testing. I see the currently used library has not changed since 2016 and the newer package looks to have been created in 2019 and has had recent development releases but no stable release in 2 years. Is there some need this revision will support?

@06kellyjac
Copy link
Author

Hi,

I did mention some reasons, first I'll address your questions then put the summary.

I see the currently used library has not changed since 2016 ...

The lorem package hasn't had a change since 2016 and that's fine if it's feature complete and doesn't have any dependencies to update or security issues to address etc. So the age since changes isn't my problem here.

and the newer package looks to have been created in 2019 and has had recent development releases but no stable release in 2 years.

I see it the oposite way around. The confusion may be the names in pypi and the repo names are switched.


Benefits of python-lorem:

  • Marked stable
  • More recently maintained
  • Uses more modern pyproject.toml approach to management
  • comes with types
  • (not so much for the project) packaged in nixpkgs unlike lorem
    • (this was my main driver to propose the swap, but lorem can be packaged too)

Unchanged:

Drawbacks of python-lorem:

  • Change in general
  • 449.51k downloads vs lorem's 6.97M (pure downloads isn't an indicator of wider project use and can be due to bots and lots of CI builds but still may be interesting)
    • averaged that's $\left\lceil \left( \frac{449{,}514\ \text{dl}}{70\ \text{mo}} \right) \times 12\ \text{mo} \right\rceil = 77{,}060\ \text{dl/yr}$ vs $\left\lceil \left( \frac{6{,}970{,}120\ \text{dl}}{109\ \text{mo}} \right) \times 12\ \text{mo} \right\rceil = 767{,}353\ \text{dl/yr}$ so down by a factor of 10

In summary I could see it's probably easiest to stay with lorem. Even as v0 if it doesn't change there's no more stable than that.
The dependency is currently pinned (to the degree requirements.txt/pyproject.toml allows) and PyPi appears to have some protections to overwriting existing versions in the potential event the pacakge is taken over.

An alternative could be to inline/vendor the code into the project with attribution since it's very small, unchanging, and would cut out an external dependency.

Otherwise a PR to lorem to just add types and pyproject.toml could be nice.

Footnotes

  1. from what I can tell reading the Classifier Doc - "Each project's maintainers provide PyPI with a list of "Trove classifiers" 2

@06kellyjac
Copy link
Author

I'll close this since I've moved to using lorem in NixOS/nixpkgs#429835

Thanks

@06kellyjac 06kellyjac closed this Jul 31, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jul 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants