2

The language around packaging python projects in the documentations suggests that it is exclusively for distributing or exporting the project. So what should I do with projects I intend to use personally?

Should I package them anyway? If not, what steps should I take so that I can run my code on any machine with the right version of python? Would packaging a project even accomplish that? Is there even any way to "package" all of a project's files and relevant libraries together, with the end product being a folder/file rather than an install-able package?

I'm sorry if this is basic, I'm very confused, thank you for your time.

RichKat
  • 57
  • 1
  • 8
  • If you're only using it yourself, and don't want to `pip install` it via PyPI, just clone the source code from the repo. – jonrsharpe Jul 29 '20 at 20:36
  • Only package/distribute to PyPi if you feel the project is generalized enough for anyone to use, and valuable enough for the community to benefit from. – TayTay Jul 29 '20 at 20:37
  • Yes, its a good idea to package projects especially if you want to use them in multiple environments. `pip` can install a local wheel or archive, a local directory where you've checked out the code, a private web server, one of several version control systems like git. Once you've installed, you get rid of all the headaches surrounding python's need to find the module before import. As for packaging libraries with it.... you can specifiy python libs in the requirements Platform specific non python libs can be more difficult. – tdelaney Jul 29 '20 at 20:47
  • 1
    So for personal projects, just pip freeze requirements and copy-paste the folder? – RichKat Jul 30 '20 at 10:32

1 Answers1

0

For personal use I do not package, except I am very sure there is no need to modify it anymore. And that is very rarely my case. Once it is packaged and published, public or private package repository you get the package and to make changes is more complicated but possible. I prefer to have the project repository and be able to edit and push the changes to remote locations.

Many packaging tools like poetry make it easy to build but also to install requirements and keep track of them. So, there is no hustle with managing requirements.

RichLux
  • 1
  • 1