Skip to content

sqlparse: add python3 package#10375

Merged
neheb merged 1 commit into
openwrt:masterfrom
peter-stadler:sqlparse
Nov 5, 2019
Merged

sqlparse: add python3 package#10375
neheb merged 1 commit into
openwrt:masterfrom
peter-stadler:sqlparse

Conversation

@peter-stadler
Copy link
Copy Markdown
Contributor

@peter-stadler peter-stadler commented Oct 28, 2019

Maintainer: Peter Stadler peter.stadler@student.uibk.ac.at
Compile tested: MIPS 74K, Asus RT-N16, master snapshot
Run tested: MIPS 74K, Asus RT-N16, master snapshot, run some tests from the package directory

Description: This is a dependency for django-cors-headers (see my other PR) and in turn for the etesync-server (I will update the corresponding PR later).

@neheb
Copy link
Copy Markdown
Contributor

neheb commented Oct 29, 2019

Copy link
Copy Markdown
Member

@BKPepe BKPepe left a comment

Choose a reason for hiding this comment

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

While you will take a look at my feedback, you might want to check this example.

Comment thread lang/python/python3-sqlparse/Makefile Outdated
Comment thread lang/python/python3-sqlparse/Makefile Outdated
Comment thread lang/python/python3-sqlparse/Makefile Outdated
Comment thread lang/python/python3-sqlparse/Makefile Outdated
Comment thread lang/python/python3-sqlparse/Makefile
@peter-stadler
Copy link
Copy Markdown
Contributor Author

Thank you very much :-) I changed it to use pypi.mk fixing the license info and adding a source package, too. I have one question left: Should I add the sqlformat?

Comment thread lang/python/python3-sqlparse/Makefile Outdated
@peter-stadler peter-stadler force-pushed the sqlparse branch 3 times, most recently from 614f042 to 56eabee Compare October 29, 2019 16:29
@jefferyto
Copy link
Copy Markdown
Member

Perhaps you can add a separate package for sqlformat, then add python3-sqlparse and python3-pkg-resources as dependencies for that package.

@peter-stadler
Copy link
Copy Markdown
Contributor Author

I looked into sqlformat: It is using pkg-resources to call the sqlparse/__main__.py script. We can avoid the dependency by installing this script as /usr/bin/sqlformat.

Alternatively, a python3 -m sqlparse would work, too.

@peter-stadler
Copy link
Copy Markdown
Contributor Author

(fixed the whitespace error)

@peter-stadler
Copy link
Copy Markdown
Contributor Author

(nothing changed)

@jefferyto
Copy link
Copy Markdown
Member

I don't know enough about how Python handles main scripts to say if there are any side effects to using __main__.py directly, so I suppose we can go with it for now.

Would be great if you can squash the two commits.

This is a dependency for django-cors-headers.

Install sqlformat without using pkg-resources:
Upstream uses the entry_point function to call the __main__.py script.
We copy it for avoiding the dependency on pkg_resources and full python3 in turn.

Signed-off-by: Peter Stadler <peter.stadler@student.uibk.ac.at>
@peter-stadler
Copy link
Copy Markdown
Contributor Author

I did squash the commits.

As I know python -m sqlparse would just call the __main__.py, the entry_point of the pkg-resources would do a bit more, e.g. check the version or so, but I am not sure what are all the side effects ...

@neheb neheb merged commit e1af55f into openwrt:master Nov 5, 2019
@peter-stadler peter-stadler deleted the sqlparse branch November 5, 2019 13:42
@peter-stadler peter-stadler restored the sqlparse branch November 5, 2019 14:12
@peter-stadler peter-stadler deleted the sqlparse branch November 5, 2019 17:04
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.

5 participants