-
Notifications
You must be signed in to change notification settings - Fork 444
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
Issue with importing format_compact_decimal
(Babel 2.11.0)
#920
Comments
Well, that's curious! I don't get that error when building docs from the current
The built docs contain the new function just fine, too: However, it looks like RTD is experiencing the same issue and doesn't document the function. https://readthedocs.org/projects/python-babel/builds/18502285/ |
Oh.. 😂 Regarding docs, the issue is probably that Sphinx itself depends on Babel, and installing Sphinx can inadvertently pull in an older version of Babel. Excerpt from the RTD log:
|
I guess that mostly explains it. It seems that installing other packages that require it can force it to a lower version. And depending on the environment, the version could actually sometimes not be 2.11.0.
|
* Use Python 3.11 * Use Sphinx 5 (and update extlinks configuration) * Install Babel from the build directory Refs #920
I suspect that also has to do with 2.11.0 not having propagated to every PyPI mirror just yet, and local caches and whatnot can also think 2.10.3 is the newest version. |
That's definitely possible. I suppose for now I can use |
* Use Python 3.11 * Use Sphinx 5 (and update extlinks configuration) * Use Python 3 intersphinx mapping * Install Babel from the build directory Refs #920
Also, it's possible that pyright is using |
* Use Python 3.11 * Use Sphinx 5 (and update extlinks configuration) * Use Python 3 intersphinx mapping * Install Babel from the build directory Refs #920
Anyway, I think this is resolved as "Babel wasn't coming from inside the house". 😁 |
Overview Description
In some places, there is an issue when trying to to import and use
format_compact_decimal
.It does not matter if
from babel.numbers import format_compact_decimal
is used orfrom babel import numbers
.When trying to import into a project, it shows an
AttributeError
, but when running in the Python REPL it works fine.When running
tox
it seems to work, but when runningpyright
it does not.Internally, within Babel files, the import is working as is evident by the tests passing.
The Babel documentation seems to have not imported the function successfully.
This is strange since I can't seem to find any reason
format_compact_decimal
would behave differently than other functions in the module, for exampleformat_decimal
,format_percent
, etc.In all cases, the latest version of the code is used, Babel 2.11.0, tested with Python 3.10.
Error in Pyright:
Pyright Checks failing
https://github.com/DenverCoder1/github-readme-youtube-cards/actions/runs/3370558404/jobs/5591614482
Warning in VS Code
Warning appearing when trying to build docs (
make -C docs html
):The text was updated successfully, but these errors were encountered: