SkyWalker
SkyWalker

Reputation: 14307

How to deploy user packages to shared folder "repo"?

I'm new to the Python project tooling and currently finding my ways around it. I'd like to standardize a set of Python projects and to that end I'm doing the following:

  1. Using pyscaffold to generate project templates i.e. conda install pyscaffold && putup my_project.
  2. Testing using python setup.py test
  3. Build source dist using python setup.py sdist bdist_wheel

Provided that I have set the PYTHONPATH to a shared drive /dev/shared/dist/Lib/site-packages/ and where Lib/site-packages/ is the suffix needed by Python AFAIK. How can I have the standardized projects built to output distributions either binary or source to that folder so that pip install my_project or for that matter building dependent projects will pick my packages from there?

Upvotes: 0

Views: 189

Answers (1)

C.Nivs
C.Nivs

Reputation: 13106

You can use the -t (target) flag to install to a folder. So for instance:

mkdir target_folder
TARGET=target_folder

python -m pip install -t $TARGET requests

or using a wheel/dist that you've generated:

python -m pip install -t $TARGET my_package.tar.gz

This should also work for a mounted directory

Upvotes: 1

Related Questions