user5813071
user5813071

Reputation:

Where does main code need to be for a pip installable package?

I am still a little confused on how to setup a project to make it pip installable. I have seen some tutorials, but I am not sure which file needs to contain what. Excluding tests, my program has 3 main files:

  1. package.py -- this is where main class/methods live.
  2. helpers.py -- this is where helper functions live.
  3. clf.pkl -- this is a pickled classifier.

Which one of these need to go into an init file etc?

Upvotes: 0

Views: 49

Answers (1)

Umesh Chaudhary
Umesh Chaudhary

Reputation: 411

You need to put all of your code into a python package first such as your_package and structure should be like

/main_package
    /your_package
        __init__.py
        package.py
        helpers.py
        clf.pkl
    setup.py
    LICENSE
    README.md

Check this tutorial for better explanation https://packaging.python.org/tutorials/packaging-projects/

Upvotes: 1

Related Questions