Closed ewmiller closed 6 years ago
We have created an issue in Pivotal Tracker to manage this:
https://www.pivotaltracker.com/story/show/154449468
The labels on this github issue will be updated when the story is started.
From your linked documentation, it appears you could also create file setup.cfg
in your app. Does that work?
I tried it and was unsuccessful. I saw the same thing and got my hopes up but then further down in the documentation it says this:
Notice that easy_install will use the setup.cfg from the current working directory only if it was triggered from setup.py through the install_requires option. The standalone command will not use that file.
That makes me think the local setup.cfg
doesn't actually work most of the time. Especially in this case since jsonschema
is using setup_requires
instead of install_requires
which is what the docs said. It's pretty confusing.
@ewmiller if you can post a sample app which exhibits the behavior (and works on your machine) I'll try and get it going.
Merging thread into #86.
Summary
Is there a way to run bash scripts on a deployment environment before the buildpack is executed and
pip install
is called? I am aware of the.profile.d
functionality but it seems like those scripts are executed afterpip install
but before the app itself is started. I need to configure my environment beforepip install
because of an error I'm having with a specific dependency. Explanation follows:Required Info
What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running
cf curl /v2/info && cf version
?What version of the buildpack you are using? python buildpack version 13
If you were attempting to accomplish a task, what was it you were attempting to do? Deploy my application with vendored dependencies to a deployment environment which is behind a firewall (and thus can't access PyPi, so it needs the vendoring to work).
What did you expect to happen? I expected the application to install the vendored dependencies successfully and start.
What was the actual behavior? The app failed to deploy because one of its dependencies tried to reach out to PyPi anyway. The library in question,
jsonschema
, has a setup-time dependency ofvcversioner
. Unfortunately, thepip install --download vendor -r requirements.txt --no-binary :all:
command does not work, becausejsonschema
hasvcversioner
as a dependency only in itssetup.py
script; it is not an install-time dependency. Thus, it does not download and vendorvcversioner
like it's supposed to; it tries to pull it in at setup time, after the vendoring has already taken place.In addition, requiring
vcversioner
explicitly duringpip install
seems to still not work.jsonschema
's setup.py script useseasy_install
instead ofpip
, and apparently even ifvcversioner
has been vendored bypip
,easy_install
still tries to pull it down from PyPi. This issue is documented here: https://github.com/Julian/jsonschema/issues/276Potential Fix?
The fix would be to include a file in the home directory called
~/.pydistutils.cfg
which tellseasy_install
to look for my company's internal python repository instead of calling out to PyPi (this is documented here). I have a bash script that can accomplish this; unfortunately I don't know how to run the script before the buildpack tries to install the python dependencies.So to summarize, I'm just wondering if there's a way to run a bash script in the deployment environment before the python buildpack tries to perform
pip install
. I've tried including said script in the.profile.d/
directory in the root of my application, but it seems from the logs that the script never gets called.Reproduce the Issue
To reproduce the issue, deploy a python app that has
jsonschema
listed in its requirements.txt to an environment which is cut off from the internet, following the PCF docs for vendoring dependencies.Logs
Here is some log output of the error in question:
Please confirm where necessary: