This 'package' was created following the Python package tutorial here.
Steps used to create the package, push to Test PyPi and then install from Test PyPi:
- Create a repo with a README and MIT license on GitHub.
- Clone into a databricks repo. (If not done already, make sure to add one's GitHub username and PAT in the databricks user credentials section before proceeding to the next step.)
- Create all the necessary additional files on databricks and push to GitHub.
- Go to the GitHub repo and open it in codespaces (which has Python installed on its engine image).
- Once in codespaces, in the terminal run the additional commands in the terminal to pip install build, build the dist/ and push to Test PyPi (in this case).
- Check that the package is available on Test PyPi.
- Open up a Python notebook anywhere on databricks and run:
!pip install --index-url https://test.pypi.org/simple/ --no-deps example_pkg_nsulliv3
- Next run:
from example_pkg_nsulliv3 import example
example.add_one(2)
If all the steps were correctly followed, this should yield a printed output of 3.