Skip to content

babel pull 1199 failed and rejected #118

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

Open
hoangduytran opened this issue Mar 16, 2025 · 4 comments
Open

babel pull 1199 failed and rejected #118

hoangduytran opened this issue Mar 16, 2025 · 4 comments

Comments

@hoangduytran
Copy link

hoangduytran commented Mar 16, 2025

I have made a pull request and submitted pull request 1199 and 117 yesterday evening,

#1199
#117

and they are all rejected. I am quite new to all this, could you please explain what's going wrong? I tried to read the report of tests which failed and it looked like the test scripts failed to load, I don't know the ins and outs of the tests on the server. Could someone please help me?

Best regards,
Hoang Tran
(you can write to me using my email, [email protected] as well)

@m-aciek
Copy link

m-aciek commented Mar 16, 2025

Hi, it looks like poparse import failed in tests. https://github.com/sphinx-doc/sphinx-intl/actions/runs/13876042111/job/38828459379#step:7:47 Maybe it's an incompatibility of babel version used in tests?

@hoangduytran
Copy link
Author

hoangduytran commented Mar 16, 2025

Hi, it looks like poparse import failed in tests. https://github.com/sphinx-doc/sphinx-intl/actions/runs/13876042111/job/38828459379#step:7:47 Maybe it's an incompatibility of babel version used in tests?

Thank you so much for your answer, yes, that's probably the case, because I haven't updated my sphinx. I will give it another try. Many thanks again. What is the latest version by the way?

@hoangduytran
Copy link
Author

hoangduytran commented Mar 16, 2025

Hi, it looks like poparse import failed in tests. https://github.com/sphinx-doc/sphinx-intl/actions/runs/13876042111/job/38828459379#step:7:47 Maybe it's an incompatibility of babel version used in tests?

I have just ran upgrade to my local pyenv,

pip install --upgrade --force-reinstall -r requirements.txt

and here is the results of upgrade:

Image

as you can see, I have updated to the latest babel version, babel-2.15.0, and reran my server, which uses the poparse.load_po() and it works fine with the fastapi, as seen in this image:

Image

and it runs much faster now with the new poparse.load_po(). So I don't know what's going on on the server, why it failed to import. I'm using this line of code to import from sphinx_intl/catalog.py

import os
import io

from babel.messages import pofile, mofile, poparse

def load_po(filename, **kwargs):
    """read po/pot file and return catalog object

    :param unicode filename: path to po/pot file
    :param kwargs: keyword arguments to forward to babel's read_po call
    :return: catalog object
    """
    return poparse.load_po(filename, **kwargs)

and they ran no problem on my macOS Monterey 12.7.6. Please advice what else I can do in this situation?

@hoangduytran
Copy link
Author

Today, I decided to swap out my old virtual environment, which used to run in Python 3.9.6, and started a new environment completely, running Python 3.13.2, and reran my test.py, which only loading the test PO file. These are the images showing the process:

Image

Image

This is the testing script:

def testPO(self):
    # file_path = os.environ['PO_TEST_FILE']
    file_path = os.environ['BLENDER_PO_FILE']
    # cat: Catalog = c.load_po(file_path,
    #                          debug=0,
    #                          multiprocessing=True,
    #                          )

    cat: Catalog = c.load_po(file_path)

    print(f"Loaded $BLENDER_PO_FILE using new load_po() with {len(cat)} records")

and the result of loading linear, non-multiprocessing is:

Image

It took about 1.6 seconds to load the vi.po, on my machine, the size is 7.6MB (at this link Blender's Vietnamese Interface Translation,

Image

and took about 1.3 seconds using 11 cores in multiprocessing mode:

Image

Please advice what I could do more to make this pull request a success.

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

No branches or pull requests

2 participants