Reputation: 439
What is best practice for incorporating git repositories into the own project which do not contain a setup.py? There are several ways that I could imagine, but it doesn't seem clear which is best.
Copy the relevant code and include it into the own project
pro:
con:
Cloning the repository and writing a setup.py and install it with pip
pro:
con:
Clone the repository and add the path to the project's search path
pro:
con:
Upvotes: 0
Views: 681
Reputation: 10355
In my opinion, you forgot the best option: Ask the original project maintainer to make the package available via pip
. Since pip
can install directly from git repositories this doesn't take more than a setup.py
-- in particular, you don't need a PyPI account, you don't need to tag releases, etc.
If that's not possible then I would opt for your second option, i.e. provide my own setup.py
file in a fork of the project. This makes incorporating upstream changes pretty easy (basically you simply git pull
them from the upstream repo) and gives you all the benefits of package management (automatic installation, dependency management, etc.).
Upvotes: 1