Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Cleanup] Set up poetry, lockfile, mypy, and black#1

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
susodapop merged 11 commits intomainfrominit-poetry
May 31, 2022

Conversation

@susodapop
Copy link
Contributor

@susodapopsusodapop commentedMay 31, 2022
edited
Loading

Description

This PR handles a few cleanup tasks. None of these changes should affect the behaviour of the connector / package. These are administrative / build changes that will streamline build / publish in the future.

  • Replacessetup.cfg withpyproject.toml
  • Locks the dependencies forv2.0.2
  • Wires inmypy intopyproject.toml so type checks can be run withpoetry run mypy. Generated files from thrift are not checked.
  • Wires inblack intopyproject.toml so code formatting can be checked automatically
  • Sets themaintainers metadata to a Databricks distro (databricks-sql-connector-maintainers@databricks.com)
  • Blacks the codebase

These changes make way for subsequently automating build / publish using Github actions, which will be borrowed from thehttps://github.com/databricks/databricks-sql-cli repository.

How is this tested?

Manually for now:

  1. Make surepoetry is installed on your system
  2. Check out this branch of the repository
  3. Runpoetry install
  4. Runpoetry run mypy src
  5. Runpoetry run black src --check
  6. Runpoetry build
  7. Within a fresh virtualenv, install the package generated in step 6

@arikfr
Copy link

I would also revise the folder structure to be more idiomatic (doesn't have to be in this PR).

susodapop reacted with thumbs up emoji

@susodapop
Copy link
ContributorAuthor

Thanks@arikfr that's coming next :)

description = "Atomic file writes."
category = "dev"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
Copy link
Collaborator

@moderakhmoderakhMay 31, 2022
edited
Loading

Choose a reason for hiding this comment

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

">=2.7
are we supporting python 2?

I think pysql only support python 3. isn't that right? why do we need python 2 version of the dependency here?

description = "Classes Without Boilerplate"
category = "dev"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto.

@moderakhmoderakh self-requested a reviewMay 31, 2022 21:58
@susodapop
Copy link
ContributorAuthor

susodapop commentedMay 31, 2022 via email
edited
Loading

I would disregard any specs you see in the lockfile, as this isprocedurally generated by Poetry. The only relevant specification is inpyproject.toml which says Python 3.7 or above.
On Tue, May 31, 2022 at 16:58, Moe Derakhshani ***@***.***> wrote: ***@***.**** approved this pull request. ------------------------------ In cmdexec/clients/python/poetry.lock <#1 (comment)> : > @@ -0,0 +1,575 @@ +[[package]] +name = "atomicwrites" +version = "1.4.0" +description = "Atomic file writes." +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[[package]] +name = "attrs" +version = "21.4.0" +description = "Classes Without Boilerplate" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" ditto. — Reply to this email directly, view it on GitHub <#1 (review)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AECG7B5POD5OP5ATFA45SE3VM2DQRANCNFSM5XN64NFA> . You are receiving this because you authored the thread.Message ID: ***@***.***>
moderakh reacted with thumbs up emoji

Copy link
Collaborator

@moderakhmoderakh left a comment

Choose a reason for hiding this comment

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

Thanks. LGTM.

One question, not related to this PR. The name of the repo isdatabricks-sql-connector I wonder as in future we are going to have SDK for other languages (go, nodejs) how we should name the repos?

maybe${lang}-databricks-sql-connector ?

@susodapop
Copy link
ContributorAuthor

That works for me. Can I make that change right away?

@susodapopsusodapop merged commitbed1669 intomainMay 31, 2022
@susodapopsusodapop deleted the init-poetry branchMay 31, 2022 22:45
susodapop pushed a commit that referenced this pull requestJun 2, 2022
* Updated pyproject.toml using interactive `poetry init`* Specify dependencies to match those in setup.cfg* Revise dependency specifications and build a fresh lockfile.* Move .gitignore to base* Update .gitignore* Specify readme.md location (needed for Pypi)* Add mypy specification. Ignore generated files.* Fix failing mypy checks* Add black dependency* Black the codebase
jayantsing-db added a commit to jayantsing-db/databricks-sql-python that referenced this pull requestApr 9, 2025
jayantsing-db added a commit to jayantsing-db/databricks-sql-python that referenced this pull requestMay 12, 2025
Signed-off-by: Jayant Singh <jayant.singh@databricks.com>
saishreeeee pushed a commit that referenced this pull requestJun 4, 2025
* Updated pyproject.toml using interactive `poetry init`* Specify dependencies to match those in setup.cfg* Revise dependency specifications and build a fresh lockfile.* Move .gitignore to base* Update .gitignore* Specify readme.md location (needed for Pypi)* Add mypy specification. Ignore generated files.* Fix failing mypy checks* Add black dependency* Black the codebaseSigned-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@moderakhmoderakhmoderakh approved these changes

+1 more reviewer

@arikfrarikfrarikfr approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@susodapop@arikfr@moderakh

[8]ページ先頭

©2009-2025 Movatter.jp