Skip to content
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

Deprecate when parameter of naturaldelta #248

Merged
merged 4 commits into from Dec 15, 2021
Merged

Deprecate when parameter of naturaldelta #248

merged 4 commits into from Dec 15, 2021

Conversation

carterbox
Copy link
Contributor

Related to #247, but does not close.

Adds deprecation warnings for naturaldelta(..., when) because this parameter does not make sense for a timedelta.

Didn't add test because it seems silly to test for the presence of deprecation warnings that will only be around until the next release.

@codecov-commenter
Copy link

codecov-commenter commented Dec 14, 2021

Codecov Report

Merging #248 (1f19fea) into master (429e3d8) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #248      +/-   ##
==========================================
+ Coverage   97.08%   97.10%   +0.02%     
==========================================
  Files          10       10              
  Lines         685      692       +7     
==========================================
+ Hits          665      672       +7     
  Misses         20       20              
Flag Coverage Δ
GHA_Ubuntu 95.95% <100.00%> (+0.04%) ⬆️
GHA_Windows 95.66% <100.00%> (+0.04%) ⬆️
GHA_macOS 95.95% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/humanize/time.py 96.49% <100.00%> (+0.11%) ⬆️
tests/test_time.py 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 429e3d8...1f19fea. Read the comment docs.

Copy link
Collaborator

@hugovk hugovk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, couple of little nits.

src/humanize/time.py Outdated Show resolved Hide resolved
src/humanize/time.py Outdated Show resolved Hide resolved
@hugovk hugovk added the changelog: Deprecated For soon-to-be removed features label Dec 15, 2021
carterbox and others added 2 commits December 15, 2021 11:26
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
@carterbox
Copy link
Contributor Author

I also want to ask if you actually use Sphinx for you documentation. (Those directives for deprecation are for Sphinx). I seems like the readthedocs page for this repository hasn't been updated in some time. https://humanize.readthedocs.io/en/latest/#

Oh, the docs are hosted at python-humanize.readthedocs.io, but I'm still not sure if y'all are using Sphinx.

@hugovk
Copy link
Collaborator

hugovk commented Dec 15, 2021

Yep, docs are at https://python-humanize.readthedocs.io which uses MkDocs not Sphinx so it'll just have to be written as plain text.

To build and view docs:

tox -e docs
open site/index.html

@hugovk hugovk changed the title DOC: Deprecate naturaldelta(..., when) Deprecate 1when parameter of naturaldelta` Dec 15, 2021
@hugovk hugovk changed the title Deprecate 1when parameter of naturaldelta` Deprecate when parameter of naturaldelta Dec 15, 2021
@hugovk hugovk merged commit f702c1c into jmoiron:master Dec 15, 2021
@hugovk
Copy link
Collaborator

hugovk commented Dec 15, 2021

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: Deprecated For soon-to-be removed features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants