Goals:
- Make use of modern Python packaging toolsets to deploy/install proprietary packages into some virtualenv.
- The installed packages should include compiled *.pyc(or *.pyo) only without source files.
- There are a couple of packages, and a vendor name (here we choose dgmx for our studio) is used as the package names. Therefore, the installed packages would be something like dgmx/alucard, dgmx/banshee, dgmx/carmilla, ...
- The file hierarchy of installed packages should be like ones by
python setup.py install --single-version-externally-managed
orpip install
. Refer to How come I can't get the exactly result to *pip install* by manually *python setup.py install*?
Question in short:
I like to deploy proprietary namespaced packages into a virtualenv by only compiled *.pyc(or *.pyo) files, in which the file/directory hierarchy just reflects the namespace with polluting sys.path by lots of ooxx.egg paths.
Something I have tried:
python setup.py bdist_egg --exclude-source-files
theneasy_install ooxx.egg
.- pollute "sys.path" for each namespace package.
python setup.py install --single-version-externally-managed
.- not *.pyc only.
- the "install_requires" got ignored!
- need to manually put a ooxx.egg-info/installed-files.txt to make uninstall work correctly.
pip install .
in the location of "setup.py".- not *.pyc only.
pysetup install .
in the location of "setup.py".- not *.pyc only.
Update:
My current idea is to follow method 2.
python setup.py egg_info --egg-base .
# get requires.txtpython setup.py install --single-version-externally-managed --record installed-files.txt
# get installed-files.txt- manually install other dependencies through "requires.txt"
- manually delete installed source files (*.py) through "installed-files.txt"
- remove source files (*.py) from "installed-files.txt" and put it into deployed "ooxx.egg-info/installed-files.txt"
References: