Stella Lie
Stella Lie

Reputation: 124

Good workflow to manage modified Django third party modules

Basically I'm using virtualenv and pip to manage my all 3rd-party modules, and so far it's going great. However as I'm developing, I found out that these 3rd-party modules got various very little bugs and I've been fixing them right at my 'virtualenv' folder in which obviously isn't under version control and those fixes will get lost if I ever do pip --upgrade or re-create the 'virtualenv'.

I've proposed fixes to their respective repo but some of them are not very active and it will took a while before my fix can be implemented.

My questions is, what is a good workflow in case like this? Should I just put the 3rd-party modules right under my project folder thus I can ensure my fixes would stay but I've read doing that is bad?

Upvotes: 0

Views: 39

Answers (1)

DavidM
DavidM

Reputation: 1437

What you are describing is a difficult problem that does not have a good solution. I would generally copy the module into my own project, but I would only do that as a last resort, and I have not had to do so yet.

Instead, if I'm using a module and it has a class Foo that isn't quite what I need. I will do:

class MyFoo(Foo):
    ...

and override whatever methods I need to. Then, I just use MyFoo in my project. This generally gives me the behavior I need without resorting to modifying the module's code.

But in general, if I'm inclined to modify the module's source code, I will first look extensively for alternatives. So far, I've been able to avoid it.

Upvotes: 1

Related Questions