Skip to content

Conversation

@patcon
Copy link
Collaborator

@patcon patcon commented Jan 2, 2025

I wanted it to be more clear how to use this code in a Jupyter Notebook, so I added minimal boilerplate and packaging setup and docs to make that simpler.

(A bunch of places will need the branch and repo updated after approval, but before merge. I'll make suggestions in all those places, but no need to merge them until we're ready, so that others can more easily test)

Here's what's happening:

  • reorganized files into proper library locations, added pyproject.toml
  • moved example usage into main, so only executed when script called directly (not on library import)
  • updated README
  • added recommendation of uv for package management
  • added version-controlled ipynb with example library usage, and easy deployment on Google Collab. source notebook
  • added a stub makefile to make general development tasks simpler
  • made sure proper files were ignored for python package that's a library

@patcon patcon requested a review from eterps January 2, 2025 04:10
Comment on lines +19 to +21
pip install git+https://github.com/patcon/polislite.git@python-package

uv add git+https://github.com/patcon/polislite.git@python-package
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
pip install git+https://github.com/patcon/polislite.git@python-package
uv add git+https://github.com/patcon/polislite.git@python-package
pip install git+https://github.com/eterps/polislite.git@main
uv add git+https://github.com/eterps/polislite.git@main

"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/github/patcon/polislite/blob/python-package/polislite_library_usage.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
"<a href=\"https://colab.research.google.com/github/patcon/polislite/blob/python-package/polislite_library_usage.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
"<a href=\"https://colab.research.google.com/github/eterps/polislite/blob/main/polislite_library_usage.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"

{
"cell_type": "code",
"source": [
"!pip install git+https://github.com/patcon/polislite.git@python-package"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
"!pip install git+https://github.com/patcon/polislite.git@python-package"
"!pip install git+https://github.com/eterps/polislite.git@main"

Comment on lines +47 to +53
"Collecting git+https://github.com/patcon/polislite.git@python-package\n",
" Cloning https://github.com/patcon/polislite.git (to revision python-package) to /tmp/pip-req-build-b8924s2s\n",
" Running command git clone --filter=blob:none --quiet https://github.com/patcon/polislite.git /tmp/pip-req-build-b8924s2s\n",
" Running command git checkout -b python-package --track origin/python-package\n",
" Switched to a new branch 'python-package'\n",
" Branch 'python-package' set up to track remote branch 'python-package' from 'origin'.\n",
" Resolved https://github.com/patcon/polislite.git to commit 9252f24c4acb6ea38a25c1b51b4546d087e91747\n",
Copy link
Collaborator Author

@patcon patcon Jan 2, 2025

Choose a reason for hiding this comment

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

Suggested change
"Collecting git+https://github.com/patcon/polislite.git@python-package\n",
" Cloning https://github.com/patcon/polislite.git (to revision python-package) to /tmp/pip-req-build-b8924s2s\n",
" Running command git clone --filter=blob:none --quiet https://github.com/patcon/polislite.git /tmp/pip-req-build-b8924s2s\n",
" Running command git checkout -b python-package --track origin/python-package\n",
" Switched to a new branch 'python-package'\n",
" Branch 'python-package' set up to track remote branch 'python-package' from 'origin'.\n",
" Resolved https://github.com/patcon/polislite.git to commit 9252f24c4acb6ea38a25c1b51b4546d087e91747\n",
"Collecting git+https://github.com/eterps/polislite.git@main\n",
" Cloning https://github.com/eterps/polislite.git (to revision main) to /tmp/pip-req-build-b8924s2s\n",
" Running command git clone --filter=blob:none --quiet https://github.com/eterps/polislite.git /tmp/pip-req-build-b8924s2s\n",
" Running command git checkout -b main --track origin/main\n",
" Switched to a new branch 'main'\n",
" Branch 'main' set up to track remote branch 'main' from 'origin'.\n",
" Resolved https://github.com/eterps/polislite.git to commit 9252f24c4acb6ea38a25c1b51b4546d087e91747\n",

@eterps
Copy link
Owner

eterps commented Jan 2, 2025

Hi @patcon, I'll review your proposed changes at a later time as I'm currently down with the flu.

@patcon
Copy link
Collaborator Author

patcon commented Jan 2, 2025

Thanks! Pls do rest up. Eager to work with you on this whenever you find time :)

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