Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Editing and testing a package
#1
Hello, I found a Python package on Github that I want to modify and use for my own application. How can I best edit such a package. I've installed it using pip. Until now I edited the files in the ../site-packages/ folder, but I learned that this is not a good practice. I've made a fork in Github and edit this source code. I am using Spyder to test the code. But Spyder only imports packages from the Anaconda folder, not the Github folder.

I am a beginner in python, but what is the best practice to do this task?
Quote
#2
Typical steps include:

0) Forking the repository... (already done)
1) Installing git.
1.1) Reading basic documentation about git and how to use it.
2) Cloning the repository to local folder, e.g. git clone https://github.com/user_account/repository.git.
3) Modifying the code in the local folder where the repository was cloned.
4) Committing and pushing changes to forked copy of the repository. git add .; git commit -m "A string describing what is done"; git push origin master (probably you will use another branch name (not master), e.g. dev)

===
Are you a windows user? So, you probably will need to type git.exe instead of git command.
I didn't work on Windows a long time.
buran likes this post
Quote
#3
1.fork the repo
2.download/clone your [forked] repo locally
3.install it in editable mode

as you will see in docs, you can combine 2 and 3 in one step. Also normally you would work in virtual environment

then you can work locally, any edits you make will affect your installation. You can push any changes you make back to origin, etc.
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Code Editing Help Rememberthecreed 2 182 Feb-08-2020, 09:56 AM
Last Post: Rememberthecreed
  Editing Dictionaries Astrikor 7 962 Aug-15-2018, 05:05 PM
Last Post: Astrikor

Forum Jump:


Users browsing this thread: 1 Guest(s)