Skip to content

Conversation

@FilipeMarch
Copy link
Contributor

My Kivy application is using pydantic to handle dataclasses and enforcing strong typing.
I am trying to create a recipe for it. I would really appreciate some help on this.

Is anything wrong?

from pythonforandroid.recipe import PythonRecipe


class PydanticRecipe(PythonRecipe):
    version = '1.8.2'
    url = 'https://github.com/samuelcolvin/pydantic.git'
    depends = ['setuptools']
    python_depends = ['Cython==0.29.23', 'devtools==0.6.1', 'email-validator==1.1.2','dataclasses==0.6', 'typing-extensions==3.10.0.0', 'python-dotenv==0.17.1']
    call_hostpython_via_targetpython = False


recipe = PydanticRecipe()

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.

Good start, a few easy things to fix.
I haven't tested the recipe runtime so you will be the one to tell if it works

version = '1.8.2'
url = 'https://github.com/samuelcolvin/pydantic.git'
depends = ['setuptools']
python_depends = ['Cython==0.29.23', 'devtools==0.6.1', 'email-validator==1.1.2','dataclasses==0.6', 'typing-extensions==3.10.0.0', 'python-dotenv==0.17.1']
Copy link
Member

Choose a reason for hiding this comment

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

I would not pin the versions here, but rather at installation time e.g. from the buildozer.spec file.
So here you just put the dependencies without the versions

@FilipeMarch
Copy link
Contributor Author

Is everything right now?

@obfusk
Copy link
Contributor

obfusk commented Aug 3, 2021

@AndreMiras you have to approve the CI for first-time contributors before it will run.

@obfusk
Copy link
Contributor

obfusk commented Aug 3, 2021

@FilipeMarch have you tested the recipe?

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.

Think look better indeed, but pipeline failed because of a linting issue.
Simply add a white space in your python_depends list between 'email-validator' and 'dataclasses'.
I can also do the edit myself if you prefer.
Also if you know how to squash your commits so your PR is only one commit perfect, otherwise we'll try to think about it upon merge

version = '1.8.2'
url = 'https://github.com/samuelcolvin/pydantic/archive/refs/tags/v{version}.zip'
depends = ['setuptools']
python_depends = ['Cython', 'devtools', 'email-validator','dataclasses', 'typing-extensions', 'python-dotenv']
Copy link
Member

Choose a reason for hiding this comment

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

Minor linter issue here it seems:

pythonforandroid/recipes/pydantic/__init__.py:8:62: E231 missing whitespace after ','

Let's fix it so the pipeline runs fully

Copy link
Contributor Author

@FilipeMarch FilipeMarch Aug 4, 2021

Choose a reason for hiding this comment

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

Also if you know how to squash your commits so your PR is only one commit perfect, otherwise we'll try to think about it upon merge

I am searching everywhere here in the Github interface and I can't find where to squash my commits.
Is it possible to do it from github.com interface or do I need to clone the repo and so on?

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for looking into it.
I'm not aware of how to do it from GitHub.
I usually do it from the command line using either git rebase -i... or git reset --soft HEAD~....
I'll squash upon merge then

@FilipeMarch
Copy link
Contributor Author

Sorry to bother, is there any chance you guys could update me if it's correct now that I have added the missing whitespace?

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.

LGTM thanks

@AndreMiras AndreMiras merged commit 505c3df into kivy:develop Aug 8, 2021
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.

3 participants