I want to use setuptools to create a package consisting of two files: foo.py (script) and foo.conf.
Then I want to publish the package on my devpi-server and then install the package using pip.
Suppose I that initially I have my current working directory clean
$ ls -l
total 0
Then I issue pip install (or download?) command
$ pip install -i http://mydevpi.server foo
And get a dir with my two files created
$ tree
.
|
foo
|
|\_ foo.py
|
\_ foo.conf
So questions are:
- what
setuptoolsconfiguration should I use? - what exact
pipcommand should I use to install the package the way I want? Willpip install -i http://mydevpi.server --target=.do the trick?
First write somethings as
setup.pyin foo directory like:(You can use
distutilsorsetuptools)Then
python setup.py bdist_wheel -d TARGETand there will be awhlfile intargetdirectory, copy the path.You can now install using
pip install the_wheel_file_path --prefix="the_path_to_install"Something like this
Then use it by
import foo