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

This is a recipe for mysql-connector-python #2974

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from

Conversation

kyprosantreou
Copy link

Hello,

This is a mysql-connector-python recipe!

@AndreMiras
Copy link
Member

Thanks for contributing.
Could you fix the linting error so the CI try to build the recipe next.

pythonforandroid/recipes/mysql-connector-python/__init__.py:13:1: E305 expected 2 blank lines after class or function definition, found 1

@AndreMiras
Copy link
Member

AndreMiras commented Feb 26, 2024

Thanks for addressing the linting issue, now the test updated recipes builds fail with:

[INFO]:    -> running python3 setup.py build_ext -v
Exception in thread background thread for pid 36920:
Traceback (most recent call last):
  File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/home/user/app/venv/lib/python3.10/site-packages/sh.py", line 1641, in wrap
    fn(*rgs, **kwargs)
  File "/home/user/app/venv/lib/python3.10/site-packages/sh.py", line 2569, in background_thread
    handle_exit_code(exit_code)
  File "/home/user/app/venv/lib/python3.10/site-packages/sh.py", line 2269, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/user/app/venv/lib/python3.10/site-packages/sh.py", line 869, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_2: 

  RAN: /home/user/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3/native-build/python3 setup.py build_ext -v

  STDOUT:
/home/user/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3/native-build/python3: can't open file '/home/user/.local/share/python-for-android/build/other_builds/mysql-connector-python/arm64-v8a__ndk_target_21/mysql-connector-python/setup.py': [Errno 2] No such file or directory

I think it's because you're downloading the java connector.
The Python one is https://dev.mysql.com/get/Downloads/Connector-Python/mysql-connector-python-8.3.0-src.tar.gz

version = '8.3.0'
url = (
f'https://dev.mysql.com/get/Downloads/'
f'Connector-J/mysql-connector-j-{version}.tar.gz'
Copy link
Member

@AndreMiras AndreMiras Feb 26, 2024

Choose a reason for hiding this comment

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

Oops remove that line, we will get there I promise 😅
I've messed up the URL too, the prefix with "Connector-J" should be "Connector-Python" as well.
For example a full working URL would be, but we need to use the {version} template obviously
https://dev.mysql.com/get/Downloads/Connector-Python/mysql-connector-python-8.3.0-src.tar.gz

Copy link
Author

Choose a reason for hiding this comment

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

😂no problem we will fix it!

Copy link
Member

Choose a reason for hiding this comment

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

We're not far from getting this merged, would you mind looking this up? We simply need to get that URL right.
Don't forget to check the linter locally before pushing too

Copy link
Author

Choose a reason for hiding this comment

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

How can i test it locally?

Copy link
Member

Choose a reason for hiding this comment

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

For the linting, running flake8 should be enough.

python -m venv venv
venv/bin/pip install flake8
venv/bin/flake8 pythonforandroid/

Copy link
Member

@AndreMiras AndreMiras left a comment

Choose a reason for hiding this comment

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

The url still needs to be fixed

Comment on lines 8 to 11
url = (
f"https://downloads.mysql.com/archives/get/p/29/file/"
f"mysql-connector-python-py{version}-1ubuntu23.10_amd64.deb"
)
Copy link
Member

Choose a reason for hiding this comment

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

This is giving a 404

wget https://downloads.mysql.com/archives/get/p/29/file/mysql-connector-python-py8.3.0-1ubuntu23.10_amd64.deb

Why didn't you keep it as :

https://dev.mysql.com/get/Downloads/Connector-Python/mysql-connector-python-{version}-src.tar.gz

Or with line split:

    url = (
        "https://dev.mysql.com/get/Downloads/Connector-Python/"
        f"mysql-connector-python-{version}-src.tar.gz"
    )

Copy link
Author

Choose a reason for hiding this comment

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

i change the link to url = (
"https://dev.mysql.com/get/Downloads/Connector-Python/"
f"mysql-connector-python-{version}-src.tar.gz"
). Thank you! i home this time will work!

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.

2 participants