इसलिए मैं अपने सटीक सवाल का this answer पाया cmdclass स्थापित एक कस्टम उठा नहीं है, लेकिन किसी कारण से यह काम नहीं कर रहा:पिप
$ cat /tmp/testinstall/setup.py
:
from setuptools.command.install import install
from setuptools import setup
class verifying_install(install):
def run(self):
print "running........"
install.run(self)
print "verifying........"
setup(name='test',
version='1',
py_modules=['test'],
include_package_data=True,
zip_safe=True,
cmdclass={'install': verifying_install}
)
लेकिन फिर भी, यहां तक कि setup.py install
काम करता है, हालांकि: :
➜ /tmp/testinstall
$ mktmpenv && cd -
This is a temporary environment. It will be deleted when you run 'deactivate'.
(5bc7db7ca1b34ec5)➜ /tmp/testinstall
$ python setup.py install
running install
running........
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying test.py -> build/lib.linux-x86_64-2.7
running egg_info
creating test.egg-info
writing test.egg-info/PKG-INFO
writing top-level names to test.egg-info/top_level.txt
writing dependency_links to test.egg-info/dependency_links.txt
writing manifest file 'test.egg-info/SOURCES.txt'
reading manifest file 'test.egg-info/SOURCES.txt'
writing manifest file 'test.egg-info/SOURCES.txt'
running install_lib
copying build/lib.linux-x86_64-2.7/test.py -> /home/bwm/.virtualenvs/5bc7db7ca1b34ec5/lib/python2.7/site-packages
byte-compiling /home/bwm/.virtualenvs/5bc7db7ca1b34ec5/lib/python2.7/site-packages/test.py to test.pyc
running install_egg_info
Copying test.egg-info to /home/bwm/.virtualenvs/5bc7db7ca1b34ec5/lib/python2.7/site-packages/test-1-py2.7.egg-info
running install_scripts
verifying........
(नोट running...
और verifying......
लाइनों)
निर्देशिका के pip install
काम नहीं करता:
(5bc7db7ca1b34ec5)➜ /tmp/testinstall
$ deactivate && mktmpenv && cd - && pip install .
Removing temporary environment: 5bc7db7ca1b34ec5
Removing 5bc7db7ca1b34ec5...
New python executable in 4cac61c13d080257/bin/python
Installing Setuptools...done.
Installing Pip....done.
This is a temporary environment. It will be deleted when you run 'deactivate'.
/tmp/testinstall
Unpacking /tmp/testinstall
Running setup.py egg_info for package from file:///tmp/testinstall
Cleaning up...
और sdist की स्थापित पिप काम नहीं करता है या तो:
(4cac61c13d080257)➜ /tmp/testinstall
$ python setup.py sdist
running sdist
# ..snip..
creating dist
Creating tar archive
removing 'test-1' (and everything under it)
(4cac61c13d080257)➜ /tmp/testinstall
$ deactivate && mktmpenv && cd -
Removing temporary environment: 4cac61c13d080257
Removing 4cac61c13d080257...
New python executable in 9a42f3a58809f1a3/bin/python
Installing Setuptools...done.
Installing Pip...done.
This is a temporary environment. It will be deleted when you run 'deactivate'.
/tmp/testinstall
(9a42f3a58809f1a3)➜ /tmp/testinstall
$ ls dist
test-1.tar.gz
(9a42f3a58809f1a3)➜ /tmp/testinstall
$ pip install dist/test-1.tar.gz
Unpacking ./dist/test-1.tar.gz
Running setup.py egg_info for package from file:///tmp/testinstall/dist/test-1.tar.gz
Cleaning up...
नोट running...
की कमी है और दोनों में verifying...
शब्द उन।
किसी को भी कोई विचार है कि यहां क्या हो रहा है?
मैंने यह कोशिश की है, लेकिन यह pypi से sdist पैकेज को स्थापित करने का प्रयास करते समय काम नहीं करता है। संबंधित चर्चा https://chat.stackoverflow.com/rooms/150536/discussion-between-swiftsnamesake-and-collins-a देखें। गिट रिपॉजिटरी से सीधे स्थानीय इंस्टॉल और इंस्टॉलेशन काम करता है। – salomonvh