-
Notifications
You must be signed in to change notification settings - Fork 0
TIMX 414 - initial library scaffolding #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 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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Why these changes are being introduced: This python library is designed to be installed as a dependency in other applications. This scaffolding supports installation directly from the Github repository. How this addresses that need: * Creates project files that support local installation and development * Creates project files that support installation from Github as a library * Establishes the library name when imported and used as 'timdex_dataset_api' Side effects of this change: * None Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/TIMX-414
ehanson8
approved these changes
Dec 2, 2024
ehanson8
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
jonavellecuerdo
requested changes
Dec 2, 2024
Contributor
jonavellecuerdo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! I just have two minor change requests. 🤓
Why these changes are being introduced: Formerly, the python library version number was set via the pyproject.toml file. This worked, as the actual package itself could provide the version by reading the installed package metadata. However, some best practices discourage this, as it relies on the packing and metadata reading. We may choose to revisit this approach as we get farther along, particularly if installing via a Github tag or release is important. How this addresses that need: * Version is set in timdex_dataset_api.__init__.__version__, allowing it to be read directly from the library * Packaging via pyproject.toml uses this version number via a "dynamic" metadata field Side effects of this change: * None at this time Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/TIMX-414
5139b78 to
3339f13
Compare
jonavellecuerdo
approved these changes
Dec 2, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose and background context
This PR scaffolds the project as an installable python library. Very little beyond that at this point.
The repository is called
timdex-dataset-api(dashes), but the importable library that is installed istimdex_dataset_apito be fully python compliant.This library will be used by Transmogrifier, pipeline lambdas, and TIM when interacting with the TIMDEX parquet dataset in S3. Other contexts for usage may emerge, but these are known at this time.
This library will support basic operations like:
For more details on why a standalone python library, please see associated parent ticket: https://mitlibraries.atlassian.net/browse/TIMX-408.
How can a reviewer manually see the effects of these changes?
Local development of library
Clone repo, then normal things,
make testandmake lint.Install as library for another project
1- create a new, temporary python project
2- install library from github via this PR's commit
Note the
Pipfilewill contain something like this:This demonstrates two things:
3- open Ipython shell and confirm importable
This demonstrates that the version number in the
pyproject.toml --> project.versionsection is what sets the version when installed.Includes new or updated dependencies?
YES
Changes expectations for external applications?
NO
What are the relevant tickets?
Developer
Code Reviewer(s)