0

I'm using a package that I would like to be able to edit directly instead of appending views and functions to the package from my project.

How would I do this? Can I copy the package into my project/root - or is this bad? I tried moving the package and then the Scripts could not execute the commands for that package anymore. Whats the best practice for this kind of stuff?

I am aware that moving the package will mean I can't update it, but that's not an issue, editing the package would just be easier than appending things to it. Open to all suggestions :)

Plewis
  • 119
  • 10
  • 2
    Best practice is to **fork** the package to your own separate repository and add it with `-e` to your requirements file, e.g. `-e git+git://github.com//.git#egg=`. Alternatively you can just add it to your source just like any other app. You need to add the app directory of the package, not the entire package. – dirkgroten Mar 19 '20 at 10:32
  • What is the #egg= in this context? – Plewis Mar 23 '20 at 13:51
  • I have forked the package, but don't know how to add the forked package to my requirements.txt, could you elaborate for me the steps :) – Plewis Mar 23 '20 at 13:52
  • egg= should be the name of the package that you would use in the `pip install ...` command. – dirkgroten Mar 23 '20 at 14:05
  • In your requirements file add exactly the line I mentioned, starting with `-e` – dirkgroten Mar 23 '20 at 14:06
  • How come it makes a src folder in my project with the package and a .txt file saying: "This file is placed here by pip to indicate the source was put here by pip. Once this package is successfully installed this source code will be deleted (unless you remove this file)." – Plewis Mar 23 '20 at 15:01
  • Figure it out thanks for the help :) – Plewis Mar 23 '20 at 23:25

0 Answers0