hmm.. and if I want to use pants in a private netw...
# general
c
hmm.. and if I want to use pants in a private network, how can I make this work with all of the pants bootstrap thingy..?
...it will need an update for v2 though, now that i think about it.
you're using v2 with python?
c
I am using v2 yeah, still reading what you posted:)
w
ah... so yea, most of that is still accurate.
c
do I must use pants in a way that it bootstrap itself...? using pip isn't a good idea? maybe use PEX of pants?
w
in particular, bootstrap is covered in "Redirecting tool downloads to other servers"
you can make pip work (by pointing it at an internal mirror). you can also do something like https://www.pantsbuild.org/install.html#pex-based-installation, or you can download PEXes of releases here: https://github.com/pantsbuild/pants/releases
c
yeah I could port it to internal pip mirror, problem is from what I can see that the versions are stuck? I mean.. latest pip version is 1.25.0
w
no
the latest "stable" pip release is 1.25.0
all releases go to pip, but they are mostly dev releases.
1.26.x has taken time to stabilize due to the change to pex 2
can see #pex and #lang-python on that topic
c
I see... and If I want to use pants with pip, doesn't conflict with the "recommanded" way with the ./pants runner..? I mean it should work fine with the pants pip installation + BUILDROOT ?
w
not sure i understand your question
c
when using pants that I just installed with pip, I don't need that ./pants runner script only an empty BUILDROOT file, right? is this still a correct way to use pants ?
w
oh, i see what you're saying.
no: i was not suggesting installing pants with pip globally on your machine.
c
not globally using virtualenv..
w
the
./pants
runner script uses pip inside a virtualenv
you'd want to continue to do that, but point that script at a mirror/proxy of pypi
c
it only uses pypi to bootstrap? it doesn't download or doing other stuff..?
w
the pants runner script fetches pants using pip. after that, the other page i linked you to comes into play. https://www.pantsbuild.org/setup_repo.html#using-pants-behind-a-firewall
c
I see.. sorry for the annoying questions, but again-> why shouldn't I create my own virtualenv, install pants there with pip install, create a BUILDROOT file, and use that virtualenv? what else do I miss or need>?:o
w
installing pants via pip will not get you a global
pants
script
so you'd have to create one
c
what do you mean get a global pants script? it installs within the bin of the virtualenv pants script which I can use
w
if it's an installation mode that you think would be helpful, a patch would be welcome
c
I didn't have to patch or do anything, it just works:X
w
pip install pantsbuild.pants && cd $somewhere && pants
would fail, because there would be no
pants
command.
(afaik)
c
I'm activating the virtualenv first with source venv/bin/activate
or I could ./venv/bin/pants if I really want without activating
when you activate the virtualenv it modifies the PATH so it find pants command
w
...oh. ok. i guess that the wheel does provide a
pants
script... TIL.
c
so I guess it a good to go?:X
w
the downside of that is just that your users would need to use this virtualenv as well
the script is a bit more self contained, and gets them the right version.
but yea
seems like it 😃
c
yeah, there is another sulotion for this but can soft link the pants within the virtualenv to something that exists with PATH
what's important that the shebang of the pants will point to the virtualenv:)
I have another tool that is used with our repo unfortunately so we are used for this kind of workflow, I guess I will dockerize this someday to simplify this:X
and thanks @witty-crayon-22786! I think I understand this better now:P
❤️ 1