Skip to content

fix _Opt deprecation warning #236

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

Merged
merged 3 commits into from
May 28, 2024
Merged

Conversation

drts01
Copy link
Contributor

@drts01 drts01 commented May 23, 2024

closes #234

@drts01 drts01 requested a review from a team as a code owner May 23, 2024 02:32
@drts01 drts01 requested a review from stsewd May 23, 2024 02:32
@drts01 drts01 force-pushed the fix_deprecated_234 branch from f8fb51d to a89cda3 Compare May 23, 2024 02:50
@drts01 drts01 marked this pull request as draft May 23, 2024 03:45
Copy link
Member

@humitos humitos left a comment

Choose a reason for hiding this comment

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

Thanks for this work!

Can you take a look at the documentation build error?

   File "/home/docs/checkouts/readthedocs.org/user_builds/sphinx-notfound-page/envs/236/lib/python3.10/site-packages/notfound/extension.py", line 274, in validate_configs
    app.config.values.get("notfound_urls_prefix").default
AttributeError: 'tuple' object has no attribute 'default' 

https://beta.readthedocs.org/projects/sphinx-notfound-page/builds/24464999/#231390753--9

It seems that in some versions of Sphinx doesn't have .default attribute.

@drts01 drts01 force-pushed the fix_deprecated_234 branch from a89cda3 to dcb05f4 Compare May 28, 2024 01:59
@drts01 drts01 marked this pull request as ready for review May 28, 2024 02:02
@drts01 drts01 requested a review from a team as a code owner May 28, 2024 02:02
@drts01 drts01 requested a review from ericholscher May 28, 2024 02:02
@drts01
Copy link
Contributor Author

drts01 commented May 28, 2024

Yes. the attribute default was added in Sphinx 7.2. It seems one of the Sphinx extensions was causing the issue. Once the dependencies were updated, it now works as expected.

Copy link
Member

@humitos humitos left a comment

Choose a reason for hiding this comment

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

Thanks!

@humitos humitos merged commit 64ed88f into readthedocs:main May 28, 2024
8 checks passed
notfound_urls_prefix != default
and notfound_urls_prefix
and not (
notfound_urls_prefix.startswith("/") or notfound_urls_prefix.endswith("/")
Copy link
Member

Choose a reason for hiding this comment

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

Hrm, I just realized that this should be a and, right? We were using all() before.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh dang. you're right. idk what i was thinking.

@hugovk
Copy link
Contributor

hugovk commented Jul 29, 2024

Please could you make a release with this fix? Thank you!

@humitos
Copy link
Member

humitos commented Jul 30, 2024

@hugovk done at https://pypi.org/project/sphinx-notfound-page/1.0.3/ -- please confirm it does work as expected 👍🏼

@hugovk
Copy link
Contributor

hugovk commented Jul 30, 2024

No more warning with 1.0.3, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resolve deprecation warning
3 participants