简体   繁体   中英

When cloning my edited forked git repository the changes are not reflected and original repository is cloned instead

my goal is to fork an original repository,edit it, and then clone it on my beaglebone black.

Here are the links to the existing repositories: https://github.com/adafruit/Adafruit_Python_BNO055 https://github.com/adafruit/Adafruit_Python_GPIO

Here are the links to my edited forked version of the repositories: https://github.com/frank2597/Adafruit_Python_BNO055 https://github.com/frank2597/Adafruit_Python_GPIO

I made a few changes... in Adafruit_Python_GPIO/Adafruit_GPIO/I2C.py i changed the I2C bus to 2 on line 55:

return 2

in Adafruit_Python_GPIO/setup.py i changed line 32 to:

url = 'https://github.com/frank2597/Adafruit_Python_GPIO/',

in Adafruit_Python_BNO055/setup.py i changed lines 27 and 28 to:

url = 'https://github.com/frank2597/Adafruit_Python_BNO055/',

dependency_links =['https://github.com/frank2597/Adafruit_Python_GPIO/tarball/master#egg=Adafruit-GPIO-0.9.3'],

then i cloned Adafruit_Python_BNO055 and installed the dependency Adafruit_Python_GPIO with setup.py:

git clone https://github.com/frank2597/Adafruit_Python_BNO055.git
cd Adafruit_Python_BNO055
sudo python setup.py install

However unzipping the Adafruit_GPIO-1.0.4-py2.7.egg file and looking into the I2C.py file which is located here:

/usr/local/lib/python2.7/dist-packages/Adafruit_GPIO-1.0.4-py2.7.egg/Adafruit_GPIO/GPIO.pyc

i noticed that my changes have not been reflected and the I2C bus is still set to 1. It seems its still cloning the original repository and not my edited forked version. Does anyone have any idea what I may be doing wrong? Thank you.

dependency_links were declared obsolete and finally removed in pip 19.0. The replacement for it is install_requires with special syntax (supported since pip 19.1):

install_requires=[
    'package_name @ git+https://gitlab.com/<PRIVATE_ORG>/<PRIVATE_REPO>.git@<COMMIT_ID>'
]

See https://pip.readthedocs.io/en/stable/reference/pip_install/#requirement-specifiers and https://www.python.org/dev/peps/pep-0440/#direct-references

This requires pip install including pip install. and doesn't work with python setup.py install .

In your particular case this means that Adafruit_Python_BNO055/setup.py ignores dependency_links and installs Adafruit-GPIO from PyPI. The solution is to remove dependency_links completely and install dependency Adafruit-GPIO using pip with install_requires in setup.py :

install_requires=[
    'Adafruit-GPIO @ git+https://github.com/frank2597/Adafruit_Python_GPIO',
    'pyserial',
]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM