Skip to content

Fix Python version error #1086

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 1 commit into from
Mar 9, 2025
Merged

Fix Python version error #1086

merged 1 commit into from
Mar 9, 2025

Conversation

Strift
Copy link
Contributor

@Strift Strift commented Mar 8, 2025

Pull Request

I couldn't successfully run the tests due to a missing import:

docker-compose run --rm package bash -c "pipenv install --dev && pipenv run mypy meilisearch && pipenv run pylint meilisearch tests && pipenv run pytest tests"

Gave the following output:

WARN[0000] /Users/strift/Code/Meili/meilisearch-python/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion 
[+] Creating 1/1
 ✔ Container meilisearch-python-meilisearch-1  Running                                                                                                                             0.0s 
Creating a virtualenv for this project
Pipfile: /home/package/Pipfile
Using default python from /usr/local/bin/python3.8.4 to create virtualenv...
⠹ Creating virtual environment...created virtual environment CPython3.8.4.final.0-64 in 168ms
  creator CPython3Posix(dest=/root/.local/share/virtualenvs/package-3pJoT3Dw, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/root/.local/share/virtualenv)
    added seed packages: pip==25.0, setuptools==75.3.0, wheel==0.45.1
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

✔ Successfully created virtual environment!
Virtualenv location: /root/.local/share/virtualenvs/package-3pJoT3Dw
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
Installing dependencies from Pipfile.lock (5db2f5)...
Installing dependencies from Pipfile.lock (5db2f5)...
meilisearch/models/index.py:6: error: Cannot find implementation or library stub for module named "camel_converter"  [import-not-found]
meilisearch/models/index.py:7: error: Cannot find implementation or library stub for module named "camel_converter.pydantic_base"  [import-not-found]
meilisearch/models/index.py:7: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
meilisearch/models/task.py:7: error: Cannot find implementation or library stub for module named "camel_converter.pydantic_base"  [import-not-found]
meilisearch/models/key.py:5: error: Cannot find implementation or library stub for module named "camel_converter.pydantic_base"  [import-not-found]
meilisearch/index.py:20: error: Cannot find implementation or library stub for module named "camel_converter"  [import-not-found]
Found 5 errors in 4 files (checked 14 source files)

PR checklist

Please check if your PR fulfills the following requirements:

  • Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
  • Have you read the contributing guidelines?
  • Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!

Copy link
Collaborator

@sanders41 sanders41 left a comment

Choose a reason for hiding this comment

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

Your failure was because Python 3.8 was used but the minimum supported version is Python 3.9, from the pyproject.toml: requires-python = ">=3.9".

Instead of updating the lockfile with Python 3.8 packages we should update the Dockerfile to use Python 3.9.

@Strift Strift changed the title Update lockfile Fix dockerfile version Mar 9, 2025
@Strift Strift closed this Mar 9, 2025
@Strift Strift force-pushed the chore/update-lockfile branch from ae68485 to 2592ed0 Compare March 9, 2025 06:03
@Strift Strift reopened this Mar 9, 2025
@Strift Strift requested a review from sanders41 March 9, 2025 06:10
@Strift
Copy link
Contributor Author

Strift commented Mar 9, 2025

Thank you for the review, I'm a Python noob. I reverted the changes on the lockfile and updated the Dockerfile instead.

@Strift Strift changed the title Fix dockerfile version Fix Python version error Mar 9, 2025
@sanders41 sanders41 added the maintenance Anything related to maintenance (CI, tests, refactoring...) label Mar 9, 2025
Copy link
Collaborator

@sanders41 sanders41 left a comment

Choose a reason for hiding this comment

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

bors merge

Copy link
Contributor

meili-bors bot commented Mar 9, 2025

@meili-bors meili-bors bot merged commit cbd3bfc into main Mar 9, 2025
21 checks passed
@meili-bors meili-bors bot deleted the chore/update-lockfile branch March 9, 2025 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Anything related to maintenance (CI, tests, refactoring...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants